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
Close backpack and reopen
#1
Not sure how hard or easy it is (but i assume easy considering the bot already does it)
im chasing an action script that closes all backpacks then reopens main backpack and backpacks visible in main backpack. 

Thaanks
Reply

#2
Hello.

Reopening backpacks is easy, you only need to use two functions: closewindow() and openitem(), but that depends on your backpack organization.

closewindow(string windowname) [void]: Close a specific container window.
closewindows() [void]: Close all open containers windows.
openitem(string/number item, string location, bool newWindow, number Index) [void]: Open an item located inside your containers, inventory or ground, depends of your location choice.
|Only Registered members can see download links. | Click here to buy subscription or here to register.


Try this code:
closewindows()
wait(500, 800)

local bp_item = back()
if bp_item.id > 0 then
    local WIN_COUNT = windowcount()
    while WIN_COUNT == 0 and bp_item.id > 0 do
        openitem(bp_item.id, 'back')
        wait(1000, 1500)
        bp_item = back()
        WIN_COUNT = windowcount()
    end

    if WIN_COUNT > 0 then
        resizewindows(1)
        wait(200, 500)

        local containers = getcontainers()
        for _, cont in ipairs(containers) do
            for __, item in ipairs(cont.items) do
                if itemhasflags(item.id, 4) then
                    for i = 1, 3 do
                        if windowcount() == WIN_COUNT then
                            openitemslot(item.index, cont.index, true)
                            wait(500, 1000)
                            resizewindows(1)
                            resizewindows(1)
                            wait(200, 500)

                        else
                            break
                        end
                    end
                    WIN_COUNT = windowcount()
                end
            end
        end
    end
end
Reply

#3
fyi, this backpack reopen function doesnt work as a persistant
14:00:26 - Core:Lua:ExecuteScript
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Big Grin" title="Big Grin" class="smilie smilie_4" />oString:BP Open: 23: 'then' expected near 'do'
Reply

#4
I just fixed it.
Reply

#5
thanks, not sure what you fixed. it kept closing and opening backpacks and ignoring everything inside the backpack :S
Reply

#6
Hello.

I just fixed a small type error and it works just fine.
Notice this script will close all your bps and then open main bp and all containers (parcels, bags, bps, etc.) inside the main bp.
So if you use it on Persistents, it will just keep closing and opening everything.

If you wanna use on Persistents to just reopen bps if all bps are closed then use this code.
if windowcount() == 0 then
    local bp_item = back()
    if bp_item.id > 0 then
        local WIN_COUNT = windowcount()
        while WIN_COUNT == 0 and bp_item.id > 0 do
            openitem(bp_item.id, 'back')
            wait(1000, 1500)
            bp_item = back()
            WIN_COUNT = windowcount()
        end

        if WIN_COUNT > 0 then
            resizewindows(1)
            wait(200, 500)

            local containers = getcontainers()
            for _, cont in ipairs(containers) do
                for __, item in ipairs(cont.items) do
                    if itemhasflags(item.id, 4) then
                        for i = 1, 3 do
                            if windowcount() == WIN_COUNT then
                                openitemslot(item.index, cont.index, true)
                                wait(500, 1000)
                                resizewindows(1)
                                resizewindows(1)
                                wait(200, 500)

                            else
                                break
                            end
                        end
                        WIN_COUNT = windowcount()
                    end
                end
            end
        end
    end
end
Reply

#7
Hey  mate, thanks for all your help.
I have been playing with the BP reopen script but cant get the last piece of the puzzle working. Any chance you can give us some advice?
I have edited your above, to if bps less than 4 then disable cavebot, disable looting, open backpacks then enable cavebot and enable looting. 

So far it does everything except re enable caveboot and looting. 


EDIT: i figured out why the settings weren't getting re enabled and fixed that, Can you explain why it is re enabling them after opening 3 backpacks not 4? it makes the last backpack a bit confusing for the bot as its looting monsters at the same time.

Thanks




if windowcount() < 4 then
setsettings('Looter/Enabled', status == false)
setsettings('Cavebot/Enabled', status == false)
closewindows()
wait(500, 800)
    local bp_item = back()
    if bp_item.id > 0 then
        local WIN_COUNT = windowcount()
        while WIN_COUNT == 0 and bp_item.id > 0 do
            openitem(bp_item.id, 'back')
            wait(1000, 1500)
            bp_item = back()
            WIN_COUNT = windowcount()
        end

        if WIN_COUNT > 0 then
            resizewindows(1)
            wait(200, 500)

            local containers = getcontainers()
            for _, cont in ipairs(containers) do
                for __, item in ipairs(cont.items) do
                    if itemhasflags(item.id, 4) then
                        for i = 1, 3 do
                            if windowcount() == WIN_COUNT then
                                openitemslot(item.index, cont.index, true)
                                wait(500, 1000)
                                resizewindows(1)
                                resizewindows(1)
                                wait(200, 500)
setsettings('Looter/Enabled', status == true)
setsettings('Cavebot/Enabled', status == true)

                            else
                                break
                            end
                        end
                        WIN_COUNT = windowcount()
                    end
                end
            end
        end
    end
end


Cancel that, i moved it further down the script and fixed the issue
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Big Grin" title="Big Grin" class="smilie smilie_4" />

thanks
Reply

#8
Hello.

For further references, you are calling setsettings() using "status" variable, but it doesn't exists.
So this is your code fixed.
if windowcount() < 4 then
    setsettings('Looter/Enabled', false)
    setsettings('Cavebot/Enabled', false)
    closewindows()
    wait(500, 800)
    local bp_item = back()
    if bp_item.id > 0 then
        local WIN_COUNT = windowcount()
        while WIN_COUNT == 0 and bp_item.id > 0 do
            openitem(bp_item.id, 'back')
            wait(1000, 1500)
            bp_item = back()
            WIN_COUNT = windowcount()
        end

        if WIN_COUNT > 0 then
            resizewindows(1)
            wait(200, 500)

            local containers = getcontainers()
            for _, cont in ipairs(containers) do
                for __, item in ipairs(cont.items) do
                    if itemhasflags(item.id, 4) then
                        for i = 1, 3 do
                            if windowcount() == WIN_COUNT then
                                openitemslot(item.index, cont.index, true)
                                wait(500, 1000)
                                resizewindows(1)
                                resizewindows(1)
                                wait(200, 500)
                            else
                                break
                            end
                        end
                        WIN_COUNT = windowcount()
                    end
                end
            end
            setsettings('Looter/Enabled', true)
            setsettings('Cavebot/Enabled', true)
        end
    end
end
Reply

#9
That’s how I fixed it not working, but it works with the turning it off.

Because I’m difficult, and I died, because the bot ran for too long and I ran out of supplies, I’m wondering how I would go about a check of my rune bp to check if their is either another bp or 5+ Runes. If no backpack or less than 5 runes go to wpt leave hunt.
I can do the rune bit easy enough, but adding the check just to my bp to check if there is another green bp is hard
Reply

#10
Hello.

I didn’t understood what you said. The code you posted doesn’t disables Targeting.

This script works almost as you need, excerpt it will open next bp and also will play sound instead leaving hunt.
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016