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.

Prevent more than one bind to be triggered

Help for those learning Tcl or writing their own scripts.
Post Reply
C
CP1832
Halfop
Posts: 68
Joined: Thu Oct 09, 2014 4:03 pm

Prevent more than one bind to be triggered

Post by CP1832 »

Is there any way to process pub binds before pubm binds? Also, is there any way to prevent a pubm to be triggered after a pub trigger has been triggered? For instance, I have a URL title grabber tcl and a message tcl. If I leave a message which includes a URL, I don't want the title grabber to be triggered. For instance:
<dude> !msg walter http://www.somelink.com
<bot> URL title: http://www.somelink.com's title <- IT HAPPENS, BUT IT'S NOT WANTED
<bot> Message for walter accepted
Can this be done?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

According to TCL Commands.doc file that comes with the eggdrop, and I quote:
PUBM binds are processed before PUB binds.
This means that you can do what you wanted by changing the url title grabber script to "ignore" (return) when the line that normally would trigger it if the line starts with "!msg" for instance.

Something like:

Code: Select all

if {[string first "!msg" [string tolower $line]] != -1} return
If you need further assistance post. :)
Once the game is over, the king and the pawn go back in the same box.
C
CP1832
Halfop
Posts: 68
Joined: Thu Oct 09, 2014 4:03 pm

Post by CP1832 »

Thanks caesar, I kind of used your code for inspiration to avoid any of my pub binds.

Code: Select all

if {[string index $text 0] eq "!"} { return }
if {[string index $text 0] eq "."} { return }
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Great, glad you worked it out. :)
Once the game is over, the king and the pawn go back in the same box.
Post Reply