ソースを参照

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"