PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Zigurds on 19 April, 2004, 16:56:00

Title: Automatic !restartscript
Post by: Zigurds on 19 April, 2004, 16:56:00
Need script for automatic cmd !restartscript, with freely fitting time interval

sorry, bad my language

--------------------------------
owner for Latvian hub ALFA
Title:
Post by: plop on 19 April, 2004, 22:44:16
QuoteOriginally posted by Zigurds
Need script for automatic cmd !restartscript, with freely fitting time interval

sorry, bad my language

--------------------------------
owner for Latvian hub ALFA
this is only posible 2 do with client side scripting.
any hints on the interval??
for example daily/weekly.

plop

* mods pls move this topic 2 the correct place.
Title:
Post by: AlwaysConnected on 20 April, 2004, 08:15:12
QuoteOriginally posted by plop
QuoteOriginally posted by Zigurds
Need script for automatic cmd !restartscript, with freely fitting time interval

sorry, bad my language

--------------------------------
owner for Latvian hub ALFA
this is only posible 2 do with client side scripting.
any hints on the interval??
for example daily/weekly.

plop

* mods pls move this topic 2 the correct place.

changed it ;)
thnx plop for notice
Title:
Post by: Skrollster on 20 April, 2004, 08:34:19
to be honest this can be done with ptokax version 0.300 b15.16 and newer...
Title:
Post by: plop on 20 April, 2004, 09:40:43
QuoteOriginally posted by Skrollster
to be honest this can be done with ptokax version 0.300 b15.16 and newer...
i tryd it in the past but the command ended up in the chat all the time. lol
any new feature i'm missing??

plop
Title:
Post by: Skrollster on 20 April, 2004, 09:53:41
Maybe.. ;) I'll ask ptaczek if it is a public feature or if it will be removed...
Title:
Post by: Zigurds on 20 April, 2004, 12:40:04
I use v330 15.25
Time interval accetable from freely selection, example  1x daily

sorry, bad my language

--------------------------------
owner for Latvian hub ALFA
Title:
Post by: plop on 20 April, 2004, 14:33:40
here is a bcdc script which abuse the 1st mainchat event after midnight 2 restart the scripts running on the hub.
-- abuses mainchat events 2 trigger a daily restart of the scripts running on ptokax.
-- plop

today = os.date("%x")

dcpp:setListener( "chat", "restartscripts",
    function( hub, user, text )
        if os.date("%x") ~= today then
            hub:sendChat( "!restartscripts" )
            today = os.date("%x")
        end
    end
)

DC():PrintDebug( "daily restartscripts loaded!" )
plop
Title:
Post by: [NL]ZeroX on 10 May, 2004, 19:42:01
hmmzz doesn't work clear :(

[string "hublist.lua"]:1: `=' expected near `'


i've eddited a bit, but also the orriginal doesn't work :/

because i've now verlihub and there's a little bug in it to send automatic the hub info to the hublists i need to do this manualy

-- abuses mainchat events 2 trigger a daily restart of the scripts running on ptokax.
-- plop

today = os.date("%M")

dcpp:setListener( "chat", "hublist",
    function( hub, user, text )
        if os.date("%M") ~= today then
            hub:sendChat( "!hublist" )
            today = os.date("%M")
        end
    end
)

DC():PrintDebug( "*** Hublist updateder Loaded! ***" )

or can someone help me make one for sending hub info every 5 minutes
Title:
Post by: NotRabidWombat on 10 May, 2004, 21:51:00
hah!
local retCode = execute("restart2.exe");
if( retCode ~= 0) then
   -- restart failed
else
   -- restart suceeded
end
Get it here:
http://students.dwc.edu/cbarber/restart2.exe

Only for TD4.

*EDIT* - Awwww... school shows me no love. Someone give me a place to post the exe.

-NotRabidWombat
Title:
Post by: plop on 10 May, 2004, 21:58:59
QuoteOriginally posted by NotRabidWombat
*EDIT* - Awwww... school shows me no love. Someone give me a place to post the exe.

-NotRabidWombat
you gota a pm. lol
i'll place it on my website.

plop
Title:
Post by: NotRabidWombat on 11 May, 2004, 01:05:28
Got it!
http://barber.no-ip.com/restart2.exe

Someone mirror or feel my wraith!

-NotRabidWombat
Title:
Post by: plop on 11 May, 2004, 01:31:20
QuoteOriginally posted by NotRabidWombat
Got it!
http://barber.no-ip.com/restart2.exe

Someone mirror or feel my wraith!

-NotRabidWombat
mirrored here (http://www.plop.nl/lua_tools/restart2.exe).

plop
Title:
Post by: NotRabidWombat on 11 May, 2004, 07:39:55
Thanks

-NotRabidWombat
Title:
Post by: plop on 11 May, 2004, 11:53:26
QuoteOriginally posted by NotRabidWombat
Thanks

-NotRabidWombat
yw

plop