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.

how to use shortnick instead of trigger

Help for those learning Tcl or writing their own scripts.
Post Reply
s
skywalker
Voice
Posts: 5
Joined: Sat Jan 07, 2012 7:46 pm

how to use shortnick instead of trigger

Post by skywalker »

how can i make it to be able to use a short nick instead of the trigger?
Lets say the bot is named botname and the trigger is !
then i would like to be able to use "bot command" also instead of only !command this for room with multiple bots on it.
If this is not possible then the shortnick instead of the trigger will be ok also
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

You can do something like this:

Code: Select all

bind pubm - "*" botproc
proc botproc {nick uhost hand chan text} {
    global botnick

    if {[lindex [split $text] 0] == $botnick} {
        # Your code here...
    }

}
Or add botnick to bind itself:

Code: Select all

bind pubm - "% $::botnick*" botproc
And read this: http://tclhelp.net/unb/114
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Post Reply