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.
FallFromGrace
Voice
Posts: 17 Joined: Mon Jul 28, 2008 8:52 am
Post
by FallFromGrace » Mon Aug 18, 2008 7:42 am
I want to bind "-" symbol, to use it like:
-123
-test
where "-" is a command, and 123/test is $text
I have already did "+" with: bind pubm - "*+*" command (but "+*" doesnt works =\)
how can i bind "-" symbol? bind pubm - "*-*" command or b]bind pubm - "*\-*" command[/b] doest works properly, it just binds ALL actions in chat to command..
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Mon Aug 18, 2008 7:49 pm
Quick, basic example:
Code: Select all
bind pubm - {*} myproc
proc myproc {nick host hand chan text} {
if {[string index [lindex [split $text] 0] 0] != "-"} { return }
set text [join [string trimleft $text -]]
# do stuff here...
}
r0t3n @ #r0t3n @ Quakenet
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Tue Aug 19, 2008 6:24 am
Why not
Code: Select all
bind pubm - "% -*" whatever
proc whatever {n u h c text} {
set text [string range $text 1 end]
# ...
}
?
Have you ever read "The Manual"?