mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2014
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Apr 2014
Posts: 9
Hello. I'm completely new to scripting (just started today), and I'm working on a Twitch.tv bot for a lazy friend of mine.

I need (or rather, would like) a script that'll generate a random message (out of a list of options) on command.

For example, "!heyexample", triggering: "hey friend", or "how are ya" or "whats going on?"

If anyone can help I'd greatly appreciate it. smile Thanks.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Make a textfile in your mircdir (default: C:\Users\Username\AppData\Roaming\mIRC) called Greets.txt

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


What $read does is read a random line out of the text file you present.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Apr 2014
Posts: 9
That works perfectly. smile Thanks a lot for the help <3

Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
another way to do it is make a random variable then have different responses for the number
Code:
var %hi = $rand(1,3)
if (%hi == 1) { msg # Hello $nick }
if (%hi == 2) { msg # what's up $nick }
if (%hi == 3) { msg # Welcome $nick }


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Originally Posted By: judge2020
another way to do it is make a random variable then have different responses for the number
Code:
var %hi = $rand(1,3)
if (%hi == 1) { msg # Hello $nick }
if (%hi == 2) { msg # what's up $nick }
if (%hi == 3) { msg # Welcome $nick }


Code:
var %hi = $rand(1,3)
if (%hi == 1) { msg # Hello $nick }
elseif (%hi == 2) { msg # what's up $nick }
elseif (%hi == 3) { msg # Welcome $nick }


Link Copied to Clipboard