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 

Unix time

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


Joined: 07 Jun 2007
Posts: 20

PostPosted: Mon Dec 10, 2007 8:40 am    Post subject: Unix time Reply with quote

Mon Dec 10 14:24:31 2007 = 1197289471 in unix time . How i must calculate to find a random date? (ex. 30/08/2008 )
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Mon Dec 10, 2007 9:00 am    Post subject: Reply with quote

with the [clock scan] cmd?

http://www.tcl.tk/man/tcl8.4/TclCmd/clock.htm

You weren't very clear in your request..
Back to top
View user's profile Send private message
Getodacul
Voice


Joined: 07 Jun 2007
Posts: 20

PostPosted: Mon Dec 10, 2007 9:55 am    Post subject: Reply with quote

This date Mon Dec 10 14:24:31 2007 it's converted to 1197289471 by my eggdrop. And it's not a random number. I think that's unix time.
I will put the script here:
Quote:

####################################################
# What is the minimum access someone needs check ontime?
set ontime(acc) "-|-"
####################################################

bind pub $ontime(acc) "!ontime" ontime:nick

proc ontime:nick { nickname hostname handle channel arguments } {
global ontime
set nickname [lindex [split $arguments] 0]
if {$nickname == ""} {
putquick "PRIVMSG $channel :I need a nick to check it."
return 0
}
if {[string length $nickname] >= "16"} {
putquick "PRIVMSG $channel :Nickname too long."; return
}
putquick "whois $nickname $nickname"
set ::ontimechannel $channel
set ::ontimenickname $nickname
bind RAW - 401 ontime:nosuch
bind RAW - 317 ontime:idle
}

proc ontime:putmsg { channel arguments } {
putquick "PRIVMSG $channel :$arguments"
}

proc ontime:nosuch { from keyword arguments } {
set channel $::ontimechannel
set nickname $::ontimenickname
ontime:putmsg $channel "No such nickname \"$nickname\""
unbind RAW - 401 ontime:nosuch
}

proc ontime:idle { from keyword arguments } {
set channel $::ontimechannel
set nickname $::ontimenickname
set idletime [lindex [split $arguments] 2]
set signon [lindex [split $arguments] 3]
ontime:putmsg $channel "$nickname has been idle for [duration $idletime], signed on [ctime $signon]"
if {$signon >= "1196691738"} {
putserv "PRIVMSG $channel :$nickname have NOT big uptime and deserve flowers."
} else {
putserv "MODE $channel +v $nickname"
putserv "PRIVMSG $channel :$nickname have big uptime and deserve voice. $signon"
}
unbind RAW - 317 ontime:idle
}

putlog "Public ontime script Loaded"

This code it's inspired by a part of whois.tcl by MeTroiD
I need to control somehow $signon variable.
1196691738 from the script = Mon Dec 3 16:22:18 2007
Back to top
View user's profile Send private message
Getodacul
Voice


Joined: 07 Jun 2007
Posts: 20

PostPosted: Sat Dec 22, 2007 3:04 pm    Post subject: Reply with quote

If i will know how to control that variable i will try to make a top N uptime script (based on signon time).
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