bind pub - !rules pub_rules
set public_rules "test public"
set private_rules "test private"
set pm_rules "test pm"
proc pub_rules { nick uhost hand chan arg } {
global public_rules pm_rules private_rules
if {[string tolower [lindex $arg 0]] != ""} {
#HERE IS MY PROBLEM !!!!!!
set set_rules $[string tolower [lindex $arg 0]]_rules
#END OF PROBLEM
puthelp "PRIVMSG $chan :[string toupper [lindex $arg 0]] Rules"
puthelp "PRIVMSG $chan :$set_rules"
}
I want to grabmy var with the arg, example if i type !rules public
$arg = public
i want to set:
set set_rules $$arg
Like this : set set_rules $public_rules
And i dont want set it with if $arg == public ... i want it like this b/c i have 250 rules to set and i want to clean my code ( already done with the IF )