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
Pickup ammo from backpack on ground
#1
Hello! i have searched the forum for this action but I cant find so I ask here instead.

I would like to have a action that picks up bolts from a backpack thats on the ground.

and when it picks it up it will do it untill I reach a certain cap. for example I want to pick up X amounts of bolts so that my cap is 100 exactly when it has picked them up.

is there any chance someone can create this action?
|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="Smile" title="Smile" class="smilie smilie_1" />
Reply

#2
Hello.

I didn't tested it very hard, but it seems to work.
|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="Smile" title="Smile" class="smilie smilie_1" />

local AMMO = 'bolt' -- Ammo NAME or ID
local AMMO_OZ = 0.8 -- Ammo unit weight.
local AMMO_MAX_AMOUNT = 10 -- Max. amount that you wanna carry.
local AMMO_LOCATION_GROUND = { X = 32906, Y = 32074, Z = 10 } -- Ammo's location on FLOOR.
local AMMO_CONTAINER = 'red backpack' -- Container that AMMO will be moved to.


local pickup_count = math.max(0, (AMMO_MAX_AMOUNT - itemcount(AMMO, AMMO_CONTAINER)))
if pickup_count > 0 then
    
    local max_bolts_capacity = math.floor(cap() / AMMO_OZ)
    if pickup_count > max_bolts_capacity then
        pickup_count = max_bolts_capacity
    end

    local AMMO_ID = itemid(AMMO)

    while pickup_count > 0 do

        local item_tile = topitem(AMMO_LOCATION_GROUND.X, AMMO_LOCATION_GROUND.Y, AMMO_LOCATION_GROUND.Z, false)
        if item_tile.id == AMMO_ID then
            if pickup_count >= item_tile.count then
                pickup_count = 100
            end

            if moveitems(AMMO_ID, AMMO_CONTAINER, ground(AMMO_LOCATION_GROUND.X, AMMO_LOCATION_GROUND.Y, AMMO_LOCATION_GROUND.Z), pickup_count) then
                wait(1000)
                pickup_count = math.min(0, (AMMO_MAX_AMOUNT - itemcount(AMMO, AMMO_CONTAINER)))
                max_bolts_capacity = math.floor(cap() / AMMO_OZ)
                if pickup_count > max_bolts_capacity then
                    pickup_count = max_bolts_capacity
                end
            else
                break
            end
        else
            break
        end
    end
end
Reply

#3
Hello! I have tested this and its a very good script but unfortunately its not what I need
|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="Sad" title="Sad" class="smilie smilie_8" />
I will explain below the reasons why =

1. it only picks up bolts from the ground (not from a backpack on the ground). this means I have to throw all the bolts manually everytime there before im gonna start the bot. if it would open a backpack where all the bolts are, it would save me aloot of time cuz all I have to do is to put a backpack on the ground right?

2. the bot doesnt pick up the bolts according to your cap. this means I have to make a guess on how much bolts it should pick up in the action settings. and sometimes you waste less bolts per round and sometimes you waste more bolts per round. this means when i pick up the bolts on that script. it doesnt get correct. also I would have to change the bolts pickup number everytime I reach a new level cuz i get more cap per every new level right? what I would need is the bot to pickup bolts that does so according to your cap. for example when i pick up all the bolts I want to set it so that I got EXACTLY 100 cap left AFTER I picked up all the bolts and then it continues to hunt

so, what im saying is that if you could somehow just quickly change it to so that the bolts are picked up from a backpack thats on the ground AND that the bot picks up bolts according to your cap, THAT WOULD BE GREAT!!!!!!!!!!!!!!!!!!!!!
|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="Smile" title="Smile" class="smilie smilie_1" />
Reply

#4
Hello.

I'm sorry, i didn't read your post correctly and missed "backpack thats on the ground" instead i read "from the ground".

1. I don't see why you must throw manually, you can easily make a script to throw bolts on floor.
while itemcount('bolt') > 0 do
     moveitems('bolt', ground(posx(), posy(), posz()), '', 100)
     wait(300)
end
If you want to have more than 2.000 bolts on backpack on the floor, you will need to have more BPs inside this main backpack. It's not impossible, but kinda more complex, means that takes some time to test. Unfortunately, i'm out of time to make that way and test. However, i will post a script that will take from a container but it will not open more backpacks searching for more.
So I recommend you to pickup from the floor because there's no limit, so you can have 3.000, 5.000 or even 100.000 bolts on same sqm.

2. It does consider your character's capacity and fully uses it, so it will never pickup more than you can carry, that's why you must set the AMMO weight.
The script MAY NOT pick the same amount, there's specific max amount and script will count the current amount that you have and pickup the remaining.
If you had said on first post that you would always like have 100 cap, I would develop it that way.

Do not get me wrong, I do not want to be rude, but I do not like to waste time.
|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="Smile" title="Smile" class="smilie smilie_1" /> I'm doing this because I like to help, but please, always be direct and tell EVERYTHING what you want / need in the script, because not everything that looks easy is really easy or "quick". So if it's not really easy and fast, I might refuse to do it.

PICKUP FROM A CONTAINER ON FLOOR
local MINIMUM_CAP = 100 -- The minimum amount of capacity that you want to have.
local AMMO = 'bolt' -- Ammo NAME or ID
local AMMO_OZ = 0.8 -- Ammo unit weight.
local AMMO_MAX_AMOUNT = 10 -- Max. amount that you wanna carry.
local AMMO_GROUND_CONTAINER = 'bag' -- Ammo's container on FLOOR.
local AMMO_GROUND_LOCATION = { X = 12345, Y = 12345, Z = 7 } -- Ammo's location on FLOOR.
local AMMO_CONTAINER = 'red backpack' -- Container that AMMO will be moved to.

local pickup_count = math.max(0, (AMMO_MAX_AMOUNT - itemcount(AMMO, AMMO_CONTAINER, true)))
if pickup_count > 0 then
    
    local max_capacity = math.floor((cap() - MINIMUM_CAP) / AMMO_OZ)
    if pickup_count > max_capacity then
        pickup_count = max_capacity
    end
    if pickup_count > 100 then
        pickup_count = 100
    end

    if pickup_count > 0 then
        local AMMO_ID = itemid(AMMO)
        for i = 1, 3 do
            local WINDOW_CONTAINER_BEFORE = windowcount(AMMO_GROUND_CONTAINER)
            openitem(AMMO_GROUND_CONTAINER, ground(AMMO_GROUND_LOCATION.X, AMMO_GROUND_LOCATION.Y, AMMO_GROUND_LOCATION.Z))
            wait(1000)
            local WINDOW_CONTAINER_AFTER = windowcount(AMMO_GROUND_CONTAINER)

            if WINDOW_CONTAINER_AFTER > WINDOW_CONTAINER_BEFORE then
                while pickup_count > 0 and itemcount(AMMO, AMMO_GROUND_CONTAINER) > 0 do
                    if moveitems(AMMO_ID, AMMO_CONTAINER, AMMO_GROUND_CONTAINER, pickup_count) then
                        wait(1000)
                        pickup_count = math.max(0, (AMMO_MAX_AMOUNT - itemcount(AMMO, AMMO_CONTAINER, true)))
                        max_capacity = math.floor((cap() - MINIMUM_CAP) / AMMO_OZ)
                        if pickup_count > max_capacity then
                            pickup_count = max_capacity
                        end
                        if pickup_count > 100 then
                            pickup_count = 100
                        end
                    else
                        break
                    end
                end
                break
            end
        end
    end
end

PICKUP FROM FLOOR
local MINIMUM_CAP = 100 -- The minimum amount of capacity that you want to have.
local AMMO = 'bolt' -- Ammo NAME or ID
local AMMO_OZ = 0.8 -- Ammo unit weight.
local AMMO_MAX_AMOUNT = 10 -- Max. amount that you wanna carry.
local AMMO_GROUND_LOCATION = { X = 12345, Y = 12345, Z = 7 } -- Ammo's location on FLOOR.
local AMMO_CONTAINER = 'red backpack' -- Container that AMMO will be moved to.

local pickup_count = math.max(0, (AMMO_MAX_AMOUNT - itemcount(AMMO, AMMO_CONTAINER, true)))
if pickup_count > 0 then
    
    local max_capacity = math.floor((cap() - MINIMUM_CAP) / AMMO_OZ)
    if pickup_count > max_capacity then
        pickup_count = max_capacity
    end
    if pickup_count > 100 then
        pickup_count = 100
    end

    if pickup_count > 0 then
        local AMMO_ID = itemid(AMMO)

        while pickup_count > 0 do
            local item_tile = topitem(AMMO_GROUND_LOCATION.X, AMMO_GROUND_LOCATION.Y, AMMO_GROUND_LOCATION.Z, false)
            if item_tile.id == AMMO_ID  then
                if pickup_count >= item_tile.count or pickup_count > 100 then
                    pickup_count = 100
                end

                if moveitems(AMMO_ID, AMMO_CONTAINER, ground(AMMO_GROUND_LOCATION.X, AMMO_GROUND_LOCATION.Y, AMMO_GROUND_LOCATION.Z), pickup_count) then
                    wait(1000)
                    pickup_count = math.max(0, (AMMO_MAX_AMOUNT - itemcount(AMMO, AMMO_CONTAINER, true)))
                    max_capacity = math.floor((cap() - MINIMUM_CAP) / AMMO_OZ)
                    if pickup_count > max_capacity then
                        pickup_count = max_capacity
                    end
                    if pickup_count > 100 then
                        pickup_count = 100
                    end
                else
                    break
                end
            else
                break
            end
        end
    end
end
Reply

#5
dude, thank you so much! this script is exactly what I want
|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" /> good job

next time I won't waste your time
|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="Smile" title="Smile" class="smilie smilie_1" />
Reply

#6
i want to use this script but i dont get it to work..
where do i copy this to? i tried action at cave bot.
i tried persistens and lua section in cave bot..

please help
Reply

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

Hello.

The script works, but you need to change the variables on it.
I can't be sure, but I just sent a private message with a link to a BETA version. So maybe it's a bug that already been fixed on this beta version.

That depends on you and your needs. Sometimes a script may be used on Cavebot for a specific reason and others on Persistents.

Persistents: Runs a LUA script from time to time.
Hotkeys->Lua Script: Runs a lua script when press a specific hotkey.
Cavebot->Action: Runs a lua script when the cavebot runs the waypoint.
Reply

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

Hello admin.
Do you have some time now to add to the script the ability to open next backpack if first backpack with ammo is empty?? It is very important for us because only 5000 objects can be placed on the ground and this is not enough for us. I tried to modify this script myself but unfortunately I couldn't do it
Reply

#9
Hey, did someone figure out a way for the script to open next bp if first bp is empty of ammo?
Thanks!
Reply

#10
can make it for pickup spears ? on nostalriusbot, cuz tools pickup spear wont work.
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016