Log in

View Full Version : refillMana script



sholh
01-16-2016, 11:01 AM
i wanna script or fnuction that refill mana to almost full or the percent what i want like 70 % after killing the monster or when he killing them fast refill and use mana too when he run to next wp
Can u help Rif
eldera

eldera
01-16-2016, 11:24 AM
Haven't tested it but should work.

local manaPotion = "mana potion" -- name or id of mana potion
local upToMana = 70 -- percentagle amount
local waitUntilManaIsNotRefiled = true -- if you want to wait when refilling mana (if you are ek use it)
local monstersToRefilmana = 2 -- amount of monster to start mana refiller

--[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--

function monstersInRange()
local count = 0
for name, obj in Creature.iMonsters() do
count = count + 1
end
return count
end

Module.New("mana-refiller", function()
if (monstersInRange() <= monstersToRefilmana and math.abs(Self.Mana()/(Self.MaxMana()*0.01)) < upToMana) then
Self.UseItemWithMe(Item.GetItemIDFromDualInput(man aPotion))
if (waitUntilManaIsNotRefiled) then
Walker.Delay(500)
end
end
end)

sholh
01-16-2016, 06:52 PM
Thx eldera