Problem with player:merchant

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Problem with player:merchant

#1 Post by Alkaiser »

Abandoned Fortress

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
	<!-- #  1 --><waypoint x="13132" z="6821">
		player:merchant("Buruk Wright"); yrest(1000);
		sendMacro("CloseWindows()"); yrest(1000);
	</waypoint>
</waypoints>
After the bot purchases Ancestral Spirit Herbs and Elemental Spirit Stones, I always get this error: C:/micromacro/scripts/rom/classes/inventory.lua:412: attempt to compare number with nil

The only thing I have in my character profile related to the merchant function is this:

Code: Select all

		<option name="HEALING_POTION" value="20" />
		<option name="MANA_POTION" value="20" />
Any idea what's causing this?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Problem with player:merchant

#2 Post by rock5 »

That's strange. Line 412 is right in the middle of the buying function. If it successfully buys the mana and hp potions then gets the error, then that implies that it tried to buy something else but failed. Are you sure you don't have any of the other consumables set in your profile?

Line 412 is;

Code: Select all

	if self:getItemCount(bestItem) < quantity then
I don't think it's possible for getItemCount() to return nil so I think quantity is nil. To narrow it down try adding the following before line 412 and see what gets printed when you get the error.

Code: Select all

if self:getItemCount(bestItem) == nil or quantity == nil then
    printf("Trying to buy type  %s\n",tostring(type))
    printf("getItemCount returned %s\n",tostring(self:getItemCount(bestItem)))
    printf("quantity returned %s\n",tostring(quantity ))
end
Hopefully I didn't make any syntax errors. :)
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Alkaiser
Posts: 222
Joined: Sat Sep 25, 2010 2:03 pm

Re: Problem with player:merchant

#3 Post by Alkaiser »

Here's what happened:

Trying to buy type arrow_quiver
getItemCount returned 0
quantity returned nil

Hmmmmm... so why is it trying to buy arrows? I double checked my profile and the only thing related to arrows is this:

Code: Select all

<option name="RELOAD_AMMUNITION" value="false" />	<!-- false|arrow|thrown -->
I can't see how that would have anything to do with buying arrows, and even if it did, set to false.

EDIT:

Gah! If I add this to my profile...

Code: Select all

<option name="ARROW_QUIVER" value="0" />
...it works. So if that isn't in the profile, it assumes... what exactly?
User avatar
Administrator
Site Admin
Posts: 5353
Joined: Sat Jan 05, 2008 4:21 pm

Re: Problem with player:merchant

#4 Post by Administrator »

...it works. So if that isn't in the profile, it assumes... what exactly?
Someone made a typo that preventing it from defaulting to a proper setting. Thanks for the report.
Post Reply