03-30-2022, 08:32 AM
local LOGOUT_TIME = { Min = 600, Max = 1200 } -- In seconds. How long should stay online? After that amount of time, the character will be logged out.
n = 0
if connected() then
setsettings('Tools/Reconnect/Enabled', false) -- put reconnect in seconds/miliseconds, dont logout where monsters are
end
if connected() then
if NEXT_LOGOUT == nil then
NEXT_LOGOUT = runningtime() + random(LOGOUT_TIME.Min, LOGOUT_TIME.Max)
end
if runningtime() >= NEXT_LOGOUT then
while connected() do
wait(1000, 2000)
if not battlesigned() then
n = 1
logout()
end
end
NEXT_LOGOUT = nil
end
end
if n == 1 then
if not connected() then
setsettings('Tools/Reconnect/Enabled', true)
end
end