nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu May 24, 2007 4:26 pm Post subject: |
|
|
Take a little look at these pieces from your code...
| Code: | | set search [string map {" " "%"} [lindex $arg]] |
| Code: | foreach result $query {
set nick [lindex $nick]
set Channel [lindex $Channel 2]
putquick "PRIVMSG $channel :SOURCE: $search from $nick - $Channel"
} |
First error, lindex expects two arguments:
1. a list.
2. a number indicating which list item to fetch.
On several locations you've only supplied the first...
Secondly, there is no variable named Channel within your script, so trying to read $Channel would also generate an error.
Third, you never make any use of the variable result within your foreach-loop, making it more or less pointless. I assume you intended to extract the nick and channel fields from the sql-query result? If so, you really should be using something like this:
| Code: | foreach result $query {
set n [lindex $result 0]
set c [lindex $result 1]
.... |
And fourth, it would seem arg is not a tcl-list, and is thus not suitable to be used with lindex. You might considder splitting it into a list first. _________________ NML_375, idling at #eggdrop@IrcNET |
|