Hi! I Have a question for u all. I want a script witch shows the curent time like a user. Can someone help me? Thx.
QuoteOriginally posted by htb222
Hi! I Have a question for u all. I want a script witch shows the curent time like a user. Can someone help me? Thx.
Try searching the forum for "timebot" or "timezone". You'll find what you need then ;)
Cheers
i found a script it looks like this:
hours = os.date("%H")
minutes = os.date("%M")
seconds = os.date("%S")
current =hours..":"..minutes..":"..seconds
sec = 1000
--------------------------------------------------------
function Main()
frmHub:RegBot("-=" ..current .."=-")
SetTimer(sec)
StartTimer()
end
--------------------------------------------------------
function OnTimer()
frmHub:UnregBot("-=" ..current .."=-")
time = os.date("%H:%M:%S")
current = time
frmHub:RegBot("-=" ..current .."=-")
end
---------------------------------------------
but this script doesn't show any user
i've try to assign to current valule os.date("%H%M%S") but this doesn't work too.
Anyone can help me?
Give this a try:
sBot = "yourbotname"
tDelay = 10 -- delay in minutes
Main = function()
SetTimer(tDelay*1000*60)
StartTimer()
end
OnTimer = function()
SendToAll(sBot, os.date("Local hub time: %T"))
end
Cheers
Thx jiden that really works. Another question. I have dcinfoantispam and dcinfoantiflood but in lua 4. Do u know if there is a version of this 2 scripts in lua 5?
Cheers
QuoteOriginally posted by htb222
i found a script it looks like this:
hours = os.date("%H")
minutes = os.date("%M")
seconds = os.date("%S")
current =hours..":"..minutes..":"..seconds
sec = 1000
--------------------------------------------------------
function Main()
frmHub:RegBot("-=" ..current .."=-")
SetTimer(sec)
StartTimer()
end
--------------------------------------------------------
function OnTimer()
frmHub:UnregBot("-=" ..current .."=-")
time = os.date("%H:%M:%S")
current = time
frmHub:RegBot("-=" ..current .."=-")
end
---------------------------------------------
but this script doesn't show any user
i've try to assign to current valule os.date("%H%M%S") but this doesn't work too.
Anyone can help me?
Try this one, works fine here
current = os.date("%a-%d-%m-%Y-%H.%M")
sec = 1000
--------------------------------------------------------
function Main()
frmHub:RegBot("((-" ..current .."-))")
SetTimer(sec)
StartTimer()
end
--------------------------------------------------------
function OnTimer()
frmHub:UnregBot("((-" ..current .."-))")
time = os.date("%a-%d-%m-%Y-%H.%M")
current = time
frmHub:RegBot("((-" ..current .."-))")
end
--------------------------------------------------------
function OnExit()
frmHub:UnregBot("((-" ..current .."-))")
end
hmm, indeed that script should work in theory, theres nothing wrong with it, but ptokax blocks those chars in this case " : "
Why ptokax blocks ":"?
hmm, well because, it can cause errors in ptokax, and because the developer chooses to do so !
k i understand. can someone help me with those 2 scripts: dcinfoantispam and dcinfoantiflood in lua 5?
QuoteOriginally posted by htb222
k i understand. can someone help me with those 2 scripts: dcinfoantispam and dcinfoantiflood in lua 5?
I don't remember those scripts atm, but, guess there's no need for them with the new PtokaX, because it has already an inbuild deflood system.
k thx jiten. Cheers
You're welcome ;)