Im using the QuoteEngine version $quote_version by JamesOff (http://www.jamesoff.net/go/quoteengine)"
and i was wondering if its possible to modify the quote_rand function to not just do a random quote but be able to specify a quote number..
Find of like a hybrid quote_rand and quote_fetch
so that yo could do a !quote and get a random quote or alt. do a !quote <no.> and get that quote number ?
proc quote_rand { nick host handle channel text } {
global db_handle quote_noflags
if {![channel get $channel quoteengine]} {
return 0
}
if [matchattr $handle $quote_noflags] { return 0 }
set where_clause "WHERE channel='$channel'"
if [regexp -- "--?all" $text] {
set where_clause ""
}
if [regexp -- "--?c(hannel)?( |=)(.+)" $text matches skip1 skip2 newchan] {
set where_clause "WHERE channel='[mysqlescape $newchan]'"
}
set sql "SELECT * FROM quote_text $where_clause ORDER BY RAND() LIMIT 1"
putloglev d * "QuoteEngine: executing $sql"
set result [mysqlquery $db_handle $sql]
if {[set row [mysqlnext $result]] != ""} {
set id [lindex $row 0]
set quote [lindex $row 3]
set by [lindex $row 1]
set when [clock format [lindex $row 5] -format "%Y/%m/%d %H:%M"]
puthelp "PRIVMSG $channel :\[\002$id\002\] $quote"
} else {
puthelp "PRIVMSG $channel :Couldn't find a quote

}
mysqlendquery $result
}