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