local MANA_GAIN = 2
if connected() then
LAST_MANA = LAST_MANA or mp()
local current_mana = mp()
if (current_mana - LAST_MANA) > MANA_GAIN then
playsound('default')
flashclient()
printerror('Mana gain')
pausebot(true)
end
LAST_MANA = current_mana
else
LAST_MANA = nil
endI use this script as a protection against the GM. But the script has an issue;
When I pause the bot the script remembers my mana at the moment the bot pauses, when I unpause the bot later with higher mana the script thinks my mana gain was higher than 2. The only way around it is to remove the persistent and add a new persistent. Apart from this, it works flawlessly. Maybe disable pause on bot pause?
Also, if I change everything to do the same thing but with health instead, would this work? Have not tested.
local HEALTH_GAIN = 10
if connected() then
LAST_HEALTH = LAST_HEALTH or hp()
local current_health = hp()
if (current_health - LAST_HEALTH) > HEALTH_GAIN then
playsound('default')
flashclient()
printerror('Health gain')
pausebot(true)
end
LAST_HEALTH = current_health
else
LAST_HEALTH = nil
end
