Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 0.66 KB | None | 0 0
  1. set randomtrigger "!rprp"
  2. bind pub -* $randomtrigger rquote
  3. proc rquote {nick uhost hand chan arg} {
  4.     set quotes ""
  5.     set data [open "./scripts/quote.txt" r]
  6.     while { ![eof $data] } {
  7.         set quote [gets $data]
  8.         if { $quote != "" } {
  9.             set quotes [linsert $quotes end $quote]
  10.         }
  11.     }
  12.     close $data
  13.     set random [rand [llength $quotes]]
  14.     if { [expr $random >= 0] && [expr $random < [llength $quotes]] } {
  15.         set quote [lindex $quotes $random]
  16.         set out1 [lrange [split $quote] 1 end]
  17.         set out [lindex $quote 0]
  18.     }
  19.     if { $quote != "" } {
  20.         putquick "privmsg $chan :$out1"
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement