Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
50
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. proc inputspam { nick host hand chan text } {
  5.     global spamonoff id
  6.     if { $text == "on" } {
  7.         set spamonoff 1
  8.         spam_timer
  9.     }
  10.     if { $text == "off" } {
  11.         set spamonoff 0
  12.         killutimer $id
  13.     }
  14. }
  15.  
  16. proc spam_timer {  } {
  17.     global spamonoff id
  18.     if { $spamonoff == 1 } {
  19.         spam
  20.         set id [ utimer 1 spam_timer ]
  21.     }
  22. }
  23.  
  24. proc spam {  } {
  25.     set spamtxt "scripts/spam.txt"
  26.     set spamfile [open $spamtxt r]
  27.     set spamread [split [read $spamfile] \n]
  28.     close $spamfile
  29.     putquick "PRIVMSG #YourMomsHouse :[lindex $spamread [rand [llength $spamread]]]"
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement