mIRC Homepage
Hey guys, I am very new to mIRC scripting. I am sorry if I ask a stupid question. I am creating a bot for a twitch stream. I currently have a simple on Join and on Part chat message working. The code is:

on *:JOIN:#stream-name: { msg $chan Welcome $nick to the stream! }

Everything is working great, but here is my question. I want to enter an emote into the welcome message, but I don't want the same emote to pop up constantly. Is it possible to have the message with one emote randomly generated from a list of potential emotes, and if so how can I go about accomplishing this? Any help is greatly appreciated!
Code:
 
on *:JOIN:#stream-name: {
var %rng $rand(1,10)
if (%rng == 1) { msg # Welcome $nick to the stream! }
if (%rng == 2) { msg # Welcome to the stream, $nick $+ . }
if (%rng == 3) { msg # Welcome $nick to the stream! :D }
}


And so on.


Hey thanks a lot man, I really appreciate it!
Any time mate.

Another way to do this exactly as you put it. Have a list of possible emotes to have in there.

Code:
 
on *:JOIN:#stream-name: { msg # Welcome $nick to the stream! $read(emotes.txt) }


For this, you'd have to create a text file named emotes.txt in the mIRC folder located here: C:\Users\Username\AppData\Roaming\mIRC
Originally Posted By: Nillen
Code:
 
on *:JOIN:#stream-name: {
var %rng $rand(1,10)
if (%rng == 1) { msg # Welcome $nick to the stream! }
if (%rng == 2) { msg # Welcome to the stream, $nick $+ . }
if (%rng == 3) { msg # Welcome $nick to the stream! :D }
}


And so on.




I used this code and I am getting an error message "IF unknown command" and "%RNG unknown command" What am I doing wrong?

EDIT: after doing some extensive research, I have changed the code slightly and fixed my own problem. Thanks again for your help.
© mIRC Discussion Forums