Project

General

Profile

/rand problem with script

Added by Rick Wright almost 7 years ago

Hi all, not sure where to ask this, but hopefully it's here....

I found a script which I modified for what I needed, but am finding that when the script is started, it picks a "random" time within the parameters set, but then continues to use that same time all the time.

Can anyone tell me how to get it to release the random time and select a different time each time please?

alias rs {
.timerrs 0 $rand(10,1200) msg #cloudnine $!read(rs.txt)
}

Thanks for your time.
Rick


Replies (2)

RE: /rand problem with script - Added by Per Amundsen almost 7 years ago

Yes, the interval is specified when then timer is created, not when it's run, but you can modify the timer on execution, example:

alias rs {
  .timerrs 0 $rand(10,1200) runrs
}

alias runrs {
  msg #cloudnine $!read(rs.txt)

  ; this does not create a new timer, it just updates the current one with the new parameters
  .timerrs 0 $rand(10,1200) runrs
}

RE: /rand problem with script - Added by Rick Wright almost 7 years ago

Perfect, Many thanks :)

    (1-2/2)