bind pub -|- `random pub_random
proc pub_random {nick host hand channel text} {
global reply
putquick "PRIVMSG $channel \00306* $nick would like to send $text :[lindex $reply [rand [llength $reply]]]"
}
set reply [list "\"A Box of chocolates\"" "\"a single white rose\"" "\"A pile of dog poo\"" "\"Nothing, Dump them!\"" ]
The error it comes up with is:
[00:49] Tcl error [pub_random]: wrong # args: should be "rand"[/code]
Last edited by kris on Mon Nov 06, 2006 12:23 am, edited 1 time in total.
@rosc:
Actually, using [list ...] to generate lists is preferred to trying to craft your own list structures by hand...
Anyway, the error at hand here is that "rand" seems to have been replaced by a different function/proc that does'nt take a "limit"-value