mIRC Homepage
ok, so im really new to this, i got the basics down, but i dont know how to get the bot to just pick a random line on a command.

for example i have:
on *:JOIN:#: { msg $chan Welcome $nick }


now i want for example 3 different welcome lines, for example:
welcome to the channel, $nick
Hello there, $nick
good evening $nick

is there any possibilty to do this?
ive looked for like 5 hours all around the internet, but apparently i dont have the right search terms or im just stupid.

thx for the help, cheers!
Posted By: Shakar Re: how do i get my bot to select random line - 04/05/14 03:32 PM
You could do something like this
Code:
on *:join:#: {
var %greet = $rand(1,3)
if (%greet == 1) { msg $chan welcome to the channel, $nick }
elseif (%greet == 2) { msg $chan Hello there, $nick }
elseif (%greet == 3) { msg $chan good evening $nick }
}
thx so much shakar, it works perfectly, i even tried it with the TEXT command, also works perfectly!

you are a godsent laugh
Posted By: Nillen Re: how do i get my bot to select random line - 04/05/14 03:48 PM
Originally Posted By: EyeofSauron
is there any possibilty to do this?
ive looked for like 5 hours all around the internet, but apparently i dont have the right search terms or im just stupid.
http://lmgtfy.com/?q=mirc+random+line
As it suggest, the easiest way to do this with 1 line is to use $read(textfile.txt) this returns the value of a random line from textfile.txt which is located in your mircdir.
© mIRC Discussion Forums