Inventory.mac CSV Listing

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Cebarneth
decaying skeleton
decaying skeleton
Posts: 3
Joined: Thu Jun 24, 2004 11:43 pm

Inventory.mac CSV Listing

Post by Cebarneth » Thu Jun 24, 2004 11:49 pm

Well, this is my first post.. hope I'm not completely waisting my time cause there's already one out there (I didn't find any) but this is an update to inventory.mac to use MQ2Data, in addition, it's been modified to create a CSV file (rename the .log file to .csv)

Anyway, one small problem with this macro is that two of the slots come up NULL, "hands" and "legs".. Anyone know why? Is it a bug or a typo or what?

Hope someone finds this useful! :)


Code: Select all

| -- Inventory.mac --
|
#turbo
Sub Main
   /declare index int local
   /echo Taking ${Me.Name}'s Inventory...
   /mqlog clear
   /mqlog
   /mqlog
   /mqlog , Location, Location Slot, Conatiner, Container Slot, Quantity, Name
   /mqlog , Charm, 1, None, None, ${InvSlot[charm].Item.Stack}, ${InvSlot[charm].Item.Name}
   /mqlog , Left Ear, 1, None, None, ${InvSlot[leftear].Item.Stack}, ${InvSlot[leftear].Item.Name}
   /mqlog , Head, 1, None, None, ${InvSlot[head].Item.Stack}, ${InvSlot[head].Item.Name}
   /mqlog , Face, 1, None, None, ${InvSlot[face].Item.Stack}, ${InvSlot[face].Item.Name}
   /mqlog , Right Ear, 1, None, None, ${InvSlot[rightear].Item.Stack}, ${InvSlot[rightear].Item.Name}
   /mqlog , Neck, 1, None, None, ${InvSlot[neck].Item.Stack}, ${InvSlot[neck].Item.Name}
   /mqlog , Shoulders, 1, None, None, ${InvSlot[shoulder].Item.Stack}, ${InvSlot[shoulder].Item.Name}
   /mqlog , Arms, 1, None, None, ${InvSlot[arms].Item.Stack}, ${InvSlot[arms].Item.Name}
   /mqlog , Back, 1, None, None, ${InvSlot[back].Item.Stack}, ${InvSlot[back].Item.Name}
   /mqlog , Left Wrist, 1, None, None, ${InvSlot[leftwrist].Item.Stack}, ${InvSlot[leftwrist].Item.Name}
   /mqlog , Right Wrist, 1, None, None, ${InvSlot[rightwrist].Item.Stack}, ${InvSlot[rightwrist].Item.Name}
   /mqlog , Ranged, 1, None, None, ${InvSlot[ranged].Item.Stack}, ${InvSlot[ranged].Item.Name}
   /mqlog , Hands, 1, None, None, ${InvSlot[hand].Item.Stack}, ${InvSlot[hand].Item.Name}
   /mqlog , Primary, 1, None, None, ${InvSlot[mainhand].Item.Stack}, ${InvSlot[mainhand].Item.Name}
   /mqlog , Secondary, 1, None, None, ${InvSlot[offhand].Item.Stack}, ${InvSlot[offhand].Item.Name}
   /mqlog , Left Finger, 1, None, None, ${InvSlot[leftfinger].Item.Stack}, ${InvSlot[leftfinger].Item.Name}
   /mqlog , Right Finger, 1, None, None, ${InvSlot[rightfinger].Item.Stack}, ${InvSlot[rightfinger].Item.Name}
   /mqlog , Chest, 1, None, None, ${InvSlot[chest].Item.Stack}, ${InvSlot[chest].Item.Name}
   /mqlog , Legs, 1, None, None, ${InvSlot[leg].Item.Stack}, ${InvSlot[leg].Item.Name}
   /mqlog , Feet, 1, None, None, ${InvSlot[feet].Item.Stack}, ${InvSlot[feet].Item.Name}
   /mqlog , Waist, 1, None, None, ${InvSlot[waist].Item.Stack}, ${InvSlot[waist].Item.Name}
   /mqlog , Ammo, 1, None, None, ${InvSlot[ammo].Item.Stack}, ${InvSlot[ammo].Item.Name}
   /mqlog , Inventory Platinum, 1, None, None, ${Me.Platinum}, Platinum
   /mqlog , Inventory Gold, 1, None, None, ${Me.Gold}, Gold
   /mqlog , Inventory Silver, 1, None, None, ${Me.Silver}, Silver
   /mqlog , Inventory Copper, 1, None, None, ${Me.Copper}, Copper
   /mqlog , Bank Platinum, 1, None, None, ${Me.PlatinumBank}, Platinum
   /mqlog , Bank Gold, 1, None, None, ${Me.GoldBank}, Gold
   /mqlog , Bank Silver, 1, None, None, ${Me.SilverBank}, Silver
   /mqlog , Bank Copper, 1, None, None, ${Me.CopperBank}, Copper  
   /mqlog , Shared Platinum, 1, None, None, ${Me.PlatinumShared}, Platinum
   
   /for index 1 to 8
      /if (${InvSlot[pack${index}].Item.Container} > 0) {
      	/call MainPack ${index}
      } else {
      	/mqlog , Inventory, ${index}, None, None, ${InvSlot[pack${index}].Item.Stack}, ${InvSlot[pack${index}].Item.Name}
      }
   /next index
   
   /for index 1 to 16
     /if (${InvSlot[bank${index}].Item.Container} > 0) {
           	/call MainBank ${index}
           } else {
           	/mqlog , Bank, ${index}, None, None, ${InvSlot[bank${index}].Item.Stack}, ${InvSlot[bank${index}].Item.Name}
      }
   /next index
   
   /for index 1 to 2
        /if (${InvSlot[sharedbank${index}].Item.Container} > 0) {
              	/call MainShared ${index}
              } else {
              	/mqlog , Shared Bank, ${index}, None, None, ${InvSlot[sharedbank${index}].Item.Stack}, ${InvSlot[sharedbank${index}].Item.Name}
         }
   /next index
   
   /echo Done...
/return

Sub MainPack(int PackSlot)
   /declare index int local
   /declare max int local
   /declare usedslots int local
   /declare freeslots int local
 
   /echo ${PackSlot}
   
   /varset max ${InvSlot[pack${PackSlot}].Item.Container}
   
   /varset usedslots ${InvSlot[pack${PackSlot}].Item.Items}
   
   /varset freeslots ${Math.Calc[${max}-${usedslots}]}
   
   /for index 1 to ${max}
   	/if (!${String[${InvSlot[pack${PackSlot}].Item.Item[${index}]}].Equal[NULL]}) {
      		/mqlog , Inventory, ${PackSlot}, ${InvSlot[pack${PackSlot}].Item.Type}, ${index}, ${InvSlot[pack${PackSlot}].Item.Item[${index}].Stack}, ${InvSlot[pack${PackSlot}].Item.Item[${index}].Name}
      	}
   /next index
/return

Sub MainBank(int PackSlot)
   /declare index int local
   /declare max int local
   /declare usedslots int local
   /declare freeslots int local
 
   /echo ${PackSlot}
   
   /varset max ${InvSlot[bank${PackSlot}].Item.Container}
   
   /varset usedslots ${InvSlot[bank${PackSlot}].Item.Items}
   
   /varset freeslots ${Math.Calc[${max}-${usedslots}]}
   
   /for index 1 to ${max}
   	/if (!${String[${InvSlot[bank${PackSlot}].Item.Item[${index}]}].Equal[NULL]}) {
      		/mqlog , Bank, ${PackSlot}, ${InvSlot[bank${PackSlot}].Item.Type}, ${index}, ${InvSlot[bank${PackSlot}].Item.Item[${index}].Stack}, ${InvSlot[bank${PackSlot}].Item.Item[${index}].Name}
      	}
   /next index
/return

Sub MainShared(int PackSlot)
   /declare index int local
   /declare max int local
   /declare usedslots int local
   /declare freeslots int local
 
   /echo ${PackSlot}
   
   /varset max ${InvSlot[sharedbank${PackSlot}].Item.Container}
   
   /varset usedslots ${InvSlot[sharedbank${PackSlot}].Item.Items}
   
   /varset freeslots ${Math.Calc[${max}-${usedslots}]}
   
   /for index 1 to ${max}
   	/if (!${String[${InvSlot[sharedbank${PackSlot}].Item.Item[${index}]}].Equal[NULL]}) {
      		/mqlog , Shared Bank, ${PackSlot}, ${InvSlot[sharedbank${PackSlot}].Item.Type}, ${index}, ${InvSlot[sharedbank${PackSlot}].Item.Item[${index}].Stack}, ${InvSlot[sharedbank${PackSlot}].Item.Item[${index}].Name}
      	}
   /next index
/return

Last edited by Cebarneth on Mon Jun 28, 2004 9:41 pm, edited 2 times in total.

Cebarneth
decaying skeleton
decaying skeleton
Posts: 3
Joined: Thu Jun 24, 2004 11:43 pm

Post by Cebarneth » Fri Jun 25, 2004 12:42 am

Added Shared Bank Slots and Column Headers for the csv file...

darknife
a lesser mummy
a lesser mummy
Posts: 45
Joined: Wed Jun 16, 2004 11:12 pm

Post by darknife » Mon Jun 28, 2004 9:05 pm

to fix the hands/legs to show what is actually equiped, i changed:

Code: Select all

/mqlog , Hands, 1, None, None, ${InvSlot[hands].Item.Stack}, ${InvSlot[hands].Item.Name}
to

Code: Select all

/mqlog , Hands, 1, None, None, ${InvSlot[hand].Item.Stack}, ${InvSlot[hand].Item.Name}
and

Code: Select all

/mqlog , Hands, 1, None, None, ${InvSlot[legs].Item.Stack}, ${InvSlot[legs].Item.Name}
to

Code: Select all

/mqlog , Hands, 1, None, None, ${InvSlot[leg].Item.Stack}, ${InvSlot[leg].Item.Name}
hands = hand
legs = leg

=) you had typos

Cebarneth
decaying skeleton
decaying skeleton
Posts: 3
Joined: Thu Jun 24, 2004 11:43 pm

Post by Cebarneth » Mon Jun 28, 2004 9:43 pm

Ahh thanks! I merged in the changes (I think) :) I also fixed the top level slots (I think).. they errored out before...

Also, I noticed a friend of mine was using the June 16th release of MQ, this wasn't compatible with that for some reason <shrug> but once I updated him to the June 20th release everything was fine..

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Post by Draimen » Wed Jun 30, 2004 10:19 am

Here is my version of that macro. It's simply a conversion of the original one with a few changes.

Code: Select all

| -- Inventory.mac --
|
#turbo
Sub Main
   /declare index int local
   /declare slot0 local
   /declare slot1 local
   /declare slot2 local
   /declare slot3 local
   /declare slot4 local
   /declare slot5 local
   /declare slot6 local
   /declare slot7 local
   /declare slot8 local
   /declare slot9 local
   /declare slot10 local
   /declare slot11 local
   /declare slot12 local
   /declare slot13 local
   /declare slot14 local
   /declare slot15 local
   /declare slot16 local
   /declare slot17 local
   /declare slot18 local
   /declare slot19 local
   /declare slot20 local
   /declare slot21 local
   /varset slot0 Charm
   /varset slot1 Left Ear
   /varset slot2 Head
   /varset slot3 Face
   /varset slot4 Right Ear
   /varset slot5 Neck
   /varset slot6 Shoulder
   /varset slot7 Arms
   /varset slot8 Back
   /varset slot9 Left Wrist
   /varset slot10 Right Wrist
   /varset slot11 Ranged
   /varset slot12 Hands
   /varset slot13 Primary
   /varset slot14 Secondary
   /varset slot15 Left Finger
   /varset slot16 Right Finger
   /varset slot17 Chest
   /varset slot18 Legs
   /varset slot19 Feet
   /varset slot20 Waist
   /varset slot21 Ammo
   /echo Taking ${Me.Name}'s Inventory...
   /mqlog ${Me.Name}'s Inventory - ${Time.Time24} on ${Time.Date}
   /mqlog
   /for index 0 to 21 [1]
     /if (${String[${Me.Inventory[${index}]}].NotEqual[NULL]}) {
       /mqlog ${slot${index}}: ${Me.Inventory[${index}]}
       } else {
       /mqlog ${slot${index}}:
       }
   /next index
   /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 22 to 29 [1]
      /if (${Me.Inventory[${index}].Container}>0) {
        /call MainPack ${index}
      } else /if (${String[${Me.Inventory[${index}]}].NotEqual[NULL]}) {
        /mqlog ${Me.Inventory[${index}]}
      }
   /next index
   /mqlog
   /mqlog ----Bank Items----
   /for index 1 to 16 [1]
     /if (${Me.Bank[${index}].Container}>0) {
        /call BankPack ${index}
      } else /if (${String[${Me.Bank[${index}]}].NotEqual[NULL]}) {
        /mqlog ${Me.Bank[${index}]}
      }
   /next index
   /mqlog
   /mqlog ***End of ${Me.Name}'s Inventory - ${Time.Time24} on ${Time.Date}***
   /echo Done...
/return

Sub MainPack(PackSlot)
   /declare index int local
   /declare max int local
   /mqlog --${Me.Inventory[${PackSlot}]}-- has ${Math.Calc[${Me.Inventory[${PackSlot}].Container}-${Me.Inventory[${PackSlot}].Items}]}/${Me.Inventory[${PackSlot}].Container} slots free, combine type: ${Me.Inventory[${PackSlot}].Type}
   /varcalc max ${Math.Calc[${Me.Inventory[${PackSlot}].Container}-0]}
   /for index 1 to ${max} [1]
      /if (${String[${Me.Inventory[${PackSlot}].Item[${index}]}].NotEqual[NULL]}) {
        /mqlog ${Me.Inventory[${PackSlot}].Item[${index}]} x${Me.Inventory[${PackSlot}].Item[${index}].Stack}
      }
   /next index
/mqlog --
/mqlog
/return

Sub BankPack(PackSlot)
   /declare index int local
   /declare max int local
   /mqlog --${Me.Bank[${PackSlot}]}-- has ${Math.Calc[${Me.Bank[${PackSlot}].Container}-${Me.Bank[${PackSlot}].Items}]}/${Me.Bank[${PackSlot}].Container} slots free, combine type: ${Me.Bank[${PackSlot}].Type}
   /varcalc max ${Math.Calc[${Me.Bank[${PackSlot}].Container}-0]}
   /for index 1 to ${max} [1]
      /if (${String[${Me.Bank[${PackSlot}].Item[${index}]}].NotEqual[NULL]}) {
        /mqlog ${Me.Bank[${PackSlot}].Item[${index}]} x${Me.Bank[${PackSlot}].Item[${index}].Stack}
      }
   /next index
/mqlog --
/mqlog
/return

| End of Inventory.mac

GreenPlastik
orc pawn
orc pawn
Posts: 28
Joined: Thu May 27, 2004 4:40 pm

Post by GreenPlastik » Thu Jul 01, 2004 9:46 am

Would it be possible to put this in an XML format? Each slot could be a different field. Then you could make a website inventory listing. Could even link to Lucy by item ID if you were really savvy.

Wonder how that would work...

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Thu Jul 01, 2004 5:30 pm

Ooor you could use Magelo ;)

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Thu Jul 01, 2004 6:23 pm

I hate Magelo. Anything that won't work no matter what I do, and I followed their directions to the letter, is not gonna be a favorite of mine. I will not disable my Internet Security for site to work. I'll stick with my Alla's version, it's good enough for me.

User avatar
nosaj969
a lesser mummy
a lesser mummy
Posts: 33
Joined: Wed Apr 28, 2004 3:39 pm
Location: Hagerstown, MD

magelo

Post by nosaj969 » Fri Jul 02, 2004 9:57 am

To get my magelo to work at work I had to change a setting...

Tools - Internet Options... - Advanced - HTTP 1.1 settings - turn on 'Use HTTP 1.1 through proxy connections'

That worked for me. Not sure if the Magelo website tells you to do that or not, but that is what I did and it work just fine.

nosaj969

GreenPlastik
orc pawn
orc pawn
Posts: 28
Joined: Thu May 27, 2004 4:40 pm

Post by GreenPlastik » Fri Jul 02, 2004 10:05 am

Ok so we could use magelo. Wopee..
Personally, I pay, so I can update. That's fine. But not everyone does.
It would still be a groovy utility for them. Heck you could have the macro have 2 parameters

1 - Would create an XML file that could used for your own website
2 - Would send your info to magelo (this would be harder, since I don't know that anyone has enough knowledge of magelo to update the equipment without using the client)

Either way, having the data in an ordered XML format would be rather cool, especially since EQ's UI is XML. Making a website that combined these things should in the end not be that overwhelming.

Just my $.02 though.

CyberCide
a lesser mummy
a lesser mummy
Posts: 41
Joined: Wed Mar 10, 2004 1:48 pm
Location: Here lurking

Post by CyberCide » Sat Jul 03, 2004 3:08 pm

My version of above macro....

Code: Select all

/out inventory
/out spellbook

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Sat Jul 03, 2004 4:45 pm

CyberCide wrote:My version of above macro....

Code: Select all

/out inventory
/out spellbook
Rofl.

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Post by Vexix » Fri Jul 09, 2004 10:00 am

Harum?

Must be missing something. Do /out commands exist? If so, where do they drop the file to?

Or was that just a joke that went way over my head?

--Vexix

hytiek
Contributing Member
Contributing Member
Posts: 54
Joined: Mon Jun 14, 2004 5:45 pm

Post by hytiek » Fri Jul 09, 2004 5:00 pm

Actually I think it was released within EQ a few patches ago, I know something about the spellbook was, I am unsure about the inventory.