PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: BruNeo on 21 March, 2004, 01:37:53

Title: !restartscripts Script
Post by: BruNeo on 21 March, 2004, 01:37:53
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
Title:
Post by: [NL]trucker on 21 March, 2004, 09:46:24
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.
Title:
Post by: [G-T-E]Gate? on 21 March, 2004, 13:08:35
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.
Title:
Post by: [PT]CableGuy on 22 March, 2004, 18:09:37
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" ;)
Title:
Post by: Corayzon on 23 March, 2004, 02:55:54
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:
Title:
Post by: ((UKSN))shad_dow on 05 May, 2004, 04:34:38
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
Title:
Post by: Corayzon on 05 May, 2004, 04:49:51
((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
Title:
Post by: ((UKSN))shad_dow on 05 May, 2004, 12:14:36
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*) .... ;)
Title:
Post by: Corayzon on 06 May, 2004, 01:48:09
hopefully in the 0330 release there will be something like frmHub:RestartScripts  ?(
Title:
Post by: xfiles on 09 May, 2004, 15:27:18
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.
Title:
Post by: nErBoS on 09 May, 2004, 18:41:05
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
Title:
Post by: xfiles on 09 May, 2004, 19:07:19
Thx a lot my m8.  :))