Posted to tcl@Weirdnet by vigilant at Wed Aug 29 20:17:08 GMT 2007view pretty

proc bind_command { n u h c a } {
variable commandchar ^
set type  [lindex $a 0]
set flags [lindex $a 1]
set command2 [lindex $a 2]
set procname [lindex $a 3]
if {$type == ""} {putnotc $n "What type of bind? pubm, msg, notc, etc."
} elseif {$flags == ""} { putnotc $n "Please define the flags like -|- for all, or o|- for only global ops"
} elseif {$command2 == ""} { putnotc $n "What command or mask is it?" 
} elseif {$procname == ""} { putnotc $n "Please define a proc name"
} else {
bind $type $flags [string trim $commandchar]$command2 $procname
putnotc $n "Binded $type $flags [string trim $commandchar]$command2 $procname "
}
}

# unbinds a command

proc unbind_command { n u h c a  } {
variable commandchar ^
set type [lindex $a 0]
set flags [lindex $a 1]
set command2 [lindex $a 2]
set procname [lindex $a 3]
if {$type == ""} { putnotc $n "Please complete the whole unbind line"
} elseif { $flags == ""} {putnotc $n "Fill in the flags properly please"
} elseif { $command2 == ""} {putnotc $n "Fill in the command name please"
} elseif { $procname == ""} {putnotc $n "fill in the procname"
} else {
unbind $type $flags [string trim $commandchar]$command2 $procname
putnotc $n "Unbinded $type $flags [string trim $commandchar]$command2 $procname"
}}

Comments

Posted by ehehe at Wed Aug 29 20:21:27 GMT 2007 [text] [code]

lol