Cast spell every X seconds.
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.
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.
local SPELL = 'exura'
local MANA_TO_CAST = 25 -- Cast spell only if mp is higher or equal than this value.
local DELAY = { Min = 10, Max = 25 } -- In seconds. How often should it check for your mana and cast spell? If it takes between 10-12 seconds to heal enough mana then setup those values like Min 10, max 12.
if connected() (NEXT_SPELL == nil or runningtime() >= NEXT_SPELL) and cancast() and mp() >= MANA_TO_CAST then
cast(SPELL)
wait(300, 500)
NEXT_SPELL = runningtime() + random(DELAY.Min, DELAY.Max)
end