Thread Tools Display Modes
Prev Previous Post   Next Post Next
02/25/23, 08:24 PM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Question auto weapon recharge function help

Hey guys im adding my last feature to my addon auto weapon recharge but run into an issue and cant seem to get the "ChargeItemWithSoulGem" function to actually recharge the weaps but is executing past that line. Its likly a formatting issue as that my biggest headache otherwise everything else is working perfectly.

heres some of the code im working with atm and where i believe the problem lies:

Code:
function RidinDirty.Recharge()
    local weapons = {
        EQUIP_SLOT_MAIN_HAND,
        EQUIP_SLOT_OFF_HAND,
        EQUIP_SLOT_BACKUP_MAIN,
        EQUIP_SLOT_BACKUP_OFF
    }
    local minimumWeaponCharge = 95

	for index = 0, GetBagSize(BAG_BACKPACK) do
		local gemId = GetItemId(BAG_BACKPACK, index)
		if gemId == 33271 then
			gemIndex = index
		end
	end
	if gemIndex == nil then df("|c9900FF[RidinDirty]|r |ccc0000No Gems To Recharge Weapons|r") return end
	for _, weapon in ipairs(weapons) do
		local charge = GetChargeInfoForItem(BAG_WORN, weapon)
		if charge <= minimumWeaponCharge and IsItemChargeable then
			ChargeItemWithSoulGem(BAG_WORN, weapon, BAG_BACKPACK, gemIndex)--     <<<<< must be executing this line but doing nothing
			df("**** should be charging jus sayin but isnt =p")--     <<<<<< executing to here properly and as expected
		end
		local charged = GetChargeInfoForItem(BAG_WORN, weapon)
		if charged > charge then
			df("**** should have been charged jus sayin but isnt =p")
		end
	end
end
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » auto weapon recharge function help


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off