This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Using $'s inside { }

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
TC^^
Voice
Posts: 22
Joined: Tue Jul 05, 2005 11:50 am

Using $'s inside { }

Post by TC^^ »

Code: Select all

channel add #onechannel { need-unban { banmail $chan } }
This adds following info for #onechannel

Code: Select all

If I'm banned (need-unban) :
   banmail $chan

Why doesn't it add "#onechannel" instead of $chan ??
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Because $chan doesn't exist. Use #onechannel instead, there's no need for a variable here anyway.
User avatar
TC^^
Voice
Posts: 22
Joined: Tue Jul 05, 2005 11:50 am

Post by TC^^ »

Actually there is..

Code: Select all

bind msg o|o add msg:add

proc msg:add { nick uhost hand args } {
    set chan [lindex $args 0]
    
    if {$chan == "#" || $chan == ""} {putquick "PRIVMSG $nick :Fejl! Skriv kanalnavn rigtigt" ; return 0}
    if {![string match "#*" $chan]} {set chan "#$chan"}
    if {[validchan $chan]} {putquick "PRIVMSG $nick :Jeg er allerede p\345 $chan" ; return 0}
    channel add $chan { need-unban { banmail $chan } }
    putquick "PRIVMSG $nick :\002$chan\002 added!"
    putquick "PRIVMSG #... :$nick added \002$chan\002 to my channel list"
}

[Edit] Sorry for not posting the entire code, can see how that could be confusing [/Edit]
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

try

Code: Select all

channel add $chan [list need-unban "banmail $chan"]
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
TC^^
Voice
Posts: 22
Joined: Tue Jul 05, 2005 11:50 am

Post by TC^^ »

That did the trick.. thanks alot
Post Reply