egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

convert unixtime into human readable time[SOLVED]
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Jun 01, 2008 6:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
ztian299
Halfop


Joined: 19 Apr 2008
Posts: 59
Location: *.no

PostPosted: Sun Jun 01, 2008 6:12 pm    Post subject: Reply with quote

Really, didn't know that space was that important! thanks again speechles
Back to top
View user's profile Send private message
ztian299
Halfop


Joined: 19 Apr 2008
Posts: 59
Location: *.no

PostPosted: Mon Jun 02, 2008 8:52 am    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Jun 02, 2008 8:57 am    Post subject: Reply with quote

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
View user's profile Send private message
ztian299
Halfop


Joined: 19 Apr 2008
Posts: 59
Location: *.no

PostPosted: Mon Jun 02, 2008 4:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber