Cast spell every X seconds and Pause Bot if you lost mana NOT DUE SPELL.
This script will check if you have enough mana every X seconds, which is based on "DELAY" range that will be a sorted value between that range you setup.
The default settings below will check if you have enough mana ("MANA_TO_CAST") every 10-25 seconds (this is random) to cast "exura".
If takes like 15 seconds to heal enough mana to cast the spell you want then setup those values like Min 15, max 18.
It also checks if you lost mana NOT DUE SPELL to pause bot.
This will cast spell only after X time, but if you don't have enough mana after X time, it will cast as soon you reach it.
This script will check if you have enough mana every X seconds, which is based on "DELAY" range that will be a sorted value between that range you setup.
The default settings below will check if you have enough mana ("MANA_TO_CAST") every 10-25 seconds (this is random) to cast "exura".
If takes like 15 seconds to heal enough mana to cast the spell you want then setup those values like Min 15, max 18.
It also checks if you lost mana NOT DUE SPELL to pause bot.
local SPELL = 'exura'
local SPELL_MANA = 25 -- Required mp to cast spell.
local MANA_TO_CAST = 34 -- Cast spell only if mp is higher or equal than this value.
local DELAY = { Min = 10, Max = 25 } -- In seconds. How often check for mana and cast spell? If takes 10 seconds to heal enough mana then you can setup values like Min = 10, Max = 12.
local MANA_LOSS = 1 -- If mana LOSS is higher than this value then pause. This is ignored when casting spell above.
LAST_MANA = LAST_MANA or mp()
NEXT_SPELL = NEXT_SPELL or runningtime()
if connected() then
if runningtime() >= NEXT_SPELL and cancast() then
if mp() >= MANA_TO_CAST then
cast(SPELL)
wait(300, 500)
end
LAST_MANA = mp()
NEXT_SPELL = runningtime() + random(DELAY.Min, DELAY.Max)
return
end
if (LAST_MANA - mp()) > MANA_LOSS then
playsound('default')
flashclient()
pausebot(true)
end
LAST_MANA = mp()
else
LAST_MANA = nil
end
This will cast spell only after X time, but if you don't have enough mana after X time, it will cast as soon you reach it.
local SPELL = 'exura'
local SPELL_MANA = 25 -- Required mp to cast spell.
local MANA_TO_CAST = 34 -- Cast spell only if mp is higher or equal than this value.
local DELAY = { Min = 10, Max = 25 } -- In seconds. How often check for mana and cast spell? If takes 10 seconds to heal enough mana then you can setup values like Min = 10, Max = 12.
local MANA_LOSS = 1 -- If mana LOSS is higher than this value then pause. This is ignored when casting spell above.
LAST_MANA = LAST_MANA or mp()
NEXT_SPELL = NEXT_SPELL or runningtime()
if connected() then
if runningtime() >= NEXT_SPELL and cancast() and mp() >= MANA_TO_CAST then
cast(SPELL)
wait(300, 500)
LAST_MANA = mp()
NEXT_SPELL = runningtime() + random(DELAY.Min, DELAY.Max)
return
end
if (LAST_MANA - mp()) > MANA_LOSS then
playsound('default')
flashclient()
pausebot(true)
end
LAST_MANA = mp()
else
LAST_MANA = nil
end