This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
prassel
Voice
Posts: 10 Joined: Sun Apr 08, 2007 6:52 pm
Post
by prassel » Mon Apr 09, 2007 1:01 pm
i cant get the bot to catch a word with my script. someone know what im doing wrong?
function: catch the word 'dogs' and send "dogs?! WHERE?!" to the channel that 'fubu' was written in.
Code: Select all
bind pub - "% *dogs*" askDogs
proc askDogs {nick host hand chan text} {
putserv "privmsg $chan :dogs?! WHERE?!"
}
also could someone tell me what the /me command is in tcl?
cant find it anywhere, or im searching on the wrong words :/
thx
Last edited by
prassel on Tue Apr 10, 2007 12:29 pm, edited 1 time in total.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Mon Apr 09, 2007 5:43 pm
You need yo use the pubm bind and not pub bind. Read Tcl-commands.doc about both binds (pub does not accept wildcards in its mask).
As for actions, actions are CTCPs so you should use a bind like
Read about the ctcp bind in Tcl-commands.doc.
prassel
Voice
Posts: 10 Joined: Sun Apr 08, 2007 6:52 pm
Post
by prassel » Mon Apr 09, 2007 6:43 pm
i didnt get any wiser by reading tcl-commands.doc about ctcp :/
but i did get the other thing to find the words and reply, thx.
but what should the ACTION be? the text i write in the channel or something else? im lost
hmm i think im getting close now, found this after googling
http://www.baschny.de/eggdrop/faq/faq-f.html
Code: Select all
bind ctcp - "ACTION" action_proc
proc action_bind { nick uhost hand dest keyword text } {
if {[string index $dest 0] != "#"} { return 0 }
}
$dest should be $chan, that i know.
what is the reply text and what is the trigger text?
and what is the "#" for?
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Mon Apr 09, 2007 7:42 pm
Code: Select all
bind ctcp - "ACTION" action_proc
proc action_bind { nick uhost hand dest keyword text } {
if {[string index $dest 0] != "#"} { return 0 }
}
The condition checks if the first character of $dest is '#' (meaning if it is a channel name). $text is the text you want to match from, so you can use something like
Code: Select all
if {[string match -nocase "*dogs*" $text]} {
# dogs is in $text
}
prassel
Voice
Posts: 10 Joined: Sun Apr 08, 2007 6:52 pm
Post
by prassel » Mon Apr 09, 2007 7:54 pm
sry but i dont understand at all
i've figured it out now, thx
Code: Select all
bind pubm - "*<word>*" <procname>
proc <procname> {nick host hand chan text} {
putserv "privmsg $chan :\001ACTION slaps $nick \001"
}