Can somebody write script that count down to any date.
like 01.06.2004.
And if user type !countdown then script shows PM like this:
Quote
***********************************
There are 15 days left till end of the month.
***********************************
Hi,
Hope it helps...
--Requested by Janhouse
--Made by nErBoS
sBot = "CountDown"
function Main()
frmHub:RegBot(sBot)
end
function DataArrival(user, data)
if (strsub(data,1,1) == "<" or strsub(data,1,5+strlen(sBot)) == "$To: "..sBot) then
data = strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if (cmd == "!countdown") then
DayCounter(user)
return 1
end
end
end
function DayCounter(user)
local sTmp = ""
local day = date("%d")
day = tonumber(day)
local month = date("%m")
month = tonumber(day)
if (month == 1 or month == 3 or month == 5 or month == 7 or month == 8 or month == 10 or month == 12) then
day = 31-day
sTmp = sTmp.."\r\n******************************************************"
sTmp = sTmp.."\r\nThere are "..day.." days left until end of the month."
sTmp = sTmp.."\r\n******************************************************"
user:SendPM(sBot, sTmp)
elseif (month == 2) then
day = 28-day
sTmp = sTmp.."\r\n******************************************************"
sTmp = sTmp.."\r\nThere are "..day.." days left until end of the month."
sTmp = sTmp.."\r\n******************************************************"
user:SendPM(sBot, sTmp)
else
day = 30-day
sTmp = sTmp.."\r\n******************************************************"
sTmp = sTmp.."\r\nThere are "..day.." days left until end of the month."
sTmp = sTmp.."\r\n******************************************************"
user:SendPM(sBot, sTmp)
end
end
Best regards, nErBoS
Is it posible that it is counting down to the curent date? Like 14.07.2005.
Hi,
Not picking your request. You want the script to show the current data ??
Best regards, nErBoS
check my countdown script, you can find it on my website.
plop
Where can I find them?