This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
speechles
Revered One
Posts: 1398 Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)
Post
by speechles » Sun Jun 01, 2008 6:05 pm
Code: Select all
if {[string match $chan "#blah"]}{set limit 5}
!=
Code: Select all
if {[string match $chan "#somechannel"]} {set limit 5}
Notice the spacing in mine.. this is there for a reason.
ztian299
Halfop
Posts: 59 Joined: Sat Apr 19, 2008 4:57 pm
Location: *.no
Post
by ztian299 » Sun Jun 01, 2008 6:12 pm
Really, didn't know that space was that important! thanks again speechles
ztian299
Halfop
Posts: 59 Joined: Sat Apr 19, 2008 4:57 pm
Location: *.no
Post
by ztian299 » Mon Jun 02, 2008 8:52 am
is it possible to have a select query like this:
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
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Mon Jun 02, 2008 8:57 am
Using the same "rules" as mentioned before, this should work as long as your query is proper.
Code: Select all
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
ztian299
Halfop
Posts: 59 Joined: Sat Apr 19, 2008 4:57 pm
Location: *.no
Post
by ztian299 » Mon Jun 02, 2008 4:33 pm
Again some problems..
I've tried 2-3 blowcrypt scripts from tcl-archive and google. And all return
Tcl error [encryptedincominghandler]: can't read "display": no such variable
the if-loop is like this:
Code: Select all
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?