Log in

View Full Version : Equip soft boots



Trocaderokungen
04-05-2016, 09:45 PM
I need a simple lua script to equip soft boots under a certain percent of mana please.

Oscagi
04-05-2016, 10:22 PM
I need a simple lua script to equip soft boots under a certain percent of mana please.



ManaToUp = 70 -- If mana is lower than 70% use soft.
NormalBoots = "Boots Of Haste" -- Normal Boots.


Self.ManaPercent = function ()
return math.abs(Self.Mana() / (Self.MaxMana() * 0.01))
end

Module.New('equip softs', function(module)
if (Self.ManaPercent() <= ManaToUp) and (Self.Feet().id ~= 3549) and (Self.ItemCount(6529) > 0 and Self.isInPz() == false) then
Self.Equip(6529, "feet")
module:Delay(1000)
elseif (Self.ManaPercent() >= ManaToUp) or (Self.Feet().id == 6530) and (Self.Feet().id ~= Item.GetID(NormalBoots)) then
Self.Equip(Item.GetID(NormalBoots), "feet")
module:Delay(1000)
end
if Self.isInPz() then
Self.Equip(Item.GetID(NormalBoots), "feet")
end
end)


:>

Trocaderokungen
04-06-2016, 12:37 AM
Thanks a lot

maikel123
08-19-2016, 09:14 PM
-- ITEMS PREDETERMINADOS

local bp = 'Jewelled Backpack' -- BACKPACK DE SMALL ENCHANTED RUBY Y FIREWALKER BOOTS
local OtherBootID = 10323 -- BOOTS QUE SUSTITUYEN LAS FIREWALKER BOOTS
local notusedFirewalkerbootsID = 9019 -- BRAND NEW FIREWALKER BOOTS
local WornfirewalkerbootsID = 9020 -- WORN FIREWALKER BOOTS
local usedFirewalkerbootsID = 9018 -- FIREWALKER BOOTS

-- CONFIGURANDO ITEMS

CONFIG = {

PRIMARY = 676,

SECONDARY = {9020}

}


-- PROCESO FIREWALKER BOOTS A LA BP PRINCIPAL

while(true) do

c = Container.GetByName(bp)
if(Self.Feet().id ~= 9019 and Self.Feet().id == 9020) then
for spot = 0, c:ItemCount()-1 do
if c:GetItemData(spot).id == 676 then
Self.Dequip("feet", c)

-- PROCESO DE ENCANTAMIENTO

local PRIMARY, SECONDARY, SPOTS = nil, nil, {}

for i = 0, 15 do

local cont = Container.New(i)

if not table.contains({"worn firewalker boots", "small enchanted ruby"}, string.match(cont:Name(), "%a+")) then

for SPOT = cont:ItemCount() - 1, 0, -1 do

local tmp = cont:GetItemData(SPOT)

if (tmp.id == CONFIG.PRIMARY) then

PRIMARY = cont

SPOTS[1] = SPOT

elseif (table.contains(CONFIG.SECONDARY, tmp.id)) then

SECONDARY = cont

SPOTS[2] = SPOT

end

end

end

end


if (PRIMARY ~= nil and SECONDARY ~= nil) then

PRIMARY:UseItemWithContainerItem(SPOTS[1], SECONDARY:Index(), SPOTS[2])

end

end
end
end

-- EQUIPAR FIREWALKER BOOTS

if (Self.isInPz() == false) then

Self.Equip(notusedFirewalkerbootsID, "feet")
end

if (Self.isInPz() == true) then

Self.Equip(OtherBootID, "feet")
end
-- FIN DEL PROCESO

end