Code: Select all
set country(south africa) "Code: \002ZA\002 Country: \002South Africa\002"Is there anyway around this with keeping the space?
Thanks
Jason
Code: Select all
set country(south africa) "Code: \002ZA\002 Country: \002South Africa\002"Try escaping the space, like you have the control codes. EGJas0n wrote:Code: Select all
set country(south africa) "Code: \002ZA\002 Country: \002South Africa\002"
Code: Select all
set country(south\ africa) "Code: \002ZA\002 Country: \002South Africa\002"Code: Select all
set temp "south africa"
set country($temp) "Code: \002ZA\002 Country: \002South Africa\002"
Code: Select all
if {$misc1 == "country"} {
set chr [string tolower $misc2]
if {![info exists country($chr)]} {
putserv "NOTICE $nick :Error: \002Country does not exist\002"
return 0
}
putserv "PRIVMSG $chan :$country($chr)"
}Code: Select all
set country(south africa) "Code: \002ZA\002 Country: \002South Africa\002"Code: Select all
set country(za) "Country: \002South Africa\002 Code: \002ZA\002"Code: Select all
set country(south_africa) "Code: \002ZA\002 Country: \002South Africa\002"
Code: Select all
proc de_spacer {str} {
regsub -all -- $str { } {_} str
return $str
}
Code: Select all
if {$misc1 == "country"} {
set chr [string tolower $misc2]
set checkcountry [de_spacer $chr]
if {![info exists country($checkcountry)]} {
putserv "NOTICE $nick :Error: \002Country does not exist\002"
return 0
}
putserv "PRIVMSG $chan :$country($checkcountry)"
}Code: Select all
proc de_spacer {str} {
regsub -all -- $str { } {_} str
return $str
}
Code: Select all
proc de_spacer {str} {
regsub -all -- { } $str {_} str
return $str
}
Code: Select all
proc pub:Cmds {nick uhost handle chan text} {
set misc1 "[lindex $text 0]"
set misc2 "[lindex $text 1]"
if {$misc1 == "country"} {
set chr [string tolower $misc2]
regsub -all -- { } $chr {_} chr
if {![info exists $country($chr)]} {
putserv "NOTICE $nick :Error: \002Country does not exist\002"
return 0
}
putserv "PRIVMSG $chan :$country($chr)"
}
}Code: Select all
proc pub:Cmds {nick uhost handle chan text} {
set misc1 [lindex [split $text] 0]
set misc2 [lrange [split $text] 1 end]
if {$misc1 == "country"} {
set chr [string tolower $misc2]
regsub -all -- { } $chr {_} chr
if {![info exists $country($chr)]} {
putserv "NOTICE $nick :Error: \002Country does not exist\002"
return 0
}
putserv "PRIVMSG $chan :$country($chr)"
}
}