Im trying to create a trigger with a timer that in CMUD looks like this:
When cmud recieves a certain text from the mud it triggers the following lines:
#WAIT %random(150000,155000)
#PRINT Executing alias 1 in 5 seconds
#WAIT %random(5000,5100)
alias
For Mudlet, this is what i came up with so far but I cant get it to work correctly:
tempTimer( 150+155.random(), [[print("Executing alias 1 in 5 seconds")]] );
tempTimer( 5+5,1.random(), [[send("alias")]] );
And also, is there a way to display the timer so I can keep an eye on the countdown?
Regards
Jonas
Trigger with random timer
Re: Trigger with random timer
1) If you supply a number to the random() function, it'll return a number between 1 and that number.
2) use echo() instead of print()
3) if you want your text to parse aliases before sending, use expandAlias() instead of send().
So I would try:
tempTimer(random(155)+150,[[echo("Executing alias 1 in 5 seconds")]]);
tempTimer(random(1)+5,[[expandAlias("alias")]]);
Also, if you're using a lot of WAIT commands, I suggest using the quick queues function, which lets you stack commands and handles the execution of the timers for you.
2) use echo() instead of print()
3) if you want your text to parse aliases before sending, use expandAlias() instead of send().
So I would try:
tempTimer(random(155)+150,[[echo("Executing alias 1 in 5 seconds")]]);
tempTimer(random(1)+5,[[expandAlias("alias")]]);
Also, if you're using a lot of WAIT commands, I suggest using the quick queues function, which lets you stack commands and handles the execution of the timers for you.