mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2014
Posts: 3
I
Self-satisified door
OP Offline
Self-satisified door
I
Joined: Mar 2014
Posts: 3
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!

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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.




Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 3
I
Self-satisified door
OP Offline
Self-satisified door
I
Joined: Mar 2014
Posts: 3
Hey thanks a lot man, I really appreciate it!

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Mar 2014
Posts: 3
I
Self-satisified door
OP Offline
Self-satisified door
I
Joined: Mar 2014
Posts: 3
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.

Last edited by infesting; 26/03/14 05:49 PM.

Link Copied to Clipboard