mIRC Homepage
Posted By: TUSK3N Need help with timers and $(rand) - 05/12/16 09:18 AM
So I want to start a timer that is infinite but it will only make the $rand random the first time I activate it.

/timertest 0 $rand(120,360) msg $chan bla bla bla

So this will choose a random number once and then repeat it everytime but I want it to be a random timer each time it has said bla bla bla.

How its working right now.

timer activated on 125 sec
Me: bla bla bla
timer activated on 125 sec
Me: bla bla bla

How it should work.

timer activated on 145
Me: bla bla bla
timer activated on 356
Me: bla bla bla

so its random everytime I hope you understand.
Posted By: Fonic_Artes Re: Need help with timers and $(rand) - 05/12/16 01:37 PM
Seems like you could do something like.

Code:
if ($timer_test.type == online) {
.timer_test off
.timer_test 0 $rand(120,360) STUFF
}

else {
.timer_test 0 $rand(120,360) STUFF
}
Posted By: Loki12583 Re: Need help with timers and $(rand) - 08/12/16 01:52 AM
/timertest 0 $!rand(120,360) msg $chan bla bla bla
Posted By: Wims Re: Need help with timers and $(rand) - 08/12/16 06:12 PM
That does not work, only the command parameter of /timer is evaluated twice, the delay and repetition are not part of the command, you can use the same idea with just one more timer though
Posted By: hixxy Re: Need help with timers and $(rand) - 08/12/16 07:44 PM
Code:
alias test { 
  .timertest 1 $rand(120,360) test 
  msg $chan bla bla bla
}


If you don't want the msg to trigger the first time you run /test then you can do:

Code:
alias test {
  .timertest 1 $rand(120,360) test -m
  if ($1 == -m) { msg $chan bla bla bla }
}


/test
© mIRC Discussion Forums