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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Tue Sep 28, 2010 9:47 am   

[3.29b] Duration trigger types
 
Some funky things I have found. Import the xml code sections below into your untitled session to see what i'm testing with.

From the multistate triggers help file listed under the main Triggers help file.
Quote:
Duration

The "Duration" state will fire the trigger for each line that is received which matches the pattern within the given number of milliseconds. After the given number of milliseconds have expired, it will automatically increment to the next trigger state. Note that unlike the Wait type, a line of text must be received from the MUD in order to test the clock. The trigger will not increment to the next state unless a line is received from the MUD. For example:

#TRIGGER {Zugg} {#CW high,red}
#COND {Hello} {#CW high,blue} {Dur|Param=5000}

First the trigger waits to receive "Zugg" from the MUD. Then, for the next 5 seconds, any line that contains the word "Hello" is colored in bright blue. If the pattern is empty, than any line from the MUD received in the time interval will cause the trigger to fire.


From the Trigger Types help file under the Trigger help file
Quote:
*Duration

A parameter will be shown to set the number of milliseconds for this option. The trigger will fire if the Pattern field matches text from the MUD within the number of milliseconds of the previous trigger condition. If the time runs out without the trigger matching, the trigger moves on to the next state without running its code.



Code:
<trigger name="tr" priority="100" id="10">
  <pattern>test red</pattern>
  <value>#show {%ansi(bright,red)red%ansi(reset)}</value>
  <trigger type="Duration" param="2000">
    <pattern>test green</pattern>
    <value>#show {%ansi(bright,green)green%ansi(reset)}</value>
  </trigger>
  <trigger type="Duration" param="2000">
    <pattern>test blue</pattern>
    <value>#show {%ansi(bright,blue)blue%ansi(reset)}</value>
  </trigger>
</trigger>


Code:
<menu priority="40" id="4">
  <caption>color test with pause</caption>
  <value>#show {test red}
#wait 2100
#show {test green}
#wait 2100
#show {test blue}
#show {test blue}
#show {test blue}
#show {test blue}
#show {test blue}
#wait 2100</value>
</menu>


1. Right click the untitled session window and select the color test with pause
Result: red gets shown in red, green gets shown in green and blue gets shown in blue but only one time. The other four test blues should show blue in blue according to the help file. Now I go into the package editor and change the duration for the test blue pattern from 2000 to 2123 all five blue colored blues show for me. but just 1 for anything below that. This pc is a couple years old but it doesn't take 2 seconds for the 5 test blues to print to the screen....
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Tue Sep 28, 2010 11:31 am   
 
I should have had some coffee before making the original post.
Looks like my #waits were messing it up, sorry for the brain fart this early in the day.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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