Преглед на файлове

Define the pickRandom function if it doesn't exist already

James Seward преди 14 години
родител
ревизия
78446e8eb3
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  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"