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 

Check Pretime

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
intel
Halfop


Joined: 26 Feb 2008
Posts: 57

PostPosted: Fri Dec 19, 2008 3:02 pm    Post subject: Check Pretime Reply with quote

I am trying to get my script to announce BACKFiLL if the pretime is older then 12hrs.

Any help is appreciated.


Last edited by intel on Wed Dec 24, 2008 10:02 am; edited 1 time in total
Back to top
View user's profile Send private message
x-treem
Voice


Joined: 21 Jul 2008
Posts: 9

PostPosted: Fri Dec 19, 2008 6:58 pm    Post subject: Reply with quote

you sure have something that will call a duration function, somewhere there you should have a difference betwen now and pretime that is the variable you look for (or create one if that is not set to a variable). If that is >12h (3600 * 12) or whatever you like, then BACKFILL
Back to top
View user's profile Send private message
intel
Halfop


Joined: 26 Feb 2008
Posts: 57

PostPosted: Fri Dec 19, 2008 11:56 pm    Post subject: Reply with quote

I have
set time1 [unixtime]
incr time1 -$timestamp
set ago [duration $time1]
set after [clock clicks -milliseconds]

so I am confused as to what I should be doing and why 3600 *12?
Back to top
View user's profile Send private message
ShavdApe
Halfop


Joined: 15 Dec 2003
Posts: 46

PostPosted: Mon Dec 22, 2008 1:11 pm    Post subject: Reply with quote

ideally you want time in seconds of your pretime

Now im not sure what your $timestamp looks like if its just unixtime but at the time of the pre then
set ago [expr $timestamp -[unixtime]] is all you need and youll be left with the amount of seconds between those two times.
if timestamp is more like a date format then use [clock scan $timestamp]

now youll need a limit set in seconds and then simply your if statement would look something like
set limit 3600
if {$ago > $limit} {
putqucik "PRIVMSG $chan :\[BACKFiLL] -- $rls was pred $ago ago
}
note 3600 = 1 hour in seconds hence the 12 * 3600 comment above i think

I think thats all correct anyway someone im sure will correct me if im wrong.

*edit*
ah looking at the above again it appears your $ago is more like 1 hour 30 secs ill assume your duration process does that if thats the case youll need to do that after the if cos the above code would work in seconds only. Hope this all helps not something I usually do this helping people business cos I suck at it lol
_________________
Driving lessons bolton
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
Page 1 of 1

 
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