Posted to tcl by dopsy at Sat Aug 28 09:24:08 GMT 2010view raw

  1. bind pubm -|- "% $botnick ping *" bind:ping
  2. bind pubm -|- "% $botnick dns *" bind:dns
  3. bind pubm -|- "% $botnick search *" bind:search
  4. bind nick -|- * new:bind
  5.  
  6. proc new:bind {nick uhost hand chan newnick} {
  7. if { [isbotnick $nick]} {
  8. catch {
  9. unbind pubm -|- "% $nick ping *" bind:ping
  10. unbind pubm -|- "% $nick dns *" bind:dns
  11. unbind pubm -|- "% $nick search *" bind:search
  12. }
  13. bind pubm -|- "% $newnick ping *" bind:ping
  14. bind pubm -|- "% $newnick dns *" bind:dns
  15. bind pubm -|- "% $newnick search *" bind:search
  16. }
  17. }
  18.  
  19. proc bind:ping {nickname hostname handle channel text} {
  20. set text [lrange $text 2 end]
  21. pPingPubCommand $nickname $hostname $handle $channel $text
  22. }
  23. proc bind:dns {nickname hostname handle channel text} {
  24. set text [lrange $text 2 end]
  25. pub_dns_lookup_req $nickname $hostname $handle $channel $text
  26. }
  27. proc bind:search {nickname hostname handle channel text} {
  28. set text [lrange $text 2 end]
  29. ip:search $nickname $hostname $handle $channel $text
  30. }
  31.