Loot Macro

Cage9d9

Member
Joined
Aug 26, 2008
Messages
210
Reaction score
5
Points
18
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?

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,
 
Seems this line is no longer liked:

/nomodkey /shift /itemnotify loot${slot} rightmouseup

Has the syntax for the loot box changed?
 
There's threads about this already, and on the main modbot thread on VIP forums.

Maybe mimic what ninjadvloot.inc does:

/nomodkey /shift /itemnotify ${Corpse.Item[${i}].InvSlot} rightmouseup
 
Yea I resolved that one, checked out the MacroQuest website forums and found details there. However it seems like more has changed because now the loot macro when it goes to delete can't find the correct item etc.

Is this a temporary thing or when this happens the macro has to be revamped?
 
Bleh resolved the other issue as well. itemnotify in pack was no longer valid so just replaced it with a different access of the item.
 
Can either of you help me out. I have attached the macro I'm using on my bard and the ninjadvloot.inc that is working in conjunction with it. I'm getting the same loot slot errors. What do I need to change on these?

Any help is appreciated.
 

Attachments

  • kissassist.mac
    121.1 KB · Views: 20
  • ninjadvloot.inc
    5.8 KB · Views: 25
Are you still having issues? I noticed the 4/4 update included fixes for the itemnotify (including lootX). Given that I imagine your issues have disappeared.

If not let me know and I'll take a look for you.

Thanks,
 
Perfect, enjoy!

Is the macro you posted in the original post the corrected macro, or the one needing to be fixed?

From what I gather this macro will loot all the corpses around you? I have always wondered if a macro like that existed, but haven't had much luck in finding something stand alone from larger macros.

Basically after HSing a shitload of mobs, it would be nice not to have to manually loot 70 bodies.
 
The original posted one was the one I had issues with. However the latest compile fixed it so nothing needed to be done.

Do a search for NinjaLoot or Lootup.mac in your Macro folder, those should do exactly what you want them to do :)

Cheers
 
I corrected it. I will try to remember to post on mq2 official to correct it when I can. Forkin work lately driving me crazy.

htw
 
subroutine main not found how to fix ?

I had the same problem when I tried to use Lootup.mac.

Really all I am looking for is, if I'm HSing on my ranger or swarming on my SK, once I'm done to be able to run a macro and have the toon loot all the corpses in the area (leaving the no drop stuff on there) then end the macro.

I have searched up and down and found certain things that can be linked into other macros like Ninjaloot, but no method for doing the above as a stand alone process.

Any help would be really, really appreciated =)
 
I have searched up and down and found certain things that can be linked into other macros like Ninjaloot, but no method for doing the above as a stand alone process.

Any help would be really, really appreciated =)

Macro builder thread is chock full of includes that perform various functions and can be added to any macro. If you have a macro that does everything but heal, great. Add the Heal.inc and fill out your ini. If you want to just do selfbuffs or clickies, add that. Just want snare? Add the snare.inc. It is in the macro snippet forum as a sticky.
 
The macro I posted is an include file, in other words, my main macro calls this when it's time to loot. The original compile comes with the stock LootUp macro which should have a main.
 
The macro I posted is an include file, in other words, my main macro calls this when it's time to loot. The original compile comes with the stock LootUp macro which should have a main.

Yeah the current lootup macro gives the error of subroutine main not found when attempting to run.
 
I have searched up and down and found certain things that can be linked into other macros like Ninjaloot, but no method for doing the above as a stand alone process.

Any help would be really, really appreciated =)

Macro builder thread is chock full of includes that perform various functions and can be added to any macro. If you have a macro that does everything but heal, great. Add the Heal.inc and fill out your ini. If you want to just do selfbuffs or clickies, add that. Just want snare? Add the snare.inc. It is in the macro snippet forum as a sticky.

Thanks for the info, I don't currently have a macro for this function, so I suppose I should research how to write one so I can then include that loot code inside of it.

At least by the time I'm done I'll have gained valuable knowledge, I appreciate the help all =0