PDA

View Full Version : Need help opening backpacks



Zashalio
11-21-2015, 03:25 AM
Im using this script to train my magic level, it's currently using mana potions from backpacks on the ground however when their is no mana potions left in the backpack it will not open the next backpack to continue, is it possible to fix?

local manatype = "mana potion" -- name of potion
local manapercent = 90 -- mana percent to stop using potions
local listspells = -- list of spells to cast
{
"exura gran",
"utani gran hur",
}

--[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--
function ManaPercent()
return math.abs(Self.Mana() * 100 / Self.MaxMana())
end
local manaid = Item.GetID(manatype)
Module('ManaFromContainers', function(mod)
if ManaPercent() < manapercent then
for indexContainer=0, #Container.GetAll()-1 do
local container = Container.New(indexContainer)
for spot=0, container:ItemCount()-1 do
if container:GetItemData(spot).id == manaid then
container:UseItemWithCreature(spot, Self.ID())
end
end
end
end
mod:Delay(600)
end)

Module("BurnMana", function(mod)
for _, spell in ipairs(listspells) do
Self.Cast(spell)
end
mod:Delay(200)
end)

smitty131
03-03-2017, 12:59 PM
This keeps saying you cant use the object that fast :(