Hi,
So I've modified a loot macro and added it as a sub in one of my main macros. The weird thing is I haven't modified anything in weeks but now it is no longer working. My assumption is something in the compile or an eq update broke it. Anyone have any recommendations on how to debug this?
Error I get is when I'm attempting to loot a no drop item:
Invalid item slot 'loot1'
Invalid item slot 'loot2' etc etc
If anyone has any thoughts I'd appreciate it.
Thanks,
So I've modified a loot macro and added it as a sub in one of my main macros. The weird thing is I haven't modified anything in weeks but now it is no longer working. My assumption is something in the compile or an eq update broke it. Anyone have any recommendations on how to debug this?
Code:
|LootUp.Mac
|V.2.0
#Event ALCantLoot "#*#may not loot this corpse#*#"
#Event ALCantLoot "#*#You may not loot that item from this corpse#*#"
#Event LoreItem "#*#You cannot loot this Lore Item. You already have one.#*#"
Sub BLootUp
/if (!${Plugin[MQ2Exchange].Name.Equal[mq2exchange]}) /squelch /plugin MQ2Exchange
/if (!${Plugin[MQ2Moveutils].Name.Equal[mq2moveutils]}) /squelch /plugin MQ2Moveutils
/if (${Defined[Param0]}) {
/varset LootNoDrop ${Param0}
/echo Loot No Drop = ${LootNoDrop}
}
:combat
/if (${Me.CombatState.Equal[COMBAT]}) /return
:Main_Loop
/if (${SpawnCount[corpse radius 70 los noalert 25]}<1) {
/keypress close_inv_bags
/return
}
/call TargetCorpse
/call LootUp
/goto :Main_Loop
/return
Sub ALLoadVar(IniSection,IniVar,IniValue,VarType)
/if (!${Defined[${IniVar}]} && ${Defined[VarType]}) /declare ${IniVar} ${VarType} outer
/declare IniString string local ${Ini[BLoot.ini,${IniSection},${IniVar},NOTFOUND]}
/varset ${IniVar} ${IniString}
/if (${IniString.Equal["NOTFOUND"]}) {
/if (${IniString.Equal["NOTFOUND"]}) /varset ${IniVar} ${IniValue}
/ini "BLoot.ini" "${IniSection}" "${IniVar}" "${${IniVar}}"
}
/return
Sub TargetCorpse
/if (${Me.Sitting}) /stand
:Target
/if (${SpawnCount[corpse radius 70 noalert 25]} && ${Zone.ID}==${StartZone}) {
/target corpse radius 70 noalert 25
/delay 1s ${Target.ID}
/if (!${Target.LineOfSight}) {
/squelch /alert add 25 id ${Target.ID}
/squelch /target clear
/goto :Target
}
/call TargetDiety
/if (${Target.ID} && !${Target.Deity.ID} && ${Target.Type.Equal[Corpse]}) /return
/goto :Target
}
/return
Sub TargetDiety
/if (${Target.Deity.ID}) {
/if (${Target.ID} && ${Target.Deity.ID} && ${Target.Type.Equal[Corpse]}) /alert add 25 id ${Target.ID}
/squelch /target clear
/delay 1s !${Target.ID}
}
/return
Sub LootUp
/if (${Target.ID} && !${Target.Deity.ID} && ${Target.Type.Equal[Corpse]}) {
/moveto id
/delay 10s ${Target.Distance}<15
/loot
/delay 3s ${Window[LootWnd].Open}
/delay 15
/varset loots ${Corpse.Items}
/varset slot 1
/echo Loot found in ${loots} slots
:nextloot
/echo Slot #${slot}: ${Corpse.Item[${slot}].Name}
/if (${Corpse.Item[${slot}].Name.Equal[Essence of Will]}) {
/nomodkey /shift /itemnotify loot${slot} leftmouseup
/delay 2s ${Cursor.ID}
/destroy
/delay 1s
/doevents
/varcalc slot ${slot}+1
/if (${slot}<=${loots}) /goto :nextloot
/goto :clickdone
}
/if (!${Me.FreeInventory}) {
/nomodkey /notify LootWnd DoneButton leftmouseup
|/bcaa OUT OF INVENTORY SPACE
/nomodkey /notify LootWnd DoneButton leftmouseup
/return
}
/if (${Corpse.Item[${slot}].NoDrop} && !${LootNoDrop}) {
/echo No Drop item found!
/squelch /alert add 25 id ${Target.ID}
/delay 3s
/g ${LinkDB[=${Corpse.Item[${slot}].Name}]}
/delay 1s
/varcalc slot ${slot}+1
/if (${slot}<=${loots}) /goto :nextloot
} else {
/nomodkey /shift /itemnotify loot${slot} rightmouseup
/delay 1s
/doevents
/varcalc slot ${slot}+1
/if (${slot}<=${loots}) /goto :nextloot
}
:clickdone
/if (${Corpse.Open}) {
/nomodkey /notify LootWnd DoneButton leftmouseup
/delay 5s !${Corpse.Open}
/goto :clickdone
}
/call KeepOrDestroy
}
/return
Sub KeepOrDestroy
/for bag 1 to 8
/for slot 1 to ${InvSlot[pack${bag}].Item.Container}
/if (${InvSlot[pack${bag}].Item.Item[${slot}].ID} && !${Select[${Ini[BLoot.ini,"${InvSlot[pack${bag}].Item.Item[${slot}].Name.Left[1]}","${InvSlot[pack${bag}].Item.Item[${slot}]}"]},Ignore,Keep,Destroy,Lore]}) {
/if (${InvSlot[pack${bag}].Item.Item[${slot}].NoDrop}) /ini "BLoot.ini" "${InvSlot[pack${bag}].Item.Item[${slot}].Name.Left[1]}" "${InvSlot[pack${bag}].Item.Item[${slot}]}" Ignore
/if (!${InvSlot[pack${bag}].Item.Item[${slot}].NoDrop}) /ini "BLoot.ini" "${InvSlot[pack${bag}].Item.Item[${slot}].Name.Left[1]}" "${InvSlot[pack${bag}].Item.Item[${slot}]}" Keep
}
/if (${Ini[BLoot.ini,"${InvSlot[pack${bag}].Item.Item[${slot}].Name.Left[1]}","${InvSlot[pack${bag}].Item.Item[${slot}]}"].Equal[Destroy]}) {
/varset CurrentItemID ${InvSlot[pack${bag}].Item.Item[${slot}].ID}
/keypress open_inv_bags
/delay 5
/echo Destroying ${InvSlot[pack${bag}].Item.Item[${slot}]} from Bag pack${bag} slot ${slot}
/shift /itemnotify in pack${bag} ${slot} leftmouseup
/delay 3s (${Cursor.ID}==${CurrentItemID})
/if (${Cursor.ID}==${CurrentItemID}) /destroy
/delay 2s !${Cursor.ID}
}
/next slot
/next bag
/keypress close_inv_bags
/return
|| ========================== Events ==============================
Sub Event_ALCantLoot
/squelch /alert add 25 id ${Target.ID}
/return
Sub Event_LoreItem
/bcaa **LORE ITEM** ${Corpse.Item[${slot}].Name}
/squelch /alert add 25 id ${Target.ID}
/return
Error I get is when I'm attempting to loot a no drop item:
Invalid item slot 'loot1'
Invalid item slot 'loot2' etc etc
If anyone has any thoughts I'd appreciate it.
Thanks,