!restartscripts Script
 

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

!restartscripts Script

Started by BruNeo, 21 March, 2004, 01:37:53

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BruNeo

hello, i want to know if its possible to have a Lua script that activate from X at X minutes activate the Ptokax inbuilt command !restartscripts.

best regards
I\'ll Moderate You!! :D

[NL]trucker

BruNeo

yess it should be possible but why do you need this?

if you just press the restartscripts in pkotax it works also
and look in the mainscripts like robo or channelbot they have a command !restartscripts inbuild.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[G-T-E]Gate?

Request that BruNeo wants has come up many a times before. Dont know why he may want the script but I think it would be a good applacation for myself and maybe others.
Running a hub 24/7 (as I and others do) and not being there all the time to restart them, well speaks for itself.
So such a script with a timer is a Good idea.

[PT]CableGuy

Hi ppl:

About restarting the scripts (all of them) , i usually make a remote desktop connection for that. ;(
Can you imagine , when the hub is full and the line have few bandwidth left ? 8o
It's impossible...and sometimes i have to wait until the hub have less users to do that. :(
This kind of script is very welcome and it would be AWESOME to have a timer. :D
Hope someone "grabs the ideia" ;)

Corayzon

Sounds like a great idea to me... but how would u send the restartscripts to the hub?

i imagine u would use something like user:SendData(user.sName, "!restartscripts|"

 :rolleyes:

((UKSN))shad_dow

#5
ello all .....

try this , sorry untested due to busy times @ home
---- ScriptRestart timer by ((UKSN))shad_dow

Min = 3 -- in minutes (can change the numer from 3 to any number )
Time = Min*60000 --(don't touch)
sBotName = "ScriptRestart" --- ( rename with your hub bots name)



function Main()
  SetTimer(Time)
  StartTimer()
 ReStart()
end

function OnTimer()
  ReStart()
end


function ReStart()
SendToAll(sBotName,"Is being restarted On: "..date("%A").." the "..date("%d").."th of "..date("%B").." Time: "..date("%T"))
end
plz leave a messgae if it works or if theres a prob .. thx
creator of Therapy-X? bot

Corayzon

#6
((UKSN))shad_dow this aint restarting the scripts! it just sends a message sayin it has :S

in the function ReStart() if u call OnExit() and then Main() this will actually do allmost the exact same as restarting them from the button or typeing !restartscripts but...

this doesnt reset the system settings and only works per script.

so you would have to add this to each script you would like to restart on x time
 ;)

sBot = "-Restart-Scripts-"
dSecond = 1000
dMinute = 60 * dSecond
dHour = 60 * dMinute
dDay = 24 * dHour
dInterval = 1 * dHour

function Main()
	frmHub:RegBot(sBot)
	SetTimer(dInterval)
	StartTimer()
end

function OnTimer() 
	restartScripts
end 

function restartScripts()
	OnExit()
	Main()
	SendToAll(sBot, "*** Hub Script Restarted!"
end

function OnExit()

end

((UKSN))shad_dow

thankx for the info Corayzon and the help  ..

since im only using 1 bot (my own LOL ) this will do nicely .... shame we dont acutuly know the !restartscripts fuction other than its hub scripted , MR Ptokax can u help us here Plz ... (*on knees , grovling to the hubsoft master*) .... ;)
creator of Therapy-X? bot

Corayzon

hopefully in the 0330 release there will be something like frmHub:RestartScripts  ?(

xfiles

Hello all,

i get this syntax error:

Syntax error: `=' expected;
  last token read: `function' at line 19 in file `...en\Rui Ferreira\Eigene Dateien\LusoArenA\scripts\RestartScripts.lua'

Could someone fix it for me please!?
Thx a lot.

nErBoS

Hi,

Corrected...

sBot = "-Restart-Scripts-"
dSecond = 1000
dMinute = 60 * dSecond
dHour = 60 * dMinute
dDay = 24 * dHour
dInterval = 1 * dHour

function Main()
	frmHub:RegBot(sBot)
	SetTimer(dInterval)
	StartTimer()
end

function OnTimer() 
	restartScripts()
end 

function restartScripts()
	OnExit()
	Main()
	SendToAll(sBot, "*** Hub Script Restarted!")
end

function OnExit()

end

Best regards, nErBoS
--## nErBoS Spot ##--

xfiles

Thx a lot my m8.  :))

SMF spam blocked by CleanTalk