Thread: [Request script] TCL Script Pt Testerii
View Single Post
Old 23-10-2005, 20:52   #7 (permalink)
Kurupt
Member
 
Kurupt's Avatar
 
Join Date: Jun 2004
Location: Hermannstadt
Age: 24
Posts: 108
Rep Power: 36
Kurupt will become famous soon enough
Send a message via Yahoo to Kurupt
Default

Alt cod care mult mai bun si mult mai optimizat
Code:
## $Id: intrebari.tcl, version 0.1 , ggdrop-1.6.x 2005 dpgc@purehype.net Exp $
## Author:   Kurupt                                    
## Info:     Will ask questions
## Thanks to:
#            smart@UnderNet#ro-tcl     
#
## Contact:  mail: dpgc@purehype.net    
#            irc : #ro-tcl (on undernet)
#            web : http://code.aitia.info
## History: Am folosit altceva in afara de switch . Ideea lui universalia


set teste(chan) "#bucuresti"
set teste(1) "Intrebarea1"
set teste(2) "Intrebarea2"
set teste(3) "Intrebarea3"
set teste(4) "Intrebarea4"
set teste(5) "Intrebarea5"


bind pub N|nm .intrebare teste:info:exist

# PROCES
proc teste:info:exist {nick uhost hand chan text} {
global teste
 if {[llength $text] <= 0 } {
     putserv "notice $nick :Comenzile: .intrebare <nr>"
     return 0
    } 
 if { [info exists teste($text)]} {
   puthelp "PRIVMSG $chan :$teste($text)" 
 } {
   puthelp "PRIVMSG $chan :$nick - question \002$text\002 doesn't exist"
   }
}

putlog "teste loaded"
__________________
Owner of #ro-tcl
Kurupt is offline   Reply With Quote