egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bind "-$comm" for command

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
FallFromGrace
Voice


Joined: 28 Jul 2008
Posts: 17

PostPosted: Mon Aug 18, 2008 7:42 am    Post subject: bind "-$comm" for command Reply with quote

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
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Aug 18, 2008 7:49 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Tue Aug 19, 2008 6:24 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber