Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
itsmarty
Novice


Joined: 29 Jan 2002
Posts: 37
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net