botlending forum  

Go Back   botlending forum > Eggdrop & TCL > Tcl scripting

Tcl scripting Tcl scripting related questions

Reply
 
LinkBack Thread Tools Display Modes
Old 17-07-2007, 00:56   #11 (permalink)
Junior Member
 
ReaL|DoG's Avatar
 
Join Date: Jul 2005
Location: Italy
Age: 21
Posts: 63
Rep Power: 0
ReaL|DoG is an unknown quantity at this point
Send a message via Yahoo to ReaL|DoG
Default

Code:
proc s:silence {nick host hand chan args} {
eu totusi cred ca lipeste
Code:
global settings
avand in vedere ca set settings(silence) 0 este in afara procesului
ReaL|DoG is offline   Reply With Quote
Old 17-07-2007, 17:27   #12 (permalink)
Member
 
Join Date: Jun 2004
Location: Canada
Age: 18
Posts: 141
Rep Power: 0
AdrianK is on a distinguished road
Default

Quote:
Originally Posted by Novice View Post
am gasit
[14:05] Tcl error [s:silence]: can't read "settings(silence)": no such variable
Sa fii sigur ca ai
Code:
set settings(silence) 0
AdrianK is offline   Reply With Quote
Old 17-07-2007, 23:17   #13 (permalink)
Junior Member
 
ReaL|DoG's Avatar
 
Join Date: Jul 2005
Location: Italy
Age: 21
Posts: 63
Rep Power: 0
ReaL|DoG is an unknown quantity at this point
Send a message via Yahoo to ReaL|DoG
Default

ok, cum zici tu

#### EDIT ####

oricum, sincer sa fiu, da niste errori, daca fac cum zic eu .. si sunt sigur 100% ca trebuie sa declari global settings, ca sa iti mearga $settings(silence), dar oricum primesc erroarea asta
Code:
[ 22:06:00 ]   [ mybotnick ] [20:06] Tcl error [s:silence]: invalid command name "0"
[ 22:06:02 ]   [ mybotnick ] [20:06] Tcl error [s:silence]: invalid command name "0"
iar daca nu declar global settings, sau mut variabila in proces primesc urmatoarea erroare
Code:
[ 22:08:30 ]   [ mybotnick ] [20:08] Tcl error [s:silence]: can't read "settings(silence)": no such variable
Sincer, nush cum merge la tine.. dar eu am testat si pe eggdrop si pe windrop, si primesc aceleasi errori

Last edited by ReaL|DoG; 18-07-2007 at 00:10. Reason: am completat cu niste argumente :)
ReaL|DoG is offline   Reply With Quote
Old 21-07-2007, 14:39   #14 (permalink)
TCB & Ratings projects Member, #Mythic representative
 
arcade's Avatar
 
Join Date: Jun 2004
Location: In fatza calculatorului!!
Age: 19
Posts: 221
Rep Power: 37
arcade is on a distinguished road
Send a message via Yahoo to arcade
Default

nu va mai certati atata, lasati off topicul si daca tot postati, postati scripte corecte.
Code:
bind pub N !silence pub:silence

proc pub:silence {nick host hand chan txt} {
global silenced

set opt1 [lindex $txt 0]
set opt2 [lindex $txt 1]

switch -exact $opt1 {
                      -on {if {[info exists silenced]} { puthelp "PRIVMSG $chan :Silence is already on."; return }
                              putserv "SILENCE +*"
                              set silenced 1
                              puthelp "PRIVMSG $chan :Silence is now on"
                             }
                      -off {if {![info exists silenced]} { puthelp "PRIVMSG $chan :Silence is already off."; return }
                              putserv "SILENCE -*"
                              unset silenced
                              puthelp "PRIVMSG $chan :Silence is now off"
                             }
                      -host {if {![string match "+*!*@*" $opt2] || ![string match "-*!*@*" $opt2]} { puthelp "PRIVMSG $chan :Invalid host: $opt2"; return }
                                     putserv "SILENCE $opt2
                                     puthelp "PRIVMSG $chan :Added silence for host: $opt2"
                                    }
                       default { puthelp "PRIVMSG $chan :USAGE: !silence <-on|-off|-host> [+/-host]" }
}
ar trebui sa functioneze perfect, also am adaugat si posibilitatea de a adauga/scoate silence numai la anumite hosturi cu comanda !silence -host +/-host. Exemplu: !silence -host +*!*@arcadel.users.undernet.org
__________________
Fuck oFF!
arcade is offline   Reply With Quote
Old 23-07-2007, 11:22   #15 (permalink)
spy
Junior Member
 
spy's Avatar
 
Join Date: Mar 2006
Location: Somewhere
Posts: 14
Rep Power: 0
spy is an unknown quantity at this point
Default

-on -off -host , nu merg..imi da asa la debug..
Quote:
[10:21] <TCL> bad option "-on": must be -exact, -glob, -regexp, or --
[10:21] <TCL> while executing
[10:21] <TCL> "switch -exact $opt1 {
[10:21] <TCL> -on {if {[info exists silenced]} { puthelp "PRIVMSG $chan :Silence este deja activat "; return ..."
[10:21] <TCL> (procedure "pub:silence" line 7)
[10:21] <TCL> invoked from within
[10:21] <TCL> "pub:silence $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
spy is offline   Reply With Quote
Old 23-07-2007, 18:54   #16 (permalink)
Member
 
Join Date: Jun 2004
Location: Canada
Age: 18
Posts: 141
Rep Power: 0
AdrianK is on a distinguished road
Default

arcade nu prea stie ce face. Incearca in loc de

Code:
switch -exact $opt1 {
sa pui
Code:
switch  --  $opt1 {
btw harry potter 7 rules
AdrianK is offline   Reply With Quote
Old 24-07-2007, 08:37   #17 (permalink)
spy
Junior Member
 
spy's Avatar
 
Join Date: Mar 2006
Location: Somewhere
Posts: 14
Rep Power: 0
spy is an unknown quantity at this point
Default

da merge perfect ms mult de tot AdrianK deci varianta finala ar fi:
Quote:
bind pub N !silence pub:silence

proc pub:silence {nick host hand chan txt} {
global silenced

set opt1 [lindex $txt 0]
set opt2 [lindex $txt 1]

switch -- $opt1 {
-on {if {[info exists silenced]} { puthelp "PRIVMSG $chan :Silence is already on."; return }
putserv "SILENCE +*"
set silenced 1
puthelp "PRIVMSG $chan :Silence is now on"
}
-off {if {![info exists silenced]} { puthelp "PRIVMSG $chan :Silence is already off."; return }
putserv "SILENCE -*"
unset silenced
puthelp "PRIVMSG $chan :Silence is now off"
}
-host {if {![string match "+*!*@*" $opt2] || ![string match "-*!*@*" $opt2]} { puthelp "PRIVMSG $chan :Invalid host: $opt2"; return }
putserv "SILENCE $opt2
puthelp "PRIVMSG $chan :Added silence for host: $opt2"}
}
default { puthelp "PRIVMSG $chan :USAGE: !silence <-on|-off|-host> [+/-host]" }
}
harry potter 7 rules .. da stai ca inca nu la`m vazut =)) , btw cer inchiderea acestui thread
spy is offline   Reply With Quote
Reply

Bookmarks

« Stiri | dr.tcl »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT +3. The time now is 10:49.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.