| View previous topic :: View next topic |
| Author |
Message |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Jun 01, 2008 6:05 pm Post subject: |
|
|
| Code: | | if {[string match $chan "#blah"]}{set limit 5} |
!=
| Code: | | if {[string match $chan "#somechannel"]} {set limit 5} |
Notice the spacing in mine.. this is there for a reason. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
ztian299 Halfop
Joined: 19 Apr 2008 Posts: 59 Location: *.no
|
Posted: Sun Jun 01, 2008 6:12 pm Post subject: |
|
|
| Really, didn't know that space was that important! thanks again speechles |
|
| Back to top |
|
 |
ztian299 Halfop
Joined: 19 Apr 2008 Posts: 59 Location: *.no
|
Posted: Mon Jun 02, 2008 8:52 am Post subject: |
|
|
is it possible to have a select query like this:
| Quote: |
set count [mysql $dbconnect "SELECT COUNT(*) FROM table WHERE user LIKE 'blah%' ORDER BY time DESC LIMIT 5" -flatlist]
if {$count == 0} {set user "No user found"}
putserv "PRIVMSG $chan :User:$count"
|
How would this if-loop look like? i know that one wont work, thats why im asking here  |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Jun 02, 2008 8:57 am Post subject: |
|
|
Using the same "rules" as mentioned before, this should work as long as your query is proper.
| Code: |
set count [mysqlsel $dbconnect "SELECT COUNT(*) FROM table WHERE user LIKE 'blah%' ORDER BY time DESC LIMIT 5" -flatlist]
if {[lindex $count 0] == 0} {set user "No user found"}
putserv "PRIVMSG $chan :User:$count"
|
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
ztian299 Halfop
Joined: 19 Apr 2008 Posts: 59 Location: *.no
|
Posted: Mon Jun 02, 2008 4:33 pm Post subject: |
|
|
Again some problems..
I've tried 2-3 blowcrypt scripts from tcl-archive and google. And all return
| Quote: |
Tcl error [encryptedincominghandler]: can't read "display": no such variable
|
the if-loop is like this:
| Code: |
if {[lindex $count 0] == 0} {set display "0"}
|
Why? tried to change the stuff inside "" but doesnt help much
Got told that it's not blowcrypt script. It's the if-loop. How? |
|
| Back to top |
|
 |
|