mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2015
Posts: 7
B
BullD0G Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2015
Posts: 7
I know moobot has this option but I want to implament it on my bot.

On know there would have to be a on join code and a write to text or ini to store the user name but past that i have no idea.

basicly what i want to do is have my bot say:

Welcome to chat $nick glad you could join!

but not everytime they join but only on the first time they ever chat in my twitch. Anyone help?

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Very basic if statement using some kind of storage, in this case a simple /write and $read using txt files..
/help if then else
/help /write
/help $read
Code:
on *:join:#: { 
if (!$read(joins.txt,nw,$nick)) {
msg # Welcome $nick
;This part is incomplete. Use the help files to complete it
}
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Feb 2015
Posts: 3
T
Self-satisified door
Offline
Self-satisified door
T
Joined: Feb 2015
Posts: 3
Like Nillen pointed out, you can add code to your on join section of the code. The way I would do this would be to have the bot write each new person's name to a txt file when they join. Have the bot check first to make sure the name isn't already on the list before adding. If the person's name isn't on the list, then give the welcome message AND add them to the list so that on their next join they won't be greeted again. Something like:

Code:
if (!$read(joins.txt,nw,$nick)) { 
 msg # Welcome to the chat, $nick $+ !
 write joins.txt $nick 
} 

Last edited by Taracita; 03/03/15 10:02 AM. Reason: To make my txt file name match Nillen's for clarity
Joined: Feb 2015
Posts: 7
B
BullD0G Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Feb 2015
Posts: 7
I left out the most important thing. For the bot only to give this msg when they type anything. So i want it to be triggered when they type a message for the first time. Thats where i am stumped. i know how to do it when they say a certain word but not any word

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
on *:text:*:#: {


Link Copied to Clipboard