Thursday, April 12, 2012

Variable issues with Auction House Items

[:1]I can't figure this out. I use GetContainerItemLink(bag,slot) to find a Glyph in the inventory (bags). It returns the item name. The problem is, it returns the item name in brackets: [Glyph of Battle]. Now I want to search for that item in the Auction house using QueryAuctionItems(item,0...). It returns nil because of the brackets.

So I try to get rid of the brackets in the string.

This is where things get crazy. I am not sure what I am doing wrong, but it just does not work.

I try to remove the first bracket:

here = string.sub(item,2);

print(here);

And I get this: gffffff[Glyph of Battle]

I try to remove the last bracket:

here = string.sub(item,1,-2);

print(here);

and get [Glyph of Battle]|

This just does not make sense to me.

Anyone else have a problem like this? or know what is causing it?

Thanks very much.|||Well, typing it out in the forum helped me figure out the issue.

I was getting the "ItemLink". That was causing the issues.

So to fix the issue, I used GetItemInfo(item_link) and got the real name.

Now it works!

No comments:

Post a Comment