| View previous topic :: View next topic |
| Author |
Message |
gasak Halfop
Joined: 09 Aug 2010 Posts: 45
|
Posted: Tue Aug 10, 2010 12:51 am Post subject: Bot action response |
|
|
| Code: | set crazybib {
"$nick are the real crazy"
}
bind pubm - *v1rus?crazy* pub_crazy
proc pub_crazy {nick uhost handle chan args} {
global crazybib oldreplytime botnick
set replytime [unixtime]
if { $replytime - $oldreplytime > 7} {
set crazyline [lindex $crazybib [rand [llength $crazybib]]]
puthelp "PRIVMSG $chan :$crazyline"
set oldreplytime $replytime
}
}
set oldreplytime 0 |
Can someone help me on change that script above to ACTION? means of somone on channels using action (/me) with mention the bot name with specific word the bot will answer also with the specific word to encounter the person.
Thanks a lot before for the help. _________________ Learning Knows No Boundaries!! |
|
| Back to top |
|
 |
Ashoq Voice

Joined: 17 Jul 2010 Posts: 11
|
Posted: Tue Aug 10, 2010 3:34 pm Post subject: |
|
|
im a newbie in TCL but ...
for ACTION (/me)
change this:
| Code: | | puthelp "PRIVMSG $chan :$crazyline" |
to this:
| Code: | | puthelp "PRIVMSG $chan :ACTION: $crazyline" |
if isnt work try this script (from fishbot.tcl):
| Code: | bind pubm -|- "% crazy*" crazybot_crazy
bind pubm -|- "% hello*" crazybot_hello
#crazy
proc crazybot_crazy { nick host hand chan text } {
putmsg $chan "action: $nick are the real crazy"
}
#hello
proc crazybot_hello{ nick host hand chan text } {
putmsg $chan "action: says hello to $nick "
} |
|
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Tue Aug 10, 2010 4:46 pm Post subject: |
|
|
Does that script work? It doesn't look like it would. There is no check to see if $oldreplytime exists. Also, you have a var set after the last close brace, which isn't doing anything at all.
I will answer the questions first. There are two ways to send an action to the channel. You can use | Code: | | putserv "PRIVMSG $chan :\001ACTION does something.\001" | or, if you have have alltools.tcl loaded: | Code: | | putact $chan "does a /me action" | is a shortcut for that essentially. Second, if you want this wo work on actions, you must also change the bind and procs:
| Code: | bind ctcp * ACTION pub_crazy
proc pub_crazy {nick host hand chan kw arg} {
if {[string match -nocase "*v1rus?crazy*" $arg]} { ... }
|
So you'll need to make a few changes there in order to make that work. I would suggest fixing the proc itself first though.
See here as well: http://www.eggheads.org/support/egghtml/1.6.15/tcl-commands.html That whole page is very useful.
Last edited by Luminous on Tue Aug 10, 2010 5:14 pm; edited 1 time in total |
|
| Back to top |
|
 |
gasak Halfop
Joined: 09 Aug 2010 Posts: 45
|
Posted: Wed Aug 11, 2010 1:02 am Post subject: |
|
|
Thanks for the response. But what i mean is not the bot that reply with action. But the bot will reply to to channel when some one on channel do an action (/me) that mention the bot name.
For example the bot name is "v1rus". Than i make an action on channel such "/me v1rus is crazy" then the bot will react for the action because the bot name mention on the action.
please advice.
many thanks _________________ Learning Knows No Boundaries!! |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Wed Aug 11, 2010 5:25 pm Post subject: |
|
|
Yes, that is what the last part is for. You have to use a different bind/method to capture /me action text. The first two bits of code I showed was to make the bot send a /me. |
|
| Back to top |
|
 |
|