Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.67 KB | None | 0 0
  1. bind pub - !spam inputspam
  2. set id 0
  3. set spamonoff 0
  4.  
  5. proc inputspam { nick host hand chan text } {
  6.     global spamonoff id
  7.     if { $text == "on" } {
  8.         set spamonoff 1
  9.         spam_timer
  10.     }
  11.     if { $text == "off" } {
  12.         set spamonoff 0
  13.         killutimer $id
  14.     }
  15. }
  16.  
  17. proc spam_timer {  } {
  18.     global spamonoff id
  19.     if { $spamonoff == 1 } {
  20.         spam
  21.         set id [ utimer 1 spam_timer ]
  22.     }
  23. }
  24.  
  25. proc spam {  } {
  26.     set spamtxt "scripts/spam.txt"
  27.     set spamfile [open $spamtxt r]
  28.     set spamread [split [read $spamfile] \n]
  29.     close $spamfile
  30.     putquick "PRIVMSG #YourMomsHouse :[lindex $spamread [rand [llength $spamread]]]"
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement