chachin

Untitled

Mar 11th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.32 KB | None | 0 0
  1. set fh [open "/home/chachin/eggdrop/boobs.txt" r]
  2. set ::_boobs_data [split [read -nonewline $fh] \n]
  3. close $fh
  4.  
  5. bind pub - !boobs boobs
  6. bind pub - !10boobs 10boobs
  7. bind pub - !add addboobs
  8. proc getboobs { n } {
  9.         set len [llength $::_boobs_data]
  10.         set boobs {}
  11.         for {set x 0} {$x<$n} {incr x} {
  12.             set i [expr int($len*rand())]
  13.             set line [lindex $::_boobs_data $i]
  14.             lappend boobs $line
  15.         }
  16.         return $boobs
  17. }
  18.  
  19. proc addboobs {nick uhost hand chan text} {
  20.         if {![string equal -nocase $chan "#chick3n"]} { return }
  21.         set url [lindex $text 0]
  22.         set fp [open "boobs.txt" a]
  23.         puts $fp $url
  24.         close $fp
  25.         lappend ::_boobs_data $url
  26.             puthelp "privmsg $chan new link added successfully :D"
  27.         }
  28. }
  29.  
  30. proc boobs {nick uhost hand chan text} {
  31.         if {![string equal -nocase $chan "#chick3n"]} { return }
  32.         set boobs [getboobs 1]
  33.         foreach line $boobs {
  34.             puthelp "privmsg $chan :$line \002nsfw\002"
  35.         }
  36. }
  37.  
  38. proc 10boobs {nick uhost hand chan text} {
  39.         if {![string equal -nocase $chan "#chick3n"]} { return }
  40.         set boobs [getboobs 10]
  41.         foreach line $boobs {
  42.             puthelp "privmsg $chan :$line \002nsfw\002"
  43.         }
  44. }
  45.  
  46. putlog "loading v0.1 boobs.tcl"
Advertisement
Add Comment
Please, Sign In to add comment