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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Mon Jul 14, 2003 9:33 pm   

Capturing a line before the current one
 
When I am sneaking it works like this....

sneak e
>
Roundtime: 10 sec.

You sneak east...


I type sneak e, then it says roundtime, then that I sneak.
I have a trigger that triggers on You sneak *...
But I want it to capture the Roundtime number above it

So in this case it would trigger on You sneak *... and will save 10 to WaitTime



This is possible isn't it?
Reply with quote
Humpton
Apprentice


Joined: 10 Oct 2000
Posts: 158
Location: Chicago, IL

PostPosted: Mon Jul 14, 2003 10:04 pm   
 
Maybe there's a cleverer way, but what I would do is capture the 'Roundtime number' everytime it goes past and then use it from a trigger on 'You sneak...' and then you could start your countdown timer (that's what you do, right?).
Reply with quote
redmop
Newbie


Joined: 14 Jul 2003
Posts: 9

PostPosted: Mon Jul 14, 2003 10:46 pm   
 
I can think of two ways to do it.

First, trigger on every time roundtime shows up and every time you sneak...
Code:

#TRIGGER {Roundtime:  (%d) sec.} {waittimetemp = %1}
#TRIGGER {You sneak *...} {waittime = @waittimetemp}


Second, use the new advanced triggers to trigger on every roundtime, then activate waittime if 'you sneak' shows up in the next 5 lines or so.

Code:

#TRIGGER {Roundtime:  (%d) sec.} {}
#COND {You sneak *...} {waittime = %t1} {Within|Param=5}


And if you want to get real fancy, make the triggers turn themselves off, and the sneak command turn them on if you want to minimize the number of running triggers.

Let me know how it works.

Red Mop
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Jul 14, 2003 11:17 pm   
 
Playing on a mud with roundtime like that I would suggest you always capture it. As you get further development in your script I am sure you will find other occasion when you need to know what it is/was. The method I would suggest for capturing it would be:
#TR {^Roundtime: (%d) sec.$} {#ALARM "RTalarm" {+%1} {#NOOP}}

Then when ever your scripts need to know the current round time they can use the %alarm function.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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