Simple Refiller
Description
A persistent action that will go to X waypoint in X section, if you are in X section with supplies low. *
Optional to Force Refill.
* I am fully aware that the mathematical statements in this description are horribly wrong and i'm sorry, just very noob friendly.
Configuration
Set FORCE_REFILL to true or false to leave the spawn/place immediatly or "hunt" your way back.
Code
init start
local Settings = {
FORCE_REFILL = true, -- True/false to leave immediatly or "hunt" your way back.
HP = "great health potion", -- Name of Health Potions
MP = "mana potion", -- Name of Mana Potions
MIN_HP = 10, -- Minimum amount of HEALTH POTIONS to leave.
MIN_MP = 10, -- Minimum amount of MANA POTIONS to leave.
MIN_CAP = 30, -- Minimum amount of CAP to leave.
HUNT_SECTION = "Spawn", -- Hunting Section...
LEAVE_WAYPOINT = "Back", -- Waypoint to go to when supplies are low...
LEAVE_SECTION = "Refill", -- In section...
TURNBACK_SECTION = "Town", -- Section to turn back all targeting settings (The one in depot is recommended).
}
Settings.HP_C = function() return itemcount(Settings.HP, "all") end -- Don't touch
Settings.MP_C = function() return itemcount(Settings.MP, "all") end -- Don't touch
init end
-->> Do not edit anything below!
--// Riku Scripts ~
auto(2000)
if (Settings.HP_C() < Settings.MIN_HP) or (Settings.MP_C() < Settings.MIN_MP) or ($cap < Settings.MIN_CAP) then
if (not Settings.FORCE_REFILL) and ($wptsection == Settings.HUNT_SECTION) then
gotolabel(Settings.LEAVE_WAYPOINT, Settings.LEAVE_SECTION)
elseif (Settings.FORCE_REFILL) and ($wptsection == Settings.HUNT_SECTION) then
foreach settingsentry e 'Targeting/Creatures' do
local Monster = getsetting(e, 'Name')
setsetting('Targeting/Creatures/'..Monster..'/Setting1/OnlyIfTrapped', 'yes')
end
gotolabel(Settings.LEAVE_WAYPOINT, Settings.LEAVE_SECTION)
end
end
if ($wptsection == Settings.TURNBACK_SECTION) then
foreach settingsentry b 'Targeting/Creatures' do
local Monsters = getsetting(b, 'Name')
setsetting('Targeting/Creatures/'..Monsters..'/Setting1/OnlyIfTrapped', 'no')
end
end
setsetting('Targeting/Creatures/All/Setting1/OnlyIfTrapped', 'yes')