Code: Select all
if {([string tolower [lindex $arg 0]] != "commands") || ([string tolower [lindex $arg 0]] != "website")} {
Code: Select all
if {![string equal -nocase "commands" [lindex $arg 0]] || ![string equal -nocase "website" [lindex $arg 0]]} {
Code: Select all
if {![string equal "commands" [string tolower [lindex $arg 0]]] || ![string equal -nocase "website" [string tolower [lindex $arg 0]]]} {
Code: Select all
proc command:set {nick uhost hand chan arg} {
if {[isop $nick $chan]} {
if {[string tolower [lindex $arg 1]] == ""} {
putnotc $nick "Error(1): Nothing to set variable to."
} else {
if {[string tolower [lindex $arg 0]] == "commands" || [string tolower [lindex $arg 0]] == "roster" || [string tolower [lindex $arg 0]] == "website" || [string tolower [lindex $arg 0]] == "sponsors" || [string tolower [lindex $arg 0]] == "record"} {
if {[string tolower [lindex $arg 0]] == "commands"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set commands to $commands"
} elseif {[string tolower [lindex $arg 0]] == "roster"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set roster to $roster"
} elseif {[string tolower [lindex $arg 0]] == "website"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set website to $website"
} elseif {[string tolower [lindex $arg 0]] == "sponsors"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set sponsors to $sponsors"
} elseif {[string tolower [lindex $arg 0]] == "record"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set record to $record"
}
}
} else {
putnotc $nick "Error(1): Unable to set [string tolower [lindex $arg 0]], try using: commands,roster,website,sponsors,record"
} else {
putnotc $nick "Error(1): You lack access to the 'set' command."
putnotc $nick "Error(2): Unable to 'set' [string tolower [lindex $arg 0]]."
}
}
}
Code: Select all
proc command:set {nick uhost hand chan arg} {
if {[isop $nick $chan]} {
if {[string tolower [lindex $arg 1]] == ""} {
putnotc $nick "Error(1): Nothing to set variable to."
return
}
if {[string tolower [lindex $arg 0]] == "commands"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set commands to $commands"
} elseif {[string tolower [lindex $arg 0]] == "roster"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set roster to $roster"
} elseif {[string tolower [lindex $arg 0]] == "website"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set website to $website"
} elseif {[string tolower [lindex $arg 0]] == "sponsors"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set sponsors to $sponsors"
} elseif {[string tolower [lindex $arg 0]] == "record"} {
set [string tolower [lindex $arg 0]] "[lrange $arg 1 end]"
putnotc $nick "Set record to $record"
} else {
putnotc $nick "Error(1): Unable to set [string tolower [lindex $arg 0]], try using: commands,roster,website,sponsors,record"
return
}
} else {
putnotc $nick "Error(1): You lack access to the 'set' command."
putnotc $nick "Error(2): Unable to 'set' [string tolower [lindex $arg 0]]."
return
}
}
you forgot to global the variable. usedaltonc wrote:proc command:commands {nick uhost hand chan arg} {
putserv "NOTICE $nick :$commands"
}
Code: Select all
proc command:commands {nick uhost hand chan arg} {
global commands
putserv "NOTICE $nick :$commands"
}
Code: Select all
set arg [split $arg]
set var [string tolower [lindex $arg 0]]
Code: Select all
set ::$var [join [lrange $arg 1 end]]