Ver Fonte

Define the pickRandom function if it doesn't exist already

James Seward há 14 anos atrás
pai
commit
78446e8eb3
1 ficheiros alterados com 6 adições e 0 exclusões
  1. 6 0
      QuoteEngine/QuoteEngine.tcl

+ 6 - 0
QuoteEngine/QuoteEngine.tcl

@@ -599,6 +599,12 @@ proc quote_auto { nick host handle channel text } {
 
 }
 
+# Define the pickRandom method which is used if bMotion isn't loaded
+if {[llength [info procs pickRandom]] == 0} {
+	proc pickRandom { list } {
+		return [lindex $list [rand [llength $list]]]
+	}
+}
 
 quote_connect
 putlog "QuoteEngine $quote_version loaded"