mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2015
Posts: 3
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jun 2015
Posts: 3
I'm a noob at this, I apologize in advance.
What I'd like to be able to do is have a command that, when entered, would display one of multiple possible lines of text. For instance, I'd have:

cat
doge
squirl

...and when I type !animal, it would pick one of the three animals I just stated.

I have no idea how to do this and I'm terrible at IRC and life in general. If anyone can help, that'd be much appreciated.

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
this should work

Code:
on *:text:!animal:#:{

var %n = $rand(1,3)

if (%n == 1) var %animal = cat
if (%n == 2) var %animal = doge
if (%n == 3) var %animal = squirl

msg # %animal


}

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Code:
on *:text:!animal:#:{
  var %n = $rand(1,3)

  if (%n == 1) var %animal = cat
  elseif (%n == 2) var %animal = doge
  elseif (%n == 3) var %animal = squirrel

  msg # %animal
}

Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Code:
on *:text:!animal:#:{
  goto $rand(1,3)
  :1 var %animal = cat | goto skip
  :2 var %animal = doge | goto skip
  :3 var %animal = squirrel | goto skip
  :skip
  msg # %animal
}


Dont give a fish - teach to fish!
Joined: Sep 2011
Posts: 32
F
Ameglian cow
Offline
Ameglian cow
F
Joined: Sep 2011
Posts: 32
My inclination would be to put the animals into a text file (e.g., animals.txt), one animal per line, and then use

Code:
on *:text:!animal:#:{
    msg # $read(animals.txt)
}

Joined: Jun 2015
Posts: 3
P
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jun 2015
Posts: 3
@Splinny This one seems to be giving me an "insufficient parameters" message. No idea why, but all I'm getting in MIRC is:

* /msg: insufficient parameters (line7, Quote.ini)

I'll try all the others' quickly, just thought I'd let you know that that was happening.

UPDATE: Loki12583's script did work for me, and it's fully functional now with a cooldown and everything. Thanks a million, all!

Last edited by pellfall; 26/06/15 06:30 PM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
Code:
on *:text:!animal:#:{
  goto $rand(1,3)
  :1 | var %animal = cat | goto skip
  :2 | var %animal = doge | goto skip
  :3 | var %animal = squirrel | goto skip
  :skip
  msg # %animal
}
fixed


Dont give a fish - teach to fish!

Link Copied to Clipboard