mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
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.

Joined: Jun 2015
Posts: 84
F
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
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
}

Joined: Jan 2004
Posts: 1,352
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,352
/timertest 0 $!rand(120,360) msg $chan bla bla bla

Joined: Jul 2006
Posts: 3,962
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,962
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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


Link Copied to Clipboard