A safe reconnecter that will logout and disable itself if you are inside a temple or got skulled. Enable this hotkey after you logged in.
Configuration
Set reopenVisibleBackpacks to true if you want to reopen backpacks after login, it'll open all visible backpacks on the main bp. Set if to false to ignore this option.
Set ignoreServerSavingTime to true to ignore the server save time, set to false to wait the server save time.
Fill the information about all your accounts on the list accountsInformation so the reconnect will always know your account name and password to login when you're offline again.
Public API
autoReconnecter.isEnabled()
Returns whether this auto reconnect script is enabled or not as a boolean representation. By enabled it means if the routine is resumed or paused (see functions below) and not if the script path is set as enabled by the bot.
autoReconnecter.resume()
Resumes the auto reconnect script routine.
autoReconnecter.pause()
Pauses the auto reconnect script routine.
Code
init start
-- local SCRIPT_VERSION = "3.0.0"
local ignoreServerSavingTime = false
local reopenVisibleBackpacks = true
local specialChecks = {
{
function()
return isontemple()
end,
function()
printerrorf("AutoReconnect: [%q] Client closed. Reason: Character was inside a temple.", $name)
closeclient(true)
end
},
{
function()
return ($self.skull == SKULL_RED or $self.skull == SKULL_BLACK) and $pzone
end,
function()
printerrorf("AutoReconnect: [%q] Client closed. Reason: Character was red/black skulled inside a protection zone.", $name)
closeclient(true)
end
},
{
function()
return $stamina <= 840 and $pzone
end,
function()
printerrorf("AutoReconnect: [%q] Client closed. Reason: Character had less/equal than 14 hours of stamina and inside a protection zone.", $name)
closeclient(true)
end
},
}
-- DO NOT EDIT BELOW --
if autoReconnecter == nil then
autoReconnecter = {
enabled = true
}
autoReconnecter.pause = function()
autoReconnecter.enabled = false
end
autoReconnecter.resume = function()
autoReconnecter.enabled = true
end
end
for _, accountEntry in pairs(accountsInformation) do
table.lower(accountEntry.characters)
end
local randTimeSS = math.random(100, 700)
init end
auto(1000, 2000)
local currentServerSaveTime = sstime()
if autoReconnecter.enabled and (not $connected) and (ignoreServerSavingTime or (currentServerSaveTime >= 600 + randTimeSS and currentServerSaveTime <= 85800 - randTimeSS)) then
if $name ~= "" then
local index = 0
for i, accountEntry in pairs(accountsInformation) do
if table.find(accountEntry.characters, $name:lower()) then
index = i
break
end
end
if index > 0 then
local login = accountsInformation[index]
local oldTypeTimeSettings = get('Settings/TypeWaitTime')
local oldPressTimeSettings = get('Settings/PressWaitTime')
set('Settings/TypeWaitTime', '110 x 140')
set('Settings/PressWaitTime', '100 x 250')
setlifetime(20000)
while (not $connected) do
connect(login.accountName, login.accountPassword, $name) wait(200)
end
for _, checkCallback in pairs(specialChecks) do
if checkCallback[1]() then
checkCallback[2]()
end
end
if reopenVisibleBackpacks then
local oldOpenNextBpSettings = get('Looting/OpenNextBP')
local oldFocusPolicySettings = get('Settings/FocusPolicy')
local oldOpenBpsAtLoginSettings = get('Looting/OpenBPsAtLogin')
set('Looting/OpenBPsAtLogin', 'no')
set('Settings/FocusPolicy', 'Focus on any event')
set('Looting/OpenNextBP', 'no')
setlifetime(10000)
reopenwindows('small')
while $openingbps do
wait(500) pausewalking(500)
end
pausewalking(0)
set('Looting/OpenNextBP', oldOpenNextBpSettings)
set('Settings/FocusPolicy', oldFocusPolicySettings)
set('Looting/OpenBPsAtLogin', oldOpenBpsAtLoginSettings)
end
else
printerrorf("AutoReconnect: Account details for %q doesn't exist.", $name)
end
else
printerrorf("AutoReconnect: Please login first to save your credentials.")
end
end
And where do i add my username and password to reconect?
04-28-2014, 02:20 PM
Leonardo
Quote:
Originally Posted by danielcb
can u add a bp reopener?
It's already added, however it's not configurable. It'll reopen main backpack and every backpack inside of it. If you want a different version try using Raphael's reconnect hotkey.
Quote:
Originally Posted by browni
And where do i add my username and password to reconect?
You don't need to insert it.
04-29-2014, 06:53 PM
Dkampen
@Leonardo, does this script work with the server save? I mean that it doesn't try to reconnect between 9:55 and 10:20?
04-29-2014, 07:14 PM
Leonardo
Quote:
Originally Posted by Dkampen
@Leonardo, does this script work with the server save? I mean that it doesn't try to reconnect between 9:55 and 10:20?
No, but it can be added for sure. I'll work on it, hold on.
04-29-2014, 10:41 PM
Akali
Does it reconnect after server save? And, does it reopen battlewindow? I just logged out, It logged me back in and opened my backpacks, but it didn't open battle window.
Thanks Leo.
Nevermind, tested again and it opened battlewindow, I might of clicked mouse button or something and it stopped it.
Reconnect at SS would be great if you can do that.
04-30-2014, 05:59 AM
Dkampen
@Akali, you might want to add this as a persistent script or as cavebot script just to make sure your battle window will always be opened.
Code:
"-- Open Battle Window --
auto(10000)
dontlist()
if not $battleopen then
openbattlelist()
wait(2000)
end
@Leonardo, Would be awesome. I'm looking forward to it. No more changing passwords, acc numbers, etc like in Raphael Scripts! :)
04-30-2014, 06:13 AM
Orexx
Sometimes using this persistent, The targeting / cavebot will not turn back on after server save, ultimately, kill me. I do not have 'pause bot' turned on in my alerts and there is no other persistent that could be causing this - any ideas?
04-30-2014, 10:26 AM
Akali
Reconnect after server save actually works in it, I don't know how, but I logged out once and it started logging in by itself, I didn't enter my account number or password into anything but I watched it log back in before I went to sleep., woke up after SS and my knight is back botting, It reconnects after SS.