| View previous topic :: View next topic |
| Author |
Message |
Melkimo Voice
Joined: 19 Jan 2011 Posts: 2
|
Posted: Wed Jan 19, 2011 12:25 pm Post subject: how to make a bot respond to !<something> |
|
|
@Melkimo> !beer nadine
* +SecsyDiva gives a beer to nadine
atm it says: * +SecsyDiva gives a beer to Melkimo
I am looking for how to make the bot respond to !(something) <nick refered too) message
But at this point I got to where it responds to the nick saying the !something (and ignores the $nick it should respond too)
| Code: | proc pub_water {nick uhost hand channel arg} {
global botnick
putserv "PRIVMSG $channel :\001ACTION gives $nick a bottle of water\001"
return 0
}
bind pub - !water pub_water |
What should I change or add to make this work
It should be easy, but uhmm yea, I am looking over it. |
|
| Back to top |
|
 |
doggo Halfop
Joined: 05 Jan 2010 Posts: 97
|
Posted: Wed Jan 19, 2011 2:11 pm Post subject: |
|
|
| Code: |
bind pub - !water pub_water
proc pub_water {nick uhost hand channel arg} {
set who [lindex $arg 0]
if {$who == ""} {set who $nick}
putserv "PRIVMSG $channel :\001ACTION gives $who a bottle of water\001"
}
[05:58pm] <doggo> !water
[05:58pm] * [spunky] gives doggo a bottle of water
[05:58pm] <doggo> !water [spunky]
[05:58pm] * [spunky] gives [spunky] a bottle of water
[06:00pm] <doggo> !water nadine
[06:00pm] * [spunky] gives nadine a bottle of water
|
| Code: | set who [lindex $arg 0]
sets the VAR who to the nick you want to give water to
|
| Code: | if {$who == ""} {set who $nick}
if who is empty then your nick or whoever triggered the cmd will be used |
hope this helped _________________ NON geeky!! http://gotcode4u.com/ |
|
| Back to top |
|
 |
Melkimo Voice
Joined: 19 Jan 2011 Posts: 2
|
Posted: Wed Jan 19, 2011 8:03 pm Post subject: |
|
|
Yea that works ! Thanks
Is it possible to make the same !command in private with the bot but sending the output to a specified channel?
Like
/msg <bot> !beer Nadine #channel
And it responds in
#channel <botnick> /me gives Nadine a beer |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Thu Jan 20, 2011 6:24 pm Post subject: |
|
|
| Code: | | proc pub_water {nick uhost hand channel arg} { | should be | Code: | | proc pub_water {nick uhost hand channel text} { | arg is special. and remenber to use | Code: | | [lindex [split $text] 0] |  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Jan 20, 2011 6:42 pm Post subject: |
|
|
Actually, arg is fine. It's the word "A R G S" or args, which has special meaning. Just to clarify that part.  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
|
| Back to top |
|
 |
Amr Halfop

Joined: 14 Sep 2007 Posts: 94 Location: Egypt
|
Posted: Sat Mar 26, 2011 1:35 pm Post subject: |
|
|
What about adding more , for example !shoot it will be "bot shoots $who"
!kill ..etc. |
|
| Back to top |
|
 |
|