mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 20
P
popsy Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2004
Posts: 20
Is it possible to make a snippet that works in the following way?

A bot member writes !slap nickname

The bot then reads a random slap from a textfile, and inserts the nick in the slap?


Joined: Apr 2003
Posts: 25
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Apr 2003
Posts: 25
on *:text:!slap*:#yourchan: {
var %randval = $rand(1,5)
if (%randval == 1) describe $chan slap 1
elseif (%randval == 2) describe $chan slap 2
elseif (%randval == 3) describe $chan slap 3
elseif (%randval == 4) describe $chan slap 4
elseif (%randval == 5) describe $chan slap 5
}

Replace #yourchan with your channel or just use #
No need to use text files on this one, local variables work just as good, to add more slaps increase $rand(1,5) by one ex. $rand(1,6) and add another elseif (%randval == 6) describe $chan slap here

[Edit: Add to use a nickname in the slap use $2 if you want !slap to slap the person after the !slap command or remove the * in !slap and use $nick

Last edited by SS217; 18/02/04 06:59 AM.
Joined: Jan 2004
Posts: 20
P
popsy Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2004
Posts: 20
Max nice, it works perfectly.

How do i ad more than 9 slaps, can i just write $rand(1,12 for example?)

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Yes you can. Try //echo -a $rand(1,12) $rand(100,200) $rand(a,z) ... you get the idea.


Link Copied to Clipboard