${FindItem[].InvSlot} vs ${Me.Inventory[]}

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

nahsalot
orc pawn
orc pawn
Posts: 27
Joined: Fri Apr 02, 2004 11:38 am

${FindItem[].InvSlot} vs ${Me.Inventory[]}

Post by nahsalot » Sun Apr 18, 2004 12:17 pm

for the direct inventory ${FindItem[].InvSlot will return 22-29
however ${Me.Inventory[]} is setup to be 23-30

is this intentional?

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sun Apr 18, 2004 12:31 pm

It is.

invslot type uses the actual inventory slot number, having nothing to do with whatever artificial values are given elsewhere. e.g. 2031 for the first slot in the first bag in the bank.

Dont use ${Me.Inventory[${FindItem[x].InvSlot]}, because invslot lets you access the item directly.

${FindItem[sword]} - item
${FindItem[sword].InvSlot} - invslot
${FindItem[sword].InvSlot.Item} - item

${InvSlot[${FindItem[sword].InvSlot}]} - invslot
${InvSlot[x].Item} - item

${Me.Inventory[x]} is set to use the same values as the inventory functionality from MQ2Parm. If it's not the same I'll fix it.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

nahsalot
orc pawn
orc pawn
Posts: 27
Joined: Fri Apr 02, 2004 11:38 am

Post by nahsalot » Sun Apr 18, 2004 12:44 pm

thanks for the clarification. Another thing about ${FindItem} that I'm unsure if it's a bug or not, is that unless the pack is open, you cannot return the inventoryslot of the item using ${FindItem}. However, you can return the item.

Probably not a bug, but I thought I'd mention it anyway.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sun Apr 18, 2004 12:49 pm

Hmm you should be able to find it in any pack in your inventory, I tested it. I'll check it.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Mon Apr 19, 2004 11:25 am

Ok I just remembered the real reason why Me.Inventory[n] is different from InvSlot[n]. Me.Inventory takes directly from the array of inventory slots in the character data:

Code: Select all

typedef struct _INVENTORY { 
/*0x00*/  struct	_CONTENTS* Charm; 
/*0x04*/  struct	_CONTENTS* LeftEar; 
/*0x08*/  struct	_CONTENTS* Head; 
/*0x0c*/  struct	_CONTENTS* Face; 
/*0x10*/  struct	_CONTENTS* RightEar; 
/*0x14*/  struct	_CONTENTS* Neck; 
/*0x18*/  struct	_CONTENTS* Shoulders; 
/*0x1c*/  struct	_CONTENTS* Arms; 
/*0x20*/  struct	_CONTENTS* Back; 
/*0x24*/  struct	_CONTENTS* LeftWrist; 
/*0x28*/  struct	_CONTENTS* RightWrist; 
/*0x2c*/  struct	_CONTENTS* Range; 
/*0x30*/  struct	_CONTENTS* Hands; 
/*0x34*/  struct	_CONTENTS* Primary; 
/*0x38*/  struct	_CONTENTS* Secondary; 
/*0x3c*/  struct	_CONTENTS* LeftFinger; 
/*0x40*/  struct	_CONTENTS* RightFinger; 
/*0x44*/  struct	_CONTENTS* Chest; 
/*0x48*/  struct	_CONTENTS* Legs; 
/*0x4c*/  struct	_CONTENTS* Feet; 
/*0x50*/  struct	_CONTENTS* Waist; 
/*0x54*/  struct	_CONTENTS* Ammo; 
/*0x58*/  struct	_CONTENTS* Pack[0x8]; 
} INVENTORY, *PINVENTORY; 
Note that charm is the very first one.

Now here is the inventory slot numbers for the same things:

Code: Select all

ItemSlotMap["leftear"]=1;
	ItemSlotMap["head"]=2;
	ItemSlotMap["face"]=3;
	ItemSlotMap["rightear"]=4;
	ItemSlotMap["neck"]=5;
	ItemSlotMap["shoulder"]=6;
	ItemSlotMap["arm"]=7;
	ItemSlotMap["back"]=8;
	ItemSlotMap["leftwrist"]=9;
	ItemSlotMap["rightwrist"]=10;
	ItemSlotMap["range"]=11;
	ItemSlotMap["hand"]=12;
	ItemSlotMap["mainhand"]=13;
	ItemSlotMap["offhand"]=14;
	ItemSlotMap["leftfinger"]=15;
	ItemSlotMap["rightfinger"]=16;
	ItemSlotMap["chest"]=17;
	ItemSlotMap["leg"]=18;
	ItemSlotMap["feet"]=19;
	ItemSlotMap["waist"]=20;
	ItemSlotMap["ammo"]=21;
	ItemSlotMap["pack1"]=22;
	ItemSlotMap["pack2"]=23;
	ItemSlotMap["pack3"]=24;
	ItemSlotMap["pack4"]=25;
	ItemSlotMap["pack5"]=26;
	ItemSlotMap["pack6"]=27;
	ItemSlotMap["pack7"]=28;
	ItemSlotMap["pack8"]=29;
	ItemSlotMap["charm"]=30;
Note that charm is the very last one.

I've changed Me.Inventory[n] for next update to match the inventory slot numbers.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

nahsalot
orc pawn
orc pawn
Posts: 27
Joined: Fri Apr 02, 2004 11:38 am

Post by nahsalot » Thu Apr 22, 2004 4:40 pm

I checked to be sure of this, it's rather odd
${FindItem[item].InvSlot} returns NULL if the bag is not open, but we can still get ${FindItem[item]} returned.

This is also sporadically working, sometimes it does, sometimes it does not!

To note however, ${InvSlot[251].Item} works fine.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Apr 22, 2004 4:43 pm

Yeah I'm going to go back through the inside bag thing and check that.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0