PDA

View Full Version : Could someone fix this simple script?



goronyan
12-16-2015, 12:27 PM
So I'm using this script to loot gold only if my CAP is over certain value, the problem is that the script is not opening the next backpack when it becomes full.

Thanks.



local config = {
ItemContainer = "jewelled Backpack", --The backpack you will use
Item = {"Gold Coin"}, --The items you want to loot
ItemEnabled = true, --Enabld or disabled
}

while true do
for i = 0, #Container.GetIndexes() - 1 do
local c = Container.GetFromIndex(i)
if c:isOpen() and (c:Name():find("The") or c:Name():find("Demonic") or c:Name():find("Browse") or c:Name():find("Dead") or c:Name():find("Slain") or c:Name():find("Dissolved") or c:Name():find("Remains") or c:Name():find("Elemental")) then
for s = 0, c:ItemCount() - 1 do
local item = Item.GetName(c:GetItemData(s).id):titlecase()
if config.ItemEnabled and table.contains(config.Item, item) and Self.Cap() > 120 then --Here you can change the cap (Ej: "1000" it wont loot plater armor and gold if below 1000 Cap
local destCont = Container.GetByName(config.ItemContainer)
c:MoveItemToContainer(s, destCont:Index(), math.min(destCont:ItemCount() + 1, destCont:ItemCapacity() - 1))
wait(150, 180)
break
end
end
end
end
wait(50)
end

goronyan
12-19-2015, 02:18 PM
someone?