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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Quintus
Newbie


Joined: 29 Aug 2013
Posts: 4

PostPosted: Thu Aug 29, 2013 4:44 pm   

Trigger/script that fires if text not seen in last X seconds
 
I'm trying to create something that will fire if a certain line hasn't been seen in the last X seconds. I've played with duration/wait triggers but it seems these work in the opposite order: trigger, THEN do something after X seconds.

Basically, I want to create something that will fire if I haven't been in combat for 10 seconds.

Any suggestions?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Aug 29, 2013 10:14 pm   
 
You will need two triggers. The first trigger will be a pattern-and-wait multistate trigger, with the pattern part being whatever line you use to determine you are out of combat now and the wait part being 10000 (the interval is in milliseconds). The second trigger will be whatever line you use to determine you are now in combat. Both triggers will need to be named.

In the first trigger, the code for the pattern part will set a variable called InCombat to 0 and will turn on the second trigger. The code for the wait will do whatever you wanted to do after 10 seconds has elapsed with no combat. In the second trigger, the code will first set that variable to 1, then change the state of the first trigger to 0, and finally turn itself off. This will prevent the wait state from ever firing, should the second trigger fire before 10 seconds have elapsed.
_________________
EDIT: I didn't like my old signature
Reply with quote
Quintus
Newbie


Joined: 29 Aug 2013
Posts: 4

PostPosted: Tue Sep 10, 2013 10:20 pm   
 
This worked perfectly! Thanks!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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