mIRC Home    About    Download    Register    News    Help

Print Thread
Random response. Timed. #252175 26/03/15 02:08 PM
Joined: Nov 2014
Posts: 21
N
Nathanael Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Nov 2014
Posts: 21
How do I fix this?


on *:join:#:{
set timer[Cat] 0 10
set -u1 %rand $r(1,7)
if (%rand == 1) { msg $chan Meow }
if (%rand == 2) { msg $chan Purr! }
if (%rand == 3) { msg $chan *Licks myself clean* }
if (%rand == 4) { msg $chan *Scratches my paws on the scratching post* }
if (%rand == 5) { msg $chan *Yawns* }
if (%rand == 6) { msg $chan *Curls up into a ball and falls asleep* }
if (%rand == 7) { msg $chan *Rolls over onto my belly* }
}

Re: Random response. Timed. [Re: Nathanael] #252176 26/03/15 02:21 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Put it on the Recycle Bin.

Code:
on !*:join:#: {
  var %rand = $rand(1,7)
  if (%rand == 1) { msg $chan Meow }
  if (%rand == 2) { msg $chan Purr! }
  if (%rand == 3) { msg $chan *Licks myself clean* }
  if (%rand == 4) { msg $chan *Scratches my paws on the scratching post* }
  if (%rand == 5) { msg $chan *Yawns* }
  if (%rand == 6) { msg $chan *Curls up into a ball and falls asleep* }
  if (%rand == 7) { msg $chan *Rolls over onto my belly* }
}

Last edited by westor; 26/03/15 02:26 PM.
Re: Random response. Timed. [Re: westor] #252192 27/03/15 12:45 AM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
It looks like he wants an infinite timer to evaluate after 10 seconds with a random message. (He probably doesn't want it to go for infinity, but that's what he put in the original code)
Code:
on !*:join:#: {
  timerCat 0 10 catmessage $chan
}

alias catmessage { 
  var %rand = $rand(1,7)
  if (%rand == 1) { msg $1 Meow }
  elseif (%rand == 2) { msg $1 Purr! }
  elseif (%rand == 3) { msg $1 *Licks myself clean* }
  elseif (%rand == 4) { msg $1 *Scratches my paws on the scratching post* }
  elseif (%rand == 5) { msg $1 *Yawns* }
  elseif (%rand == 6) { msg $1 *Curls up into a ball and falls asleep* }
  elseif (%rand == 7) { msg $1 *Rolls over onto my belly* }
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Random response. Timed. [Re: Nillen] #252232 28/03/15 08:52 PM
Joined: Nov 2014
Posts: 21
N
Nathanael Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Nov 2014
Posts: 21
That is not working

Re: Random response. Timed. [Re: Nathanael] #252233 29/03/15 04:26 AM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Then look at something other that is causing errors, maybe bracket mismatches in your other codes? The one I gave you will work as intended assuming everything else is.

Last edited by Khaled; 29/03/15 01:42 PM.

Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net