Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Timed Trigger help
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Jenny
(4 posts) Bio
|
| Date
| Sat 29 Apr 2006 07:44 AM (UTC) |
| Message
| I'm trying to figure out how to set a trigger to pop out a command 4 seconds after (triggered). Now, If something else happens during that time, I want the script to forget the first command, reset the timer, and fire off the second command, Again, Unless something else comes in.
For example.
Mikale retracts his right arm...
(4 seconds later)
dodge right <--- command
Now if Mikale attacked, Waited 3 seconds, then attacked again, I dont want that first block to go off, I want a timer to reset, and block 4 seconds after the second attack, Or third or fouth...
Any help? | | Top |
|
| Posted by
| Flelm
(15 posts) Bio
|
| Date
| Reply #1 on Sat 29 Apr 2006 05:58 PM (UTC) |
| Message
| Something like this should work, assuming it's only right/left arms/legs. If not, you'll need to edit the regexp. (note: the function is for Lua)
If you'd like to know how the mechanics of this work, please let me know. If it doesn't work, sorry in advance.
<triggers>
<trigger
enabled="y"
group="dodge_timer"
match="^.* retracts (?:his|her) (right|left) (?:arm|leg)\.\.\.$"
regexp="y"
send_to="12"
sequence="100"
>
<send>AddTimer ("dodge_timer", 0, 0, 4, "dodge " .. "%1", timer_flag.Enabled + timer_flag.OneShot + timer_flag.Replace, "")</send>
</trigger>
</triggers>
| | Top |
|
| Posted by
| Jenny
(4 posts) Bio
|
| Date
| Reply #2 on Sat 29 Apr 2006 08:29 PM (UTC) |
| Message
| Well, I've tried this out and it doesnt seem to work.
I know absolutely nothing about MushClient, I'm more of a Zmud person. I've got a buddy helping me. He knows alot of coding, But not so much in the Trigger/Scripting area, So anything explanitory you could add would be greatly appreciated. | | Top |
|
| Posted by
| Flelm
(15 posts) Bio
|
| Date
| Reply #3 on Sat 29 Apr 2006 08:42 PM (UTC) |
| Message
| What part isn't working? I tested it and it seems ok for me.
Basically, what I did was make a regexp (regular expression) trigger that triggers off of:
"<anything> retracts (his or her) (right or left) (arm or leg)..."
If the line is not EXACTLY like that, you'll need to fix the regexp.
Then, I set up a timer to send "dodge (right or left)" in 4 seconds. If a timer already exists, it overwrites and resets the timer.
Did you enable scripting, and set the language to Lua? | | Top |
|
| Posted by
| Jenny
(4 posts) Bio
|
| Date
| Reply #4 on Sat 29 Apr 2006 11:01 PM (UTC) |
| Message
| Compile error
[string "Script file"]:1: unexpected symbol near `<'
Thats what it says when I load the file in.
Maybe theres a special way to load these files into Mush? | | Top |
|
| Posted by
| Flelm
(15 posts) Bio
|
| Date
| Reply #5 on Sat 29 Apr 2006 11:07 PM (UTC) |
| Message
| |
| Posted by
| Jenny
(4 posts) Bio
|
| Date
| Reply #6 on Sat 29 Apr 2006 11:44 PM (UTC) |
| Message
| Yea..I figured it out right after I left that last post.
Once I loaded it in right, it worked. Thank you very much..
Now I can edit this one trigger to make everything else I need.
| | 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.
28,865 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top