itsmarty Novice
Joined: 29 Jan 2002 Posts: 37 Location: USA
|
Posted: Sat Nov 30, 2002 12:05 am
Simutronics Dragonrealms - Wait for Roundtime |
This was released as "Round Proof" and it very nearly is. None of this was written by me, but it was released publicly. Unfortunately I don't recall the author.
Basically, it creates an alias to use with triggers that says "wait for roundtime to be over before sending this command". It also creates a queue so multiple commands will execute in order after each round time is completed.
It uses the prompt to tell if you're in round time or not, so you need 'set statusprompt' on. Also, it's a good idea to set logon, logoff, disconnect, and death so lots of prompts can be generated and checked for roundtime.
Syntax for commands you want to go in the queue is "on_prompt <command>", so a trigger would look like so:
#TRIGGER {You feel fully prepared to cast your} {on_prompt cast}
An example with prompts (previous 'cast' trigger enabled):
>prep pfe 3
You begin chanting a prayer to invoke the Protection from Evil spell.
>perc
You find it difficult to concentrate on the Holy mana around you as you
struggle with your wavering faith.
You reach out with your senses and see vague streams of Holy energy coursing
through the area.
You don't sense any spells in effect on you.
Roundtime: 12 seconds
R>
You feel fully attuned to the mana streams again.
R>
You feel fully prepared to cast your spell.
R>
* Khadin was just struck down!
>cast
You gesture.
You are bathed in a soft white glow for a moment.
The 'fully prepared' message came while I was still in roundtime, so the 'cast' command went into the queue and wasn't executed until I got a prompt with no 'R' (prompt caused by the 'struck down' message).
Martin
#CLASS {Roundproof}
#ALIAS on_prompt {#VARIABLE commands {%additem( %-1, @commands)}}
#VAR commands {}
#TRIGGER {^~>} {#EXECUTE %item( @commands, 1);#VARIABLE commands {%delitem( %item( @commands, 1), @commands)}} "" {nocr|prompt}
#TRIGGER {^(%w)~>} {#IF %pos( "R", %1) {#ABORT} {#EXECUTE %item( @commands, 1);#VARIABLE commands {%delitem( %item( @commands, 1), @commands)}}} "" {nocr|prompt}
#CLASS 0 |
|