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

  1. proc bind_command { n u h c a } {
  2. variable commandchar ^
  3. set type [lindex $a 0]
  4. set flags [lindex $a 1]
  5. set command2 [lindex $a 2]
  6. set procname [lindex $a 3]
  7. if {$type == ""} {putnotc $n "What type of bind? pubm, msg, notc, etc."
  8. } elseif {$flags == ""} { putnotc $n "Please define the flags like -|- for all, or o|- for only global ops"
  9. } elseif {$command2 == ""} { putnotc $n "What command or mask is it?"
  10. } elseif {$procname == ""} { putnotc $n "Please define a proc name"
  11. } else {
  12. bind $type $flags [string trim $commandchar]$command2 $procname
  13. putnotc $n "Binded $type $flags [string trim $commandchar]$command2 $procname "
  14. }
  15. }
  16.  
  17. # unbinds a command
  18.  
  19. proc unbind_command { n u h c a } {
  20. variable commandchar ^
  21. set type [lindex $a 0]
  22. set flags [lindex $a 1]
  23. set command2 [lindex $a 2]
  24. set procname [lindex $a 3]
  25. if {$type == ""} { putnotc $n "Please complete the whole unbind line"
  26. } elseif { $flags == ""} {putnotc $n "Fill in the flags properly please"
  27. } elseif { $command2 == ""} {putnotc $n "Fill in the command name please"
  28. } elseif { $procname == ""} {putnotc $n "fill in the procname"
  29. } else {
  30. unbind $type $flags [string trim $commandchar]$command2 $procname
  31. putnotc $n "Unbinded $type $flags [string trim $commandchar]$command2 $procname"
  32. }}

Comments

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

lol