| View previous topic :: View next topic |
| Author |
Message |
prassel Voice
Joined: 08 Apr 2007 Posts: 10
|
Posted: Mon Apr 09, 2007 1:01 pm Post subject: [solved] catch a word in a sentance and /me command |
|
|
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: | 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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Apr 09, 2007 5:43 pm Post subject: |
|
|
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
| Code: | | bind ctcp - ACTION yourporc |
Read about the ctcp bind in Tcl-commands.doc. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
prassel Voice
Joined: 08 Apr 2007 Posts: 10
|
Posted: Mon Apr 09, 2007 6:43 pm Post subject: |
|
|
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: | 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? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Apr 09, 2007 7:42 pm Post subject: |
|
|
| Quote: | | Code: | 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: | if {[string match -nocase "*dogs*" $text]} {
# dogs is in $text
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
prassel Voice
Joined: 08 Apr 2007 Posts: 10
|
Posted: Mon Apr 09, 2007 7:54 pm Post subject: |
|
|
sry but i dont understand at all
i've figured it out now, thx
| Code: | bind pubm - "*<word>*" <procname>
proc <procname> {nick host hand chan text} {
putserv "privmsg $chan :\001ACTION slaps $nick \001"
} |
|
|
| Back to top |
|
 |
|