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.

a little help...to make my bot do an action

Old posts that have not been replied to for several years.
Locked
h
hwjchim
Voice
Posts: 14
Joined: Wed Mar 10, 2004 2:51 pm

a little help...to make my bot do an action

Post by hwjchim »

Hey guys/gals.
I have a problem/question.
I'm trying to make my bot do a certain action.
I would like it to do /me starts dancing in the room
I want it to do that action whenever it sees the word "dedicates"

I have been trying and this is what i got (not working)

set word "dedicates"

bind notc - "*dedicates*" dance:notc

proc dance:notc {nick host hand chan rest} {
#putlog "$nick $hand $chan $host $rest"

if { $hand == $word } {
putserv "USAGE /me starts dancing"
}
}

putlog "- scottie's dancing script... loaded."

Thanks.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

An Action on IRC is actually a CTCP, which in turn is just a PRIVMSG...

Code: Select all

putserv "PRIVMSG <target> :\001ACTION dances\001"
\001 is a character that signifies the start of a ctcp.
h
hwjchim
Voice
Posts: 14
Joined: Wed Mar 10, 2004 2:51 pm

Post by hwjchim »

set word "dedicates"

bind notc - "*dedicates*" dance:notc

proc dance:notc {nick uhost handle text dest} {
#putlog "$nick $hand $chan $host $rest"

if { $hand == $word } {
putserv "PRIVMSG <i.put.my.channel.in.here> :\001ACTION dances\001"
}
}

putlog "- scottie's dancing script... loaded."

still no luck....
Strikelight, you said to put <target>
target = the channel or the nick ?
And do I have this right? if { $hand == $word }
or should it be if { $handle equal $word } ?

Thanks
I changed it to this, still no luck
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

<target> is where you specify where you want the bot to do the action, be it a nickname, or a channel... However, don't include the <>'s...

And no, your if statement is not correct... you have not declared the variable "word" in the local scope of the procedure.. and there is no variable "hand" in your procedure either.

For a Tcl tutorial, concentrating on eggdrop scripting in particular, go to http://www.suninet.nl/tclguide
Locked