[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  how do i pull back a sent command from the mud
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

how do i pull back a sent command from the mud

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Carltheprogrammer   (2 posts)  [Biography] bio
Date Wed 30 Mar 2016 12:44 PM (UTC)
Message
I play this mud where you have to manually block attacks after 2-3 seconds and that is working fine , but the problem is that users can 'fake' an input around 2.6-3.0 seconds and then the command is sent late. I was wondering if there was a way to pull back a previous command from a mud.
Here is an example of one of my auto block triggers
<triggers>
<trigger
enabled="y"
match="*begins a elbow charging motion... *"
send_to="12"
sequence="100"
>
<send>Execute ("empty_queue")
Number = GetVariable("Number")
DoAfter (Number, "parry high")</send>
</trigger>
</triggers>
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Wed 30 Mar 2016 01:45 PM (UTC)
Message
What do you mean by pull back a previous command?

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Carltheprogrammer   (2 posts)  [Biography] bio
Date Reply #2 on Wed 30 Mar 2016 04:04 PM (UTC)
Message
as in replace or cancel the command sent to the mud
[Go to top] top

Posted by Fiendish   USA  (1,641 posts)  [Biography] bio   Global Moderator
Date Reply #3 on Wed 30 Mar 2016 04:12 PM (UTC)
Message
Carltheprogrammer said:

as in replace or cancel the command sent to the mud
Ah. I see. The answer is complicated so let me start with a little story...

My mom really likes getting postcards from me, because I live in another country right now.
So every day I drop a new postcard off at the post office. There the attendant smiles, takes my postcard, walks over to a truck, puts the postcard on the truck, and the truck then drives away from the post office and over to the airport. The truck driver takes my postcard, puts it on an airplane, and then the plane takes off on its way to my mother, where a very similar process happens on her end but in reverse.

Now one day I was on my way home from the post office and I suddenly realized that I'd made aterrible error in my postcard. Now I don't like anyone seeing me make errors, not even my mother! So I decided that I needed to go and retrieve my postcard before th... Oh no! I saw the attendant put my postcard on the truck, and then I saw the truck leave. So the truck is on its way to the airport to put the postcard on the airplane. Maybe it's even already there! Oh no! I'd better drive REALLY FAST to the airport to catch my postcard before it gets on the plane! I hope I can get there in time!

So I finally get to the airport and I can see the truck! I can see the driver loading my postcard on the airplane!
IT'S NOT TOO LATE!
I'M RUNNING!
I'M RUNNING!
JUST A LITTLE FARTHER! I CAN MAKE IT!
"STOP! DON'T TAKE MY POSTCARD!"
THEY'RE LOOKING AT ME! I CAN TELL THEY'RE GOING TO STOP!
I CAN TELL I'VE MADE IT!
*boom*
AHHHH! THEY SHOT ME! RIGHT THROUGH THE LEGS! I'M BLEEDING!
THEY'RE NOT GOING TO STOP!
I DIDN'T MAKE IT!
OH GOD! THERE'S SO MUCH BLOOD!
IT'S ALL OVER!
GOODBYE CRUEL WORLD!

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 30 Mar 2016 08:39 PM (UTC)
Message
Sorry to hear of your loss, Fiendish. :(


Meanwhile, as I understand the question, after a certain attack you want to queue up a block 3 seconds later, but want the option of cancelling it maybe 2.5 seconds later (ie. 0.5 seconds before it it sent)?

I think that is easy enough to do. DoAfter basically sets up a temporary timer. So instead of DoAfter, make your own timer (see AddTimer), and give it a name. Set it to send whatever it is you want after 3 seconds. Make it a one-shot timer so it doesn't keep sending it.

Then if you realize (before it does its stuff) that you want to cancel it you just delete the timer.

Template:function=AddTimer AddTimer

The documentation for the AddTimer script function is available online. It is also in the MUSHclient help file.



Template:function=DeleteTimer DeleteTimer

The documentation for the DeleteTimer script function is available online. It is also in the MUSHclient help file.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,647 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]