Magebot

Full Version: Ammo refill script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys,
I'm trying to use the refil check box but it isn't working. I'm trying to adapt a script that has been posted here on the request by someone but it doesn't seems to work, I hope someone could help me out figuring out what's wrong.
Its suppose to check if the arrow slot is empty or under 50 and refill it with infernal bolts
Thank you
Quote:
Quote:
Quote:local CLOCK
local gptimer=os.clock()-.40
function infernalrefill()
    CLOCK=os.clock()
    local infernalid=6528
    local spearid=3277
    local ammo=self.ammo
    if (CLOCK-gptimer<100) then return; end
    gptimer=CLOCK
    if (ammo==0 or (ammo==infernalid and self.arrowct<50)) then
        local infernal=FindItem(infernalid)
        if (infernal~=nil) then
                ThrowItemCtoI(infernal.num,infernal.slot,SLOT_AMMO,infernalid,infernal.quantity)
                return        
        else
            local spear=FindItem(spearid)
            if (spear~=nil) then
                ThrowItemCtoI(spear.num,spear.slot,SLOT_HANDLEFT,spearid,spear.quantity)
            end
        end
    end
end
    
    
SetTimerCallback("infernalrefill")
Hello,

This should work

Quote:function infernalrefill()
local infernalID, spearID = 6528, 3277
local ammo = self.arrow
if (ammo==0 or (ammo==infernalID and self.arrowct<50)) then
local infernal=FindItem(infernalID)
if (infernal ~= nil) then
ThrowItemCtoI(infernal.num,infernal.slot,SLOT_AMMO,infernalID,infernal.quantity)
return
else
local spear=FindItem(spearID)
if (spear ~= nil) then
ThrowItemCtoI(spear.num,spear.slot,SLOT_HANDLEFT,spearID,spear.quantity)
end
end
end
end

SetTimerCallback("infernalrefill")