Pickup small stone, spear or so around your character
keywords: pick spear, pickup spear, pick small stone, pick stone, pickup small stone
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()
local enough = false
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, 500)
player_lhand = lhand()
if player_lhand.id == WEAPON_ID and player_lhand.count < MAX_COUNT then
COUNT = MAX_COUNT - player_lhand.count
else
enough = true
break
end
end
end
if enough then
break
end
end
end
end
end
keywords: pick spear, pickup spear, pick small stone, pick stone, pickup small stone