| View previous topic :: View next topic |
| Author |
Message |
FallFromGrace Voice
Joined: 28 Jul 2008 Posts: 17
|
Posted: Mon Aug 18, 2008 7:42 am Post subject: bind "-$comm" for command |
|
|
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.. |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Aug 18, 2008 7:49 pm Post subject: |
|
|
Quick, basic example:
| Code: | 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 |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Tue Aug 19, 2008 6:24 am Post subject: |
|
|
Why not | Code: | bind pubm - "% -*" whatever
proc whatever {n u h c text} {
set text [string range $text 1 end]
# ...
} | ? _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
|