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 

help with my tea script [SOLVED]

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


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sat Jul 07, 2007 3:50 pm    Post subject: help with my tea script [SOLVED] Reply with quote

Code:
#################
proc pub_!tea {nick uhost hand chan rest} {
  global botnick
  set cmd [string tolower [lindex $rest 0]]
  if {$cmd == "help"} {
    putnot $nick "!tea will give you a hot tea."
    putnot $nick "!tea <nick> will give <nick> a hot tea." ; return 0}
  if {$cmd == ""} {
    putchan $chan "\001ACTION sets a fresh cup of hot tea in front of $nick\001" ;return 0}
  putchan $chan "\001ACTION sets a fresh cup of hot tea in front of $cmd\001"
}
bind pub - !tea pub_!tea
#################


when using "!tea help" it don't work unless 'help' is typed in lowercase letters.. im sure it is "[string tolower [lindex $rest 0]]" causing it but I can't figure out anything else to use to allow caps and lowercase...

Can someone please point me in right direction or show me another example script? Thanks


Last edited by cache on Sat Jul 07, 2007 6:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
w00f
Halfop


Joined: 04 Oct 2006
Posts: 49

PostPosted: Sat Jul 07, 2007 5:08 pm    Post subject: Reply with quote

use -nocase option with string match
i.e.
Code:

set cmd [lindex $rest 0]
if {[string match -nocase $cmd "help"]} { .... }


~w00f
Back to top
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sat Jul 07, 2007 6:23 pm    Post subject: Reply with quote

Thanks w00f got it working Smile
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