Signup Now
Page 1 of 34 12311 ... LastLast
Results 1 to 10 of 334

Thread: Safe Reconnect

  1. #1
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22

    Safe Reconnect

    Safe Reconnect


    Description

    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 accountsInformation = {
    {
    accountName = "accountName",
    accountPassword = "accountpassword",
    characters = {"Bubble", "Eternal Oblivion"}
    },
    {
    accountName = "accountName2",
    accountPassword = "accountpassword2",
    characters = {"Lord\'Paulistinha", "Crisne"}
    },
    }

    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

    set('Settings/TypeWaitTime', oldTypeTimeSettings)
    set('Settings/PressWaitTime', oldPressTimeSettings)

    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

    Download
    Last edited by Leonardo; 07-06-2015 at 06:37 AM.

  2. #2
    Free User Dani Scripts's Avatar
    Join Date
    Dec 2013
    Location
    Mexico
    Posts
    558
    Reputation
    56
    Rep Power
    22
    can u add a bp reopener?

  3. #3
    Free User browni's Avatar
    Join Date
    Feb 2014
    Posts
    36
    Reputation
    10
    Rep Power
    0
    And where do i add my username and password to reconect?

  4. #4
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by danielcb View Post
    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 View Post
    And where do i add my username and password to reconect?
    You don't need to insert it.

  5. #5
    Free User
    Join Date
    Feb 2014
    Posts
    11
    Reputation
    10
    Rep Power
    0
    @Leonardo, does this script work with the server save? I mean that it doesn't try to reconnect between 9:55 and 10:20?

  6. #6
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by Dkampen View Post
    @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.

  7. #7
    Banned
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    205
    Reputation
    10
    Rep Power
    0
    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.
    Last edited by Akali; 04-29-2014 at 10:48 PM.

  8. #8
    Free User
    Join Date
    Feb 2014
    Posts
    11
    Reputation
    10
    Rep Power
    0
    @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!
    Last edited by Dkampen; 04-30-2014 at 06:03 AM.

  9. #9
    Free User Orexx's Avatar
    Join Date
    Dec 2013
    Posts
    760
    Reputation
    21
    Rep Power
    22
    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?

  10. #10
    Banned
    Join Date
    Apr 2014
    Location
    United Kingdom
    Posts
    205
    Reputation
    10
    Rep Power
    0
    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.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •