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.

convert unixtime into human readable time[SOLVED]

Help for those learning Tcl or writing their own scripts.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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.
z
ztian299
Halfop
Posts: 59
Joined: Sat Apr 19, 2008 4:57 pm
Location: *.no

Post by ztian299 »

Really, didn't know that space was that important! thanks again speechles
z
ztian299
Halfop
Posts: 59
Joined: Sat Apr 19, 2008 4:57 pm
Location: *.no

Post by ztian299 »

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 :-)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
z
ztian299
Halfop
Posts: 59
Joined: Sat Apr 19, 2008 4:57 pm
Location: *.no

Post by ztian299 »

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?
Post Reply