Hello.
First... Please, make sure you are posting on the correct section. You posted on Mastercores OTBot section instead of Classictibia Bot.
I already tried the Tools->Pickup~ myself and it worked fine, but here it goes.
1234 is not spear id, so you must adjust it.
local MIN_COUNT = 5
local POSITION = { X = 12345, Y = 12345, Z = 12345 }
local SPEAR_ID = 1234 -- Spear Id.
local player_lhand = lhand()
if player_lhand.id == 0 or (player_lhand.id == SPEAR_ID and player_lhand.count <= MIN_COUNT) then
moveitems(SPEAR_ID, 'lhand', ground(POSITION.X, POSITION.Y, POSITION.Z), 100)
wait(300)
end
or
local WEAPON_ID = 1234 -- Spear or small stone Id.
local MIN_COUNT = 1 -- Count to pickup more.
local MAX_COUNT = 10 -- Max count of items to keep on hand.
if connected() then
local player_lhand = lhand()
if player_lhand.id == 0 or (player_lhand.id == WEAPON_ID and player_lhand.count <= MIN_COUNT) then
local COUNT = MAX_COUNT - player_lhand.count
if COUNT > 0 then
local player_x = posx()
local player_y = posy()
local player_z = posz()
for x = -1, 1, 1 do
for y = -1, 1, 1 do
local tile = gettile(player_x + x, player_y + y, player_z)
if tile.itemcount > 1 and math.abs(tile.posx - player_x) <= 1 and math.abs(tile.posy - player_y) and tile.posz == player_z and tile.topitem.id == WEAPON_ID then
moveitems(WEAPON_ID, 'lhand', ground(tile.posx, tile.posy, tile.posz), COUNT)
wait(300)
break
end
end
end
end
end
end