PtokaX forum

Archive => Archived 5.0 boards => Request for scripts => Topic started by: htb222 on 30 May, 2005, 20:18:25

Title: Time bot
Post by: htb222 on 30 May, 2005, 20:18:25
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.
Title:
Post by: jiten on 30 May, 2005, 20:35:52
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
Title: i found but doesn't work
Post by: htb222 on 30 May, 2005, 20:57:12
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?
Title:
Post by: jiten on 30 May, 2005, 21:09:58
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
Title: Thx man
Post by: htb222 on 30 May, 2005, 21:11:59
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
Title:
Post by: DJ Bert on 30 May, 2005, 21:15:21
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

Title:
Post by: Dessamator on 30 May, 2005, 21:23:09
hmm, indeed that script should work in theory, theres nothing wrong with it, but ptokax blocks those chars in this case " : "
Title: ?
Post by: htb222 on 30 May, 2005, 21:26:37
Why ptokax blocks ":"?
Title:
Post by: Dessamator on 30 May, 2005, 21:43:57
hmm, well because, it can cause errors in ptokax, and because the developer chooses to do so !
Title:
Post by: htb222 on 30 May, 2005, 21:59:28
k i understand. can someone help me with those 2 scripts: dcinfoantispam and dcinfoantiflood in lua 5?
Title:
Post by: jiten on 30 May, 2005, 22:04:04
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.
Title:
Post by: htb222 on 30 May, 2005, 22:05:16
k thx jiten. Cheers
Title:
Post by: jiten on 31 May, 2005, 09:17:47
You're welcome ;)