(the max results is set to 10)<botname> sending latest results:
Now I want to let it announce how many records of that query it has found in the db, so i added to the script:
Code: Select all
set cnt [mysqlsel $db "select count(*) from $table WHERE nm = '$text';" -list]
<botname> found ## results: sending latest results:"
Now what I liked to add is it will announce the ## results, someting like:
<botname> found 1 result: sending latest 1 result:"
<botname> found 5 result: sending latest 5 results:"
<botname> found 23 result: sending latest 10 result:"
etc.
I was thinking to do it someting like this:
Code: Select all
if ........ {
putserv "PRIVMSG $chan :found $cnt result: sending latest 1 result:"
} elseif {
......... {
putserv "PRIVMSG $chan :found $cnt results: sending latest 2 results:"
} elseif {
......... {
putserv "PRIVMSG $chan :found $cnt results: sending latest 3 results:"
etc
} else {
......... {
putserv "PRIVMSG $chan :found $cnt results: sending latest 10 result:"
}
Anyone can help me?
Thanks