mIRC Home    About    Download    Register    News    Help

Print Thread
#212588 28/05/09 01:49 AM
Joined: Apr 2009
Posts: 8
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2009
Posts: 8
Hi I was wondering if it is possible to have the mirc chat bot programed to respond to certain words typed in the chat room and how I do that. For example I have an onjoin welcome that the bot gives which is :

Welcome ¤Talathia¤. Nice to see you again I hope you are well this fine night. The Inn is open and the streets are quiet & safe, enjoy your evening.

usually the people say thankyou or ty, I would like the bot to say "your welcome" or something like that and have no idea how to do it.

Darnthryl #212593 28/05/09 02:32 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Example:
Code:
on *:text:*:#:{
  if ((*thank*you* iswm $strip($1-)) || (*ty* iswm $v2)) && ($me isin $v2) {
    .msg $chan Your welcome, $nick $+ .
  }
}


Darnthryl #212599 28/05/09 03:10 AM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
This code will respond to thankyou, thank you, ty and thanks:
Code:
on $*:TEXT:/^(thank? ?you|ty|thanks)$/iS:#:.msg # your welcome, $nick $+ .
Note this will only react to the words themselves, NOT in a sentence anywhere.

Tomao #212601 28/05/09 03:45 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Hm, both scripts will thank for some message containing "typewriter" or "panty" wink . My two cents:
Code:
on *:text:*:#yourchan: {
  if ($1-2 == thank you) || ($1 == ty) { msg $chan You're welcome, $nick $+ . }
}
Without $me-check you'll inevitably have "false positives"; but with a $me-check you'll likely miss many occasions to respond smile

Tomao #212602 28/05/09 03:46 AM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
--double post-- :X

Last edited by Horstl; 28/05/09 03:59 AM.
Horstl #212603 28/05/09 03:48 AM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I've addressed that matter just now, Horstl. I made it to match exactly the words themselves. And you noticed you double-posted your reply.

Tomao #212609 28/05/09 08:24 AM
Joined: Apr 2009
Posts: 8
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2009
Posts: 8
thanks so much guys, much appreciated.. but I must be doing something wrong, I tried all three and none of them worked.. I copied and pasted into the remote section on a new line under the welcome onjoin command, saved it and then tried it and nothing happened.

I also had a question regarding adding the bots name, do I just add the name like this:

on *:text:*:#:{
if ((*thank*you*guard* iswm $strip($1-)) || (*ty*guard* iswm $v2)) && ($me isin $v2) {
.msg $chan Your welcome, $nick $+ .
}
}
OR this one:

on $*:TEXT:/^(thank? ?you guard|ty guard|thanks guard)$/iS:#:.msg # your welcome, $nick $+ .

OR this one:

on *:text:*:#yourchan: {
if ($1-2 == thank you guard) || ($1 == ty guard) { msg $chan You're welcome, $nick $+ . }
}

However, if i cant get these to work as is i guess that should be my first problem to solve ..

Darnthryl #212611 28/05/09 09:42 AM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Don't put three of these scripts in the same remote, because they'll likely cause conflict and render neither of them workable. You only choose one to use. I recommend these two:
Code:
on $*:TEXT:/^(thank? ?you guard|ty guard|thanks guard)$/iS:#:.msg # your welcome, $nick $+ .
If you pick Horstl's, you should construct it this way:
Quote:
on *:text:*:#: {
if ($1-3 == thank you guard) || ($1-2 == ty guard) { msg $chan You're welcome, $nick $+ . }
}

Tomao #212613 28/05/09 10:06 AM
Joined: Apr 2009
Posts: 8
D
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Apr 2009
Posts: 8
No no, I didnt put all three in, I put them in one at a time and tried each one individually, i only used all three in the example above because they were different and I wanted to make sure that which ever one i went with eventually when i could make it work, i would be able to add the name the right way.


Link Copied to Clipboard