is there some kind of countdown timer for newyear ???
 

is there some kind of countdown timer for newyear ???

Started by Masterload, 16 November, 2003, 00:05:10

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Masterload

magmarnet

visit me at home....

 

klownietklowniet

How would that work? What would the script do?
[ > DC - UniteD < ]

Typhoon

i think it should only do the counting til the exact date 01-01-04 at time 00:00  ... then type happy new year or somthing...
could be cool  

***Typhoon?



kepp

I think that's imposible
Guarding    

plop

QuoteOriginally posted by kepp
I think that's imposible
no it is posible, just not fully sure yet how 2 make it.
let me think a little about it, got the basic idea in my head.
or maby some1 else whats have a go @ it.
sure is a cool idea.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Masterload

i was thinking somthing like this
countdown from now to 24:00 1-1-2004

(no scripter :P just an idea)

say : a second timer counting back bla bla hours  days left until.....
Happy new .......
can it be done ?
magmarnet

visit me at home....

 

kepp

if it is possible, you will get the script very soon... :)
Plop, can't you store that date n time in a table...
and then let the script get your date and time frpm your computer?
Guarding    

Masterload

thxx to you all for your time !
magmarnet

visit me at home....

 

Typhoon

hi Plop  

just woundering if you have figured something out ..



plop

QuoteOriginally posted by Typhoon?
hi Plop  

just woundering if you have figured something out ..
damn i kinda forgot this 1.
good that you help me remember.
still have 24 day's before i'm really 2 late.  lol
while writing this post i fixed the 1st tiny bit.
my hub now shows the amount of day's left before new year on entry.
more 2morrow.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

kepp

I can't wait to see how you will solve ths.. :)
Guarding    

Masterload

had some minor probs here back now....

23 day's left m8,
but the countdown works ?
magmarnet

visit me at home....

 

plop

[12:59] Time left till new year: 23 Day's, 11 Hours, 0 Minutes, 15 Seconds

still some work 2 do on starting/adjusting the timer for the last day.
it now only shows on entry.

btw some ascii would be nice 2 be shown on new year.
would be great if some1 could make that.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Optimus

Yhea guy's give Plop some help, who can make him some (verry Nice) ASCII picture...  ;)

[ES]latinmusic

QuoteOriginally posted by Optimus
Yhea guy's give Plop some help, who can make him some (verry Nice) ASCII picture...  ;)
I, if i have some time

SaintSinner

QuoteOriginally posted by Optimus
Yhea guy's give Plop some help, who can make him some (verry Nice) ASCII picture...  ;)


Found this one on the intanet

_
 _   _                     _    _             _  _             | |
/|   |\                    |\   |\            /  |\            |_|
 |___|  _   _    _         | \  |  _         /   |  _   _  ,_   _
 |   | / | | \  | \  / |   |  \ | /_\ / / |  \___|//_\ / | | ` / \
\|   |/\_|/|_/_/|_/_/\_|  \|   \| \__/\_\_|     /| \__/\_|/|   \_/
     '     |    |     /|        `              ( |
           |    |     \|                        \|
                                                 . `:
                                                : : .
                                                 : .
                                                [""]
                                                |  |
                                                |  |
                                                |  |
                                       :       .'--`.
                   _..-~-.._         : .:     /`.__.'\
                 .'         `.      :    .   /        \
               .'  .-'''''-.  `.   ,-'``'-. ;          ;
              /  ,'   XII   `.  \  |`-..-'| |   ,--.   |
             /  /     /|\     \  \ | .   :| |_.','`.`._|
             | ;       |       ; | | . :  | |--'2004`--|
             | |IX     o    III| | |`-..-'| ||   | | | |
             | ;               ; | \::::::/ ||)|/|)|)|\|
             |  \             /  |  `::::'  |._ ~**~ _.|
       ------|   `.   V I   ,'   |----)(----|  `-..-'  |-------
        _____j     `-.....-'     |    )(    |          |,--.
   ____/ /  /\\ ,-._.--------.-.-' ,-')('-. |          |\`;/
.-()___  :  |`.!,-'`'/`-._  (___) (  '  `  )`-._    _.-'|;,|
`-,    \_\__\`,-'>-.,-._           `-....-'     ````    `--'  
  `-._       (`- `-._`-.`

dammintt wort work in here!!!!!!!
   


SaintSinner

#16
ok this should work

newyear
   


AlwaysConnected

                    A  
                    < * >                                                             *
 *                  /.-.\         *                   *                  *
          *         /&\                    *
                 ,@.*;@,                                        *                     *                  *
                  /_o.I \    *      
               / ;--.  ,__  ')             *                               *                  *                   *
             ;@ o O,* ' &\ 
           *  ( '--)_@ ;o ()\      *                 *              Merry Christmas
            / ;--._ ''--._O'@;                                 And A Happy New Year          *
           /&*,() o ;-.,_  "" )                                    To  All Users                        *
          / ,@ ;+& () o* ;-';\                                
         ( ""--.,_0 +@' &()\                       *                          
         /-.,_      ''--....-' )  *                                                                           *
   *    /@o :;'--,.__   __.'\                                                        *
     ;*,&(); @ &^;  " o;@();         *                   *                   
     /(); o^ ; & ().o@*& ;&\                                              *
   "="==""==,,,.,="=="==="                                          
  __.----.(\-''#####---...___...-----

kerst

or this one ^

kepp

I can feel Christmas is comming closer when i look at those "pictures" :)
Guarding    

plop

ran a test 2day on 3 different way's of sync-ing, 2 failed.
so rewriten the sync part and should work fine 2morrow.
used a much saver way now.  lol
untill the last hour it should show the time left every hour.
after that it jumps from 15 mins, to 5 mins to 1, to 15 secs, to 5 secs, and starts 2 countdown from 10 to 0 then shows a text file and wishes happy new year from all the folks here on the forum.  lol
pray for me that it all works 2morrow.  lol

have 2 thk chilla allready for his cool julianday with hours,mins, seconds, that made it a lot easyer.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

pHaTTy

Sounding nice plop
Resistance is futile!

Masterload

lol  thxx again all for the time ...
hehe feeling the spirrit to here :))

my kids are counting down already
hm, i have to reinstall ,get a working exe
then ill wil try to create a nice ASCII picture's
first time do :P

thxx all in here for ur "time" lolz

sounds great plop :)
magmarnet

visit me at home....

 

plop

tada, tested and working.
------------------------------------------------------------------------------
-------                  countdown bot by plop                         -------
-------             original julian day made by tezlo                  -------
-------      modifyd by chilla 2 also handle hours, mins, seconds      -------
------------------------------------------------------------------------------

------------------------------------------------------------------------------
-------           THE TEXT FILE LOADS ON BOT START                     -------
------------------------------------------------------------------------------
------- this may sound weird but this 2 make sure it shows on time,    -------
-------      as i allready seen some big ascii's come by               -------
------------------------------------------------------------------------------


------------------------------------------------------------------------------
Bot = "newyear"
--This the date the timer has 2 stop @ midnight
-- year (2 numbers), month, day
SylYear,SylMonth,SylDay = 03,12,31
-- this is the file 2 be shown 
file = "happynewyear.txt"
------------------------------------------------------------------------------


------------------------------------------------------------------------------
function OnTimer()
   if last == 0 then
      SendToAll(Bot, TimeLeft())
      Sync()
   elseif last == 1 then
      SendAscii() -- send the msg
      StopTimer() -- kill the timer
   end
end
------------------------------------------------------------------------------
function jdatehms(d, m, y,ho,mi,se)
	local a, b, c = 0, 0, 0
	if m <= 2 then
		y = y - 1
		m = m + 12
	end
	if (y*10000 + m*100 + d) >= 15821015 then
		a = floor(y/100)
		b = 2 - a + floor(a/4)
	end
	if y <= 0 then c = 0.75 end
	return floor(365.25*y - c) + floor(30.6001*(m+1) + d + 1720994 + b),ho*3600+mi*60+se
end
------------------------------------------------------------------------------
function TimeLeft()
   local curday,cursec = jdatehms(tonumber(date("%d")),tonumber(date("%m")),tonumber(date("%y")),tonumber(date("%H")),tonumber(date("%M")),tonumber(date("%S")))
	local sylday,sylsec = jdatehms(SylDay,SylMonth,SylYear,24,0,0)
	local tmp = sylsec-cursec
	local hours, minutes,seconds = floor(mod(tmp/3600, 60)), floor(mod(tmp/60, 60)), floor(mod(tmp/1, 60))
	return ("Time left till new year: "..sylday-curday.." Day's, "..hours.." Hours, "..minutes.." Minutes, "..seconds.." Seconds")
end
------------------------------------------------------------------------------
function ShowAscii()
   text ="\r\n\r\n"
   readfrom(file)
   while 1 do
      local line = read()
      if line == nil then 
         readfrom()
         break 
      end
      text = text..line.."\r\n"
   end 
end
------------------------------------------------------------------------------
function SendAscii()
   SendToAll(Bot, text.." |")
   SendToAll(Bot, "happy new year 2 everybody from all the guy's/girls/bot's from the lua forum|")
end
------------------------------------------------------------------------------
function DataArrival(user, data) 
   if( strsub(data, 1, 1) == "<" ) then 
      data=strsub(data,1,strlen(data)-1) 
      s,e,cmd = strfind(data,"%b<>%s+(%S+)") 
      if cmd == "!daysleft" then
         user:SendData(Bot, TimeLeft().."|")
         return 1
      end
   end
end
------------------------------------------------------------------------------
function NewUserConnected(user)
   user:SendData(Bot, TimeLeft().."|")
end
------------------------------------------------------------------------------
function OpConnected(user)
   user:SendData(Bot, TimeLeft().."|")
end
------------------------------------------------------------------------------
function Main()
	SetTimer(100 * 1000) 
	StartTimer()
   SendToAll(Bot, TimeLeft().."|")
   Sync()
   ShowAscii()
   last = 0
end
------------------------------------------------------------------------------
function Sync()
   local curday,cursec = jdatehms(tonumber(date("%d")),tonumber(date("%m")),tonumber(date("%y")),tonumber(date("%H")),tonumber(date("%M")),tonumber(date("%S")))
	local sylday,sylsec = jdatehms(SylDay,SylMonth,SylYear,24,0,0)
   local tmp = sylsec-cursec
   local hours, minutes,seconds = floor(mod(tmp/3600, 60)), floor(mod(tmp/60, 60)), floor(mod(tmp/1, 60))
   if tmp > 3600 then  --- every hours a msg
      adjust = (floor(mod(minutes, 60))*60)+seconds
      if adjust ~= 0 then
         SetTimer(adjust * 1000) 
      else
         SetTimer(3600 * 1000) 
      end
   elseif tmp > 900 then  -- every 15 mins a msg
      adjust = (floor(mod(minutes, 15))*60)+seconds
      if adjust ~= 0 then
         SetTimer(adjust * 1000) 
      else
         SetTimer(900 * 1000) 
      end
   elseif tmp > 300 then  -- every 5 mins a msg
      adjust = (floor(mod(minutes, 5))*60)+seconds
      if adjust ~= 0 then
         SetTimer(adjust * 1000) 
      else
         SetTimer(300 * 1000) 
      end
   elseif tmp > 60 then  -- every min a msg
      adjust = (floor(mod(minutes, 1))*60)+seconds
      if adjust ~= 0 then
         SetTimer(adjust * 1000) 
      else
         SetTimer(60 * 1000) 
      end
   elseif tmp > 15 then  -- every 15 secs a msg
      adjust = floor(mod(seconds, 15))
      if adjust ~= 0 then
         SetTimer(adjust * 1000) 
      else
         SetTimer(15 * 1000) 
      end
   elseif tmp > 10 then  -- every 10 secs a msg
      adjust = floor(mod(seconds, 10))
      if adjust ~= 0 then
         SetTimer(adjust * 1000) 
      else
         SetTimer(5 * 1000) 
      end
   elseif tmp > 1 then
      SetTimer(1 * 1000) 
   else
      last = 1
      SetTimer(1 * 1000)
   end
end
------------------------------------------------------------------------------
happy new year.  lol
can offcourse be used for anything you like, birthday's etc...
just enter the date and file name it has 2 show.
script header allready shows it but i'll repeat it.
the text/ascii loads on the start of the bot, this 2 make sure it shows on time as i seen some big ascii's come by.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

kepp

Guarding    

c h i l l a

really nice one :)).

I like your idea with the smaller timer intervalls when coming nearer to sylvester.

SMF spam blocked by CleanTalk