Dont get me wrong, i like the idea of the script.
And it would even better if it even was safe and worked.
Hope you get some help from someone that have more knowledge about scripting then me.
Printable View
Dont get me wrong, i like the idea of the script.
And it would even better if it even was safe and worked.
Hope you get some help from someone that have more knowledge about scripting then me.
i edited and now it works for me, it works with the PC TIME and you have to put the time of your pc!.
LOOK HERE IN CHILE THE SS TIME IS at "04:00" am (when my pc time is 04:00) so, you have to put ignoreSS = false
this recconect have TimessStart and TimessEnd (between timessstart and timessend the reconnect doesnt work)
test it and give me your feedbacks
PD: you can change the times to the time you have right now to test it! doesnt need to wait to ss time to test it!
init start
local ReopenBps = true
local IgnoreSS = false
local timessStart = "03:59" --- here you put the time of SS start (PC TIME)
local timessEnd = "04:15" --- here you put the time of SS end (PC TIME)
-- DO NOT EDIT BELOW --
local state, logout_callBacks = true, {
{
function()
return isontemple()
end,
function()
return messagebox('Reconnect Issue', 'Reconnect persistent was disabled because your character was inside a temple.\nTo enable script again just enter on it and click on OK.')
end
},
{
function()
return ($self.skull == SKULL_RED or $self.skull == SKULL_BLACK) and $pzone
end,
function()
return messagebox('Reconnect Issue', 'Reconnect persistent was disabled because your character have gained a red/black skull.\nTo enable script again just enter on it and click on OK.')
end
}
}
if $curscript.type == 'cavebot' then
messagebox("Reconnect Issue", "Reconnect should be placed at Scripter/Persistents and not Cavebot/Scripter.\nChange this setting to run it properly.")
state = false
end
init end
auto(1000, 2000)
if (not IgnoreSS) and (currenttime() > timessStart and currenttime() < timessEnd) then
return
end
if not $connected and state then
local ts = $timems
setsetting('Targeting/Enabled', 'no')
setsetting('Cavebot/Enabled', 'no')
pausewalking(10000)
while not $connected do
keyevent(0x1B)
reconnect()
waitping()
end
if not $connected then
return
else
for _, xlogf in ipairs(logout_callBacks) do
if xlogf[1]() then
state = false
logout()
return xlogf[2]()
end
end
if ReopenBps then
local min = $minimized
if min then
restoreclient() waitping()
end
reopenwindows('small')
local waittime = {1, 1}
while $openingbps do
waitping(1 + waittime[1], 1.2 + waittime[2])
waittime[1], waittime[2] = waittime[1] + 1, waittime[2] + 1
if $timems - ts >= 10000 or maround(5) > 0 then
pausewalking(5000)
setsetting('Targeting/Enabled', 'yes')
setsetting('Cavebot/Enabled', 'yes')
end
end
if min and not $minimized then
minimizeclient()
end
end
setsetting('Targeting/Enabled', 'yes')
setsetting('Cavebot/Enabled', 'yes')
pausewalking(0)
end
end
i used like i put and it works xd if in the future it buged i will change it. ... for the people who says that the reconnect doesnt work with multiple account they can just put 2 min more in each "timessEnd" so the first account go conect the second account going to connect in 2 min more the 3° account goinf to connect in 4 min more etc etc! :D
leonardo eu coloquei e nao quer abrir as bps e nen reconecta :( poderia me dizer como faço pra ele funcionar? agradeço desde já xD
Instead of comparing for example "14:00" < "15:00" (which doesn't work, because they're strings), use tosec() to convert the time into a seconds number variation of the time given.
tosec("14:00") => 14 * 60 which is smaller than 15 * 60 ("15:00"), resulting in true.
"14:00" < "15:00" would always return false I guess, because that would compare string length and not their real time. It's the same as comparing 4 < 4.
sstime() works exactly as this, it converts your current time and the server save time, deduct and return the converted time in seconds.