Public Macros Inventory.mac [RoF2]
Reply
Inventory.mac [RoF2]
This macro is distributed with the MQ2 Source Code. All credit goes to the original author(s).

Inventory.mac will cycle through inventory (including bank inventory) and will output the contents as defined in line 3.

Macro
More +

| -- Inventory.mac --
|
#define mqlog echo
#turbo
Sub Main
   /declare index int local
   /echo Taking ${Me.Name}'s Inventory...
   /mqlog
   /mqlog
   /mqlog
   /mqlog -- ${Me.Name} - ${Me.Level} ${Me.Race} ${Me.Class} --
   /mqlog Head: ${Me.Inventory[head].Name}
   /mqlog Face: ${Me.Inventory[face].Name}
   /mqlog Neck: ${Me.Inventory[neck].Name}
   /mqlog Earrings: ${Me.Inventory[rightear].Name}, ${Me.Inventory[leftear].Name}
   /mqlog Arms: ${Me.Inventory[arms].Name}
   /mqlog Hands: ${Me.Inventory[hands].Name}
   /mqlog Wrists: ${Me.Inventory[rightwrist].Name}, ${Me.Inventory[leftwrist].Name}
   /mqlog Fingers: ${Me.Inventory[rightfinger].Name}, ${Me.Inventory[leftfinger].Name}
   /mqlog Shoulders: ${Me.Inventory[shoulder].Name}
   /mqlog Back: ${Me.Inventory[back].Name}
   /mqlog Chest: ${Me.Inventory[chest].Name}
   /mqlog Waist: ${Me.Inventory[waist].Name}
   /mqlog Legs: ${Me.Inventory[legs].Name}
   /mqlog Feet: ${Me.Inventory[feet].Name}
   /mqlog Primary: ${Me.Inventory[mainhand].Name}
   /mqlog Secondary: ${Me.Inventory[offhand].Name}
   /mqlog Range: ${Me.Inventory[ranged].Name}
   /mqlog Ammo: ${Me.Inventory[ammo].Name}
   /mqlog
   /mqlog Cash on hand: ${Me.Platinum}pp, ${Me.Gold}gp, ${Me.Silver}sp, ${Me.Copper}cp
   /mqlog Cash in bank: ${Me.PlatinumBank}pp, ${Me.GoldBank}gp, ${Me.SilverBank}sp, ${Me.CopperBank}cp
   /mqlog
   /mqlog Inventory:
   /for index 1 to 8
      /if (${Me.Inventory[pack${index}].Container})  {
        /call MainPack ${index}
      } else {
        /if (${Me.Inventory[pack${index}].ID}) /mqlog ${Me.Inventory[pack${PackSlot}].Stack}x ${Me.Inventory[pack${PackSlot}].Name}
      }
   /next index
   /mqlog
   /mqlog Bank Items:
   /for index 1 to 16
      /if (${Me.Bank[${index}].Container})  {
        /call BankPack ${index}
      } else {
        /if (${Me.Bank[${index}].ID}) /mqlog ${index}) ${Me.Bank[${index}].Stack}x ${Me.Bank[${index}].Name}
      }
   /next index
   /echo Done...
/return

|
|
Sub MainPack(int PackSlot)
    /declare index int local
    /mqlog ${PackSlot}) ${Me.Inventory[pack${PackSlot}].Name} has ${Me.Inventory[pack${PackSlot}].Container}/${Me.Inventory[pack${PackSlot}].Items} slots/used, combine type: ${Me.Inventory[pack${PackSlot}].Type}
    /for index 1 to ${Me.Inventory[pack${PackSlot}].Container}
        /if (${Me.Inventory[pack${PackSlot}].Item[${index}].ID}) {
            /mqlog ${Me.Inventory[pack${PackSlot}].Item[${index}].Stack}x ${Me.Inventory[pack${PackSlot}].Item[${index}].Name}
        }
   /next index
/return

Sub BankPack(int PackSlot)
    /declare index int local
    /if (${Me.Bank[${PackSlot}].ID}) {
    /mqlog ${PackSlot}) ${Me.Bank[${PackSlot}].Name} has ${Me.Bank[${PackSlot}].Container}/${Me.Bank[${PackSlot}].Items} slots/used, combine type: ${Me.Bank[${PackSlot}].Type}
    /for index 1 to ${Me.Bank[${PackSlot}].Container}
        /if (${Me.Bank[${PackSlot}].Item[${index}].ID}) {
            /mqlog ${Me.Bank[${PackSlot}].Item[${index}].Stack}x ${Me.Bank[${PackSlot}].Item[${index}].Name}
        }
   /next index
   }
/return

| End of PackTest.mac
Sun Oct 18, 2015 10:41 am
Senior Project Member
Public Macros Inventory.mac [RoF2]
Reply