just like to have one :))
How would that work? What would the script do?
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?
I think that's imposible
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
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 ?
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?
thxx to you all for your time !
hi Plop
just woundering if you have figured something out ..
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
I can't wait to see how you will solve ths.. :)
had some minor probs here back now....
23 day's left m8,
but the countdown works ?
[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
Yhea guy's give Plop some help, who can make him some (verry Nice) ASCII picture... ;)
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
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!!!!!!!
ok this should work
newyear (http://members.cox.net/saintsinner/newYear.txt)
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 (http://home.planet.nl/~feer0011/ptokax/kerst.txt)
or this one ^
I can feel Christmas is comming closer when i look at those "pictures" :)
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
Sounding nice plop
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 :)
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
Very Nice :D
really nice one :)).
I like your idea with the smaller timer intervalls when coming nearer to sylvester.
Realy Great job NICE :D :D
0:01:19] <:T??:Cy?e??o?> happy new....... damn..=)
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(10 Sec)::::::
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(9 Sec)::::::
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(8 Sec)::::::
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(7 Sec)::::::
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(6 Sec)::::::
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(5 Sec)::::::
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(4 Sec)::::::
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(3 Sec)::::::
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(2 Sec)::::::
[00:01:19] ::::::Time:::Left:::Till:::NewYear::(21 Day's)::(0 Hours)::(0 Min)::(1 Sec)::::::
its gona make a countdown every evening now i gues hope you can fix this
TiMe :P
yes notiched it 2day 2. lol
expect a fix tomorow, easy 1 this.
plop
this should do the trick.
------------------------------------------------------------------------------
------- 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))
local day = sylday-curday
if day ~= 0 then
adjust = (floor(mod(minutes, 60))*60)+seconds
if adjust ~= 0 then
SetTimer(adjust * 1000)
else
SetTimer(3600 * 1000)
end
else
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
end
------------------------------------------------------------------------------
plop
Nice Plop... works fine 4 me :D
as i sayed you r a great scripter
Thanks hope it works now have to wait till 12 lolzz
:D
What did u change and what was the problem??I got it in my hub and it works lika a clock =] ?(
Plop
Thanx for this nice small script for the New Year, I also like it as it can be easily edited for any special announcement.
:))
QuoteOriginally posted by Snoris
What did u change and what was the problem??I got it in my hub and it works lika a clock =] ?(
i used tmp for syncing the timer, this only held 1 day.
so the script didn't check if it actualy was the last day.
i inserted the next piece of code.
if day ~= 0 then
adjust = (floor(mod(minutes, 60))*60)+seconds
if adjust ~= 0 then
SetTimer(adjust * 1000)
else
SetTimer(3600 * 1000)
end
else
-- original sync folows here
as you can see it checks if day is 0, if not it just uses the 1 hour interval on the timer.
it is indeed a kind of clock but it's running backwards 2wards newyear.
on that excact moment it shows a msg (happynewyear.txt)
on the last hour the timer interval gets smaller and smaller resulting in a countdown from 10 to 0.
plop
Oki works Great now Job well done m8 :D
QuoteOriginally posted by T?M??r?V?ll?R
Oki works Great now Job well done m8 :D
did you fully test it ???
it's a real problem here 2 change my system clock 2 test this bot fully.
plop
Changde system klok and works ;)
QuoteOriginally posted by T?M??r?V?ll?R
Changde system klok and works ;)
ok good 2 hear.
plop
hehe countdown works its running smooth !
thxx plop :)
read somewhere you need some more q for scripts
now the countdown is running....
this was the idea......
24:00 auto web...
saying happy new year !!!
some fireworks en so on
thxx.. greets from the lua . :)
option ??
again...can this be done ??
(sorry just have a great fantasie :P)
works great. Just is doesn't stop working after new year's eve : )
so it prints things like:
Zeit bis zum neuen Jahr: -1 Tage, 23 Stunden, 55 Minuten, 0 Sekunden
(yes, I translated it :p)
QuoteOriginally posted by yepyepyep4711
works great. Just is doesn't stop working after new year's eve : )
so it prints things like:
Zeit bis zum neuen Jahr: -1 Tage, 23 Stunden, 55 Minuten, 0 Sekunden
(yes, I translated it :p)
lol the timer does stop.
gues it's the welcome, that indeed doesn't stop.
ok bug fix 2morrow.
plop
it now should stop after newyear. lol
also changed the way it shows, if day's/hours/minutes/seconds == 0 then it's not showing.
looks a bit better @ moments the timer is in sync.
------------------------------------------------------------------------------
------- 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))
local day = sylday-curday
if day >= 0 then
line = "Time left till new year:"
if day ~= 0 then
line = line.." "..day.." Day's"
end
if hours ~= 0 then
line = line.." "..hours.." Hours"
end
if minutes ~= 0 then
line = line.." "..minutes.." Minutes"
end
if seconds ~= 0 then
line = line.." "..seconds.." Seconds"
end
return line
else
return 1
end
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)
local tmp = TimeLeft()
if tmp ~= 1 then
user:SendData(Bot, tmp.."|")
end
end
------------------------------------------------------------------------------
function OpConnected(user)
local tmp = TimeLeft()
if tmp ~= 1 then
user:SendData(Bot, TimeLeft().."|")
end
end
------------------------------------------------------------------------------
function Main()
SetTimer(100 * 1000)
StartTimer()
local tmp = TimeLeft()
if tmp ~= 1 then
SendToAll(Bot, tmp.."|")
end
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))
local day = sylday-curday
if day ~= 0 then
adjust = (floor(mod(minutes, 60))*60)+seconds
if adjust ~= 0 then
SetTimer(adjust * 1000)
else
SetTimer(3600 * 1000)
end
else
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
end
------------------------------------------------------------------------------
plop
* edit: forgot function main.
lol forgot the command also + tiny bug fix.
------------------------------------------------------------------------------
------- 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))
local day = sylday-curday
if day >= 0 then
line = "Time left till new year:"
if day ~= 0 then
line = line.." "..day.." Day's"
end
if hours ~= 0 then
line = line.." "..hours.." Hours"
end
if minutes ~= 0 then
line = line.." "..minutes.." Minutes"
end
if seconds ~= 0 then
line = line.." "..seconds.." Seconds"
end
return line
else
return 1
end
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
local tmp = TimeLeft()
if tonumber(tmp) == nil then
user:SendData(Bot, tmp.."|")
end
return 1
end
end
end
------------------------------------------------------------------------------
function NewUserConnected(user)
local tmp = TimeLeft()
if tonumber(tmp) == nil then
user:SendData(Bot, tmp.."|")
end
end
------------------------------------------------------------------------------
function OpConnected(user)
local tmp = TimeLeft()
if tonumber(tmp) == nil then
user:SendData(Bot, tmp.."|")
end
end
------------------------------------------------------------------------------
function Main()
SetTimer(100 * 1000)
StartTimer()
local tmp = TimeLeft()
if tonumber(tmp) == nil then
SendToAll(Bot, tmp.."|")
end
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))
local day = sylday-curday
if day ~= 0 then
adjust = (floor(mod(minutes, 60))*60)+seconds
if adjust ~= 0 then
SetTimer(adjust * 1000)
else
SetTimer(3600 * 1000)
end
else
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
end
------------------------------------------------------------------------------
plop
sorry man :( i didn't read the top of the script carefully.so u r the creator.
the reason that i asked the manual period setting is for example if i want to advertise a thing in the hub by countdown.so i want to set the message period myself.is it possible ?
QuoteOriginally posted by civil
sorry man :( i didn't read the top of the script carefully.so u r the creator.
the reason that i asked the manual period setting is for example if i want to advertise a thing in the hub by countdown.so i want to set the message period myself.is it possible ?
no need 2 excuse yourself.
it is posible but also tricky, let me try 2 explain it.
elseif tmp > 300 then -- tmp is the amount of seconds left, this i use 2 change the timer, 300 seconds is 5 minutes.
adjust = (floor(mod(minutes, 5))*60)+seconds -- here i check if the timer is in sync, if not the result is anything but 0
if adjust ~= 0 then -- here i check if the adjustment is needed 2 get back in sync
SetTimer(adjust * 1000) -- here is start a timer with the needed seconds 2 get the script back in sync.
else -- this is triggered if the script is in sync
SetTimer(300 * 1000) -- here i change the timer 2 the wanted interval, 300 x 1000 = 5 minutes timer interval.
end
as you can see it's posible but you need 2 adjust things on several places and 1 thing wrong and it goes nutty.
plop
thank you so much. :)
ok i just found this script... i can get the timer to work ok but i can't get the picture to pop up... should a picture pop up?.. i have got a "happynewyear.txt" file in my text filder with a picture in it..... if a picture IS supposed to pop up what have i got wrong?.....
thanks in advance :)
QuoteOriginally posted by cfc
ok i just found this script... i can get the timer to work ok but i can't get the picture to pop up... should a picture pop up?.. i have got a "happynewyear.txt" file in my text filder with a picture in it..... if a picture IS supposed to pop up what have i got wrong?.....
thanks in advance :)
the text file should be in the root of the scripts folder.
on the last moment of the timer the picture/text shows up.
the txt file should be there before the script is started.
plop
the text file should be in the root of the scripts folder.
on the last moment of the timer the picture/text shows up.
the txt file should be there before the script is started.
plop
thak you plop.. much appre... apreacha...appreaech... i'm very gratefull works a treat :)
verry nice job plop all working on it
this fool has another idea
lol
if there is a good web master......
lol i like to try this. example
on 12:00 midnight goto webby with fire works
happy newyear !!!!
??
QuoteOriginally posted by Masterload
verry nice job plop all working on it
this fool has another idea
lol
if there is a good web master......
lol i like to try this. example
on 12:00 midnight goto webby with fire works
happy newyear !!!!
??
nice idea but the only way dc can open a website is when the user opens it himself. lol
plop
hehe smoking to much i think
thxx plop great job m8y :)
like to wish all here reading this !!!
happy new year (back next year.... another topic )
lolz
QuoteOriginally posted by Masterload
hehe smoking to much i think
thxx plop great job m8y :)
thats really bad, you forgot 2 give me some. lol
happy new year 2 u 2
plop
here u go plop :)
legalize it :P
hehe thxx again
(http://photos.bravenet.com/155/408/555/9689B1E85ETN.gif)