Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Item dropping in avaliable container
#1
Hello, i was trying to make the "usefull scripts thread" ones work, but only managed to it so partially.

So heres my need: the character reaches X coordinate, proceeds to open x container and drop gold inside it, if the bp is full, he opens the next one.

Ive tried the one below, but he just opens the first bp, doesnt move items or try to open the next container:

|Only Registered members can see download links. | Click here to buy subscription or here to register.
Reply

#2
Hello.

The script on the link you posted works just fine. If the script is not moving items, so your BackpackLoot variable may have a bad value.

But i've changed it little bit. Try this code:
local ItemsDrop = { 'dwarven shield', 'battle shield', 'halberd', 'wooden shield' } -- Items that you wanna drop inside the container.
local BackpackLoot = 'Red Backpack' -- Backpack that you are carrying to keep loots, it will drop FROM this backpack.
local DropBagPosition = { X = 12345, Y = 54321, Z = 6 } -- Container's location that you wanna open and drop items inside.

--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ CREDITS TO ARKILYS --]]
--[[ DON'T EDIT BELOW THIS LINE --]]


if getOpenedContainer == nil then
    function getOpenedContainer(containersBefore, containersAfter)
        if containersAfter ~= nil and containersBefore ~= nil then
            for _, contAfter in ipairs(containersAfter) do
                local flag = false
                for __, contBefore in ipairs(containersBefore) do
                    if contAfter.index == contBefore.index then
                        flag = true
                        break
                    end
                end

                if not flag then
                    return contAfter
                end
            end
        end

        return nil
    end
end


local containersBefore = getcontainers()
local bagContainer = nil

for i = 0, 5 do
    openitem(0, ground(DropBagPosition.X, DropBagPosition.Y, DropBagPosition.Z), true)
    wait(1000, 1200)

    bagContainer = getOpenedContainer(containersBefore, getcontainers())
    if bagContainer ~= nil then
        break
    end
end

if bagContainer ~= nil then

    table.id(ItemsDrop)

    if tempOpenNextContainer == nil then
        function tempOpenNextContainer(bagContainer)
            if bagContainer ~= nil and bagContainer.maxslots > 0 then
                while bagContainer.maxslots == bagContainer.usedslots and bagContainer.maxslots > 0 do
                    local foundContainer = false
                    for _, bagItem in ipairs(bagContainer.items) do
                        if itemhasflags(bagItem.id, 4) then
                            foundContainer = true
                            openitem(bagItem.id, bagContainer.index)
                            wait(1200, 1500)
                            bagContainer = getcontainer(bagContainer.index)
                            break
                        end
                    end
                    if foundContainer == false then
                        break
                    end
                end
            end

            return bagContainer
        end
    end

    bagContainer = tempOpenNextContainer(bagContainer)
    if bagContainer ~= nil and bagContainer.maxslots ~= nil then
        emptyLeft = bagContainer.maxslots - bagContainer.usedslots
        if emptyLeft > 0 then
            for _, item in ipairs(ItemsDrop) do
                while itemcount(item, BackpackLoot) > 0 do
                    if emptyLeft == 0 then
                        bagContainer = tempOpenNextContainer(getcontainer(bagContainer.index))
                        if bagContainer ~= nil and bagContainer.maxslots ~= nil then
                            emptyLeft = bagContainer.maxslots - bagContainer.usedslots
                            if emptyLeft == 0 then
                                break
                            end
                        end
                    end
                    moveitems(item, bagContainer.index, BackpackLoot, 100)
                    wait(300)
                    emptyLeft = emptyLeft - 1
                end
            end
        end
    end
end
Reply

#3
|Only Registered members can see download links. | Click here to buy subscription or here to register.
 Ive tried and worked! but now he moves items to the backpack and just stops there... doenst resume cavebot
Reply

#4
I just found out why. Containers cant be the same like : Both Backpacks or Red Backpacks, etc
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016