Hello.
You must check if the server sets a special condition (like battle sign, etc) when you cast it... It if does sets then you can use hasflag() function to check that.
Otherwise, you will need to check the last that you cast it to know if it's time to cast again.
How to find IF "utito tempo" sets a flag.
1. Go to a safe place, a place that your flags / conditions will not change (like battle sign will not show up by accident, etc.)
2. Make sure you not under utito tempo effect and run the following code on console. It will print "flags: XXX" where XXX may be a number, save up the result, you will use it later.
print(conditions()) -- it will print a number on console
3. Cast utito tempo and run the code above again. If it prints a different number then utito tempo sets a flag, the difference between those two numbers is the utito tempo flag. For example: If on first time it print 0 and now it prints 4096, utito tempo flag is 4096.
4. After finding it, you can use the script below:
local SPELL = 'utito tempo' -- Spellwords.
local MANA = 300 -- -- It will only cast it if your MANA is equal or higher than this value.
local FLAG = 4096-- Spell condition flag.
local SAFE_HPPC = 40 -- It will only cast it if your hp% is equal or higher than this value (in percent).
if not hasflag(conditions(), FLAG) and cancast() and mp() >= MANA and hppc() >= SAFE_HPPC then
cast(SPELL)
wait(300, 500)
end
But if you cannot find it then use the script below, it will cast 'utito tempo' every 120 seconds.
local SPELL = 'utito tempo' -- Spellwords.
local MANA = 300 -- -- It will only cast it if your MANA is equal or higher than this value.
local SPELL_DURATION = 120 -- In seconds, spell duration.
local SAFE_HPPC = 40 -- It will only cast it if your hp% is equal or higher than this value (in percent).
if LAST_CAST == nil then
LAST_CAST = 0
end
if runningtime() >= (LAST_CAST + SPELL_DURATION) and cancast() and mp() >= MANA and hppc() >= SAFE_HPPC then
cast(SPELL)
LAST_CAST = runningtime()
wait(300, 500)
end