r00t-err0r

spychan

Feb 27th, 2014
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 2.71 KB | None | 0 0
  1. set spy(author)  "munZe - #Zemun on PIK"
  2. set spy(version) "1.337"
  3.  
  4. set spy(home) "#@Serbian"
  5. set spy(chan) "#serbian-chat"
  6.  
  7. bind PUBM   -|- *                spychan:chat
  8. bind CTCP   -|- "ACTION"         spychan:action
  9. bind SIGN   -|- "$spy(chan) *"   spychan:sign
  10. bind JOIN   -|- "$spy(chan) *"   spychan:join
  11. bind PART   -|- "$spy(chan) *"   spychan:part
  12. bind SPLT   -|- "$spy(chan) *"   spychan:split
  13. bind KICK   -|- "$spy(chan) *"   spychan:kick
  14. bind RAW     *  "MODE"           spychan:mode
  15.  
  16.  
  17. proc spychan:part { nickname hostname handle channel reason } {
  18.     global spy
  19.     if {[string equal -nocase $channel $spy(chan)]} {
  20.     putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname ($hostname) has left $spy(chan)"
  21.     }
  22.        }
  23.  
  24.  
  25. proc spychan:join { nickname hostname handle channel } {
  26.     global spy
  27.     if {[string equal -nocase $channel $spy(chan)]} {
  28.     putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname ($hostname) has joined $spy(chan)"
  29.     }
  30.        }
  31.  
  32. proc spychan:kick { nickname hostname handle channel target reason } {
  33.     global spy
  34.     if {[string equal -nocase $channel $spy(chan)]} {
  35.     putserv "PRIVMSG $spy(home) :\[$channel\] * $target was kicked from $spy(chan) by $nickname ($reason)"
  36.     }
  37.        }
  38.  
  39. proc spychan:mode { from key arguments } {
  40.     global spy
  41.     set channel [string trim [lindex [split $arguments] 0]]
  42.     set modechange [string trim [lindex [split $arguments] 1]]
  43.     set victims [string trim [join [lrange [split $arguments] 2 end]]]
  44.  
  45.     set nickname [string trim [lindex [split $from "!"] 0]]
  46.     set hostname [string trim [lindex [split $from "!"] 1]]
  47.     if {[string equal -nocase $channel $spy(chan)]} {
  48.     putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname sets mode: $modechange $victims"
  49.     }
  50.        }
  51.  
  52. proc spychan:sign { nickname hostname handle channel reason } {
  53.     global spy
  54.     if {[string equal -nocase $channel $spy(chan)]} {
  55.     putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname ($hostname) has quit IRC ($reason)"
  56.     }
  57.        }
  58.  
  59. proc spychan:split { nickname hostname handle channel arguments } {
  60.     global spy
  61.     if {[string equal -nocase $channel $spy(chan)]} {
  62.     putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname has split from the network"
  63.     }
  64.        }
  65.  
  66. proc spychan:chat { nickname hostname handle channel arguments } {
  67.     global spy
  68.     if {[string equal -nocase $channel $spy(chan)]} {
  69.         putserv "PRIVMSG $spy(home) :\[$channel\] <$nickname> $arguments"
  70.         }
  71.        }
  72.  
  73. proc spychan:action { nickname hostname handle channel keyword arguments } {
  74.     global spy
  75.     if {[string equal -nocase $channel $spy(chan)]} {
  76.         putserv "PRIVMSG $spy(home) :\[$channel\] * $nickname $arguments"
  77.         }
  78.        }
  79.  
  80.  
  81. putlog "Spychan.tcl version $spy(version) by $spy(author) Loaded!"
Advertisement
Add Comment
Please, Sign In to add comment