Time bot
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Time bot

Started by htb222, 30 May, 2005, 20:18:25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

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.

jiten

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

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?

jiten

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

htb222

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

DJ Bert

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

Dessamator

hmm, indeed that script should work in theory, theres nothing wrong with it, but ptokax blocks those chars in this case " : "
Ignorance is Bliss.

htb222

Why ptokax blocks ":"?

Dessamator

hmm, well because, it can cause errors in ptokax, and because the developer chooses to do so !
Ignorance is Bliss.

htb222

k i understand. can someone help me with those 2 scripts: dcinfoantispam and dcinfoantiflood in lua 5?

jiten

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.

htb222

k thx jiten. Cheers

jiten


SMF spam blocked by CleanTalk