소스 검색

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"