is there some kind of countdown timer for newyear ??? - Page 2
 

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 1 Guest are viewing this topic.

TiMeTrAVelleR

Realy Great job   NICE :D  :D

TiMeTrAVelleR

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

plop

yes notiched it 2day 2. lol
expect a fix tomorow, easy 1 this.

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 <----<<

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
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 <----<<

Event_Horizon

Nice Plop... works fine 4 me :D

as i sayed you r a great scripter
Greez ????_H???z??
??????????????????

??/v\\ \'?\' ?@?? ???? is Secured by RoboCop? Created by Optimus?

TiMeTrAVelleR

Thanks  hope it works  now have to wait till 12   lolzz

 :D

Snoris

What did u change and what was the problem??I got it in my hub and it works lika a clock =] ?(

Flux

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.

 :))
? Official HoD Website - http://www.houseofdance.net
? Official HoD Hub Community -  hodhub.dyndns.org:2007

plop

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
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 <----<<

TiMeTrAVelleR

Oki  works  Great now Job  well done  m8 :D

plop

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
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 <----<<

TiMeTrAVelleR

Changde  system klok  and works   ;)

plop

QuoteOriginally posted by T?M??r?V?ll?R
Changde  system klok  and works   ;)
ok good 2 hear.

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

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)
magmarnet

visit me at home....

 

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)

plop

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
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 <----<<

plop

#41
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.
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 <----<<

plop

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
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 <----<<

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 ?

plop

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
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 <----<<

civil

thank you so much. :)

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 :)

plop

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
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 <----<<

cfc

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 :)

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 !!!!

??
magmarnet

visit me at home....

 

SMF spam blocked by CleanTalk