Try this macro. 3277 is ID of spear, but I'm not sure. If cap<=20 then bot should drop spear.
2000 {Drop Spear}
Misc.ItemCountEx(3277)>8
Self.Capacity<=20
X:=Self.X
Y:=Self.Y
Z:=Self.Z
Map.Thrown(3277, -1, !X!, !Y!, !Z!)
Or you can also equip spears from dead bodies:
1000 {Spear} Misc.ItemCountEx(3277)<8 Self.Equip.LeftHand(3277)
It won't equip more than 8 spears. Delete spear from looter.
2000 {Drop Spear}
Misc.ItemCountEx(3277)>8
Self.Capacity<=20
X:=Self.X
Y:=Self.Y
Z:=Self.Z
Map.Thrown(3277, -1, !X!, !Y!, !Z!)
Or you can also equip spears from dead bodies:
1000 {Spear} Misc.ItemCountEx(3277)<8 Self.Equip.LeftHand(3277)
It won't equip more than 8 spears. Delete spear from looter.