Very...easy this is almost near to basics.
Use, this it should work.
Code: Select all
bind pubm - "*" private:talk
set nick1 "awyeah"
set channel1 "#elite"
set msg1 "I am a bot!"
proc private:talk {nick uhost hand chan text} {
global botnick nick1 channel1 msg1
if {([string equal -nocase $chan $channel1]) && ([string equal -nocase $nick $nick1]) && (![string equal -nocase $botnick $nick])} {
set text [lindex $text 0]; putserv "PRIVMSG $text :$msg1"
return 0
}
}
Whenever nick "X" types anything on the defined channel:
<X> hello!
The bot will privmsg 'hello!"
In this case the message will not be sent, as 'hello!' is not a valid nick.
Just make sure, hello! is a valid nick, as the '!' character is not valid for nicks.
So X should have to say:
<X> hello
Then the bot will privmsg 'hello' with your defined msg.
Also in case if X says more than 1 word in the text:
<X> hello there!
In this case, the privmsg will still be sent to the first word said.
So the privmsg will be sent to the nick 'hello' (the first word of the text).