I've seen that most of the paladin scripts and cavebots (that i''ve seen at least) don't cover the possibility of getting without ammo in fight, they always assume that you will reach a resupply point in time, but in my experience you could just get target after target. I took a really naive approach:
auto(1000)
if $rhand.count == 1 then
settargeting('off')
end
with this if you get 1 or no spear (can be used in ammo too) you will just run through the waypoints till you get a resupply point.