Automatically logs the next character on list if stamina drops below a certain threshold.
Configuration
Edit the accountList, table on the init block to specify your Tibia credentials and characters' name. Also edit the minStamina variable to specify the stamina threshold.
Code
-- local SCRIPT_VERSION = '1.1.0'
local minStamina = 16 * 60 -- In minutes
local accountList = {
{
account = 'account1',
password = 'password1',
character = 'character1'
},
{
account = 'account2',
password = 'password2',
character = 'character2'
},
{
account = 'account3',
password = 'password3',
character = 'character3'
}
}
-- DO NOT EDIT BELOW THIS LINE --
for _, v in ipairs(accountList) do
v.character = v.character:lower()
end
if $stamina < minStamina then
local curAccount = table.find(accountList, $name:lower(), 'character')
local nextAccount = accountList[(curAccount % #accountList) + 1]
waitandlogout()
waitping()
keyevent(VK_ESCAPE)
waitping()
connect(nextAccount.account, nextAccount.password, nextAccount.character)
end
@Raphael I need to use this to login to my next money maker, however, I also need to use reconnect for SS or kick, how can I associate these two scripts without them conflicting?
(Knowing that in the reconnect script I have to enter the character name as well)
11-18-2016, 05:16 PM
mistgun
@NikitaArcher, this one is just an action that you put in waypoints (f.e at the end of the script)
To avoid conflicts with your persistent reconnecter you might switch some global variable something like: 'reconnectEnabled = true / false'
You can already do this in Leonardo's reconnecter, just before it starts relogging onto another char you might put line:
autoReconnecter.pause()
Then after reconnecting you might resume it to previous state in another action (f.e at script start) with:
autoReconnecter.resume()
11-21-2016, 01:34 PM
NikitaArcher
Quote:
Originally Posted by mistgun
@NikitaArcher, this one is just an action that you put in waypoints (f.e at the end of the script)
To avoid conflicts with your persistent reconnecter you might switch some global variable something like: 'reconnectEnabled = true / false'
You can already do this in Leonardo's reconnecter, just before it starts relogging onto another char you might put line:
autoReconnecter.pause()
Then after reconnecting you might resume it to previous state in another action (f.e at script start) with: