Code: Select all
.tcl set <variable <value>
!set command off
Code: Select all
bind pub - !set set:command
proc set:command {nick uhost hand chan text} {
global mycommand
if {[string equal -nocase "mycommand" [lindex $text 0]]} {
set mycommand "[lindex $text 1]"
}
}
Code: Select all
bind pub n !set command:set
proc command:set { n u h c t } {
set var [lindex [split $t] 0]
set mode [lindex [split $t] 1]
set $var $mode
}
Code: Select all
proc bot:command {nick uhost hand chan text} {
global mycommand
global myothercommand
if {[string equal -nocase "mycommand" [lindex $text 0]]} {
set mycommand "[lindex $text 1]"
} elseif {[string equal -nocase "myothercommand" [lindex $text 0]]} {
set myothercommand "[lindex $text 1]"
}
}
Code: Select all
proc bot:command {nick uhost hand chan text} {
global mycommand myothercommand
if {[string equal -nocase "mycommand" [lindex [split $text] 0]]} {
set mycommand "[lindex [split $text] 1]"
} elseif {[string equal -nocase "myothercommand" [lindex [split $text] 0]]} {
set myothercommand "[lindex [split $text] 1]"
}
}
Oh crap, thats right, lol. Should be:caesar wrote:awyeah : .set <variable> <value>
Code: Select all
set [lindex $text 0] "[lindex $text 1]"
Code: Select all
proc set_pub proc {nick host hand chan arg} {
set arg [string map {\\ \\\\ \" \\\" \[ \\\[ \] \\\] \{ \\\{ \} \\\} \( \\\( \) \\\)} $arg]
set [lindex $arg 0] [join [lrange $arg 1 end]]
putserv "PRIVMSG $chan :SET --> [lindex $arg 0] --> [join [lrange $arg 1 end]]
}
bind pub n !set set_pub