Disenchant Dealer

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Turbomuemmel
Posts: 7
Joined: Fri Jan 14, 2011 11:02 am

Disenchant Dealer

#1 Post by Turbomuemmel »

Hello
want from the dealer purchased true Disenchant
my waypoint file error reports
Attachments
testen.xml
(962 Bytes) Downloaded 199 times
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Disenchant Dealer

#2 Post by rock5 »

I saw 3 problems.

1. You have the start of waypoint but then you do all the code in the onload.
2. There was no closing onload tag "</onLoad>".
3. We usually use the empty slots id (0) to count empties because the name "<EMPTY>" gets interpreted as a tag in xml files. You can use that in lua files but it's best to just get in the habit of using 0.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
		player:openStore("Shamp", _option);

		-- inventory:update() -- not needed. getItemCount updates the inventory.
		-- while inventory:getItemCount("Lehrlingslangstiefel") > inventory:itemTotalCount(0,"bags")-- not sure what you mean here
		while 1 > inventory:itemTotalCount(0,"bags") do -- fills bag with items
		   inventory:storeBuyItem("Lehrlingslangstiefel");
		end
	
		while ( inventory:getItemCount("Lehrlingslangstiefel") > 0 ) do
		   -- run disenchant macro... not sure what to use for this
		   -- Find some boots
		   local boots = inventory:findItem("Lehrlingslangstiefel")
		   -- Use Disenchant skill
		   RoMScript("UseSkill(1,3)") -- Make sure your Disenchant is on tab 1, skill 3.
		   -- Clicks the item
		   RoMScript("PickupBagItem("..boots.BagId..")") 
		   rest( 3550 );
		end
</onLoad>
</waypoints>
  • 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
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#3 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:32 am, edited 1 time in total.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Disenchant Dealer

#4 Post by rock5 »

The error message just means it finished the onload code and tried to go to a waypoint but there aren't any. If you are going to have an onload only waypoint file then the onload should never finish or it should end when it's finished with an "error" command.

I think what you want to do is put the whole thing a loop. You could just use a generic loop that loops for ever, eg

Code: Select all

while true do
   ...
end
or

Code: Select all

repeat
   ...
until false
Or you could loop until you can't disenchant anymore. I'm not sure what you would check. Maybe if you run out of money or bag space because it's full of runes.

Try encircling the whole thing with

Code: Select all

repeat
   ...
until inventory:itemTotalCount(0) == 0 or 10 > inventory.Money
error("Finished disenchanting")
  • 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
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#5 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:33 am, edited 1 time in total.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Disenchant Dealer

#6 Post by rock5 »

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
      repeat

      player:openStore("Mallor", _option);

      -- inventory:update() -- not needed. getItemCount updates the inventory.
      -- while inventory:getItemCount("Rusted Axe") > inventory:itemTotalCount(0,"bags")-- not sure what you mean here
      while inventory:itemTotalCount(0,"bags") > 1 do -- fills bag with items
         inventory:storeBuyItem("Rusted Axe");
      end
   
      while ( inventory:getItemCount("Rusted Axe") > 0 ) do
         -- run disenchant macro... not sure what to use for this
         -- Find some boots
         local boots = inventory:findItem("Rusted Axe")
         -- Use Disenchant skill
         RoMScript("UseSkill(1,3)") -- Make sure your Disenchant is on tab 1, skill 3.
         -- Clicks the item
         RoMScript("PickupBagItem("..boots.BagId..")")
         rest( 3550 );
      end

      until inventory:itemTotalCount(0) == 0 or 10 > inventory.Money
      error("Finished disenchanting")
</onLoad>
</waypoints>
What that code I posted does is check both if you are out of space and if you are out of money.

I noticed a mistake with this line and fixed it.

Code: Select all

      while 1 > inventory:itemTotalCount(0,"bags") do -- fills bag with items
  • 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
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#7 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:33 am, edited 1 time in total.
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#8 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:34 am, edited 1 time in total.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Disenchant Dealer

#9 Post by rock5 »

I'm not sure why you got the "boot" issue. It's probably a matter of timing. You just need to check "boot before using it. Try changing the following

Code: Select all

         -- Find some boots
         local boots = inventory:findItem("Rusted Axe")
         -- Use Disenchant skill
         RoMScript("UseSkill(1,3)") -- Make sure your Disenchant is on tab 1, skill 3.
         -- Clicks the item
         RoMScript("PickupBagItem("..boots.BagId..")")
         rest( 3550 );
to

Code: Select all

         -- Find some boots
         local boots = inventory:findItem("Rusted Axe")
         if boots then
            -- Use Disenchant skill
            RoMScript("UseSkill(1,3)") -- Make sure your Disenchant is on tab 1, skill 3.
            -- Clicks the item
            RoMScript("PickupBagItem("..boots.BagId..")")
            rest( 3550 );
         end
  • 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
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#10 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:38 am, edited 1 time in total.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Disenchant Dealer

#11 Post by lisa »

replace

Code: Select all

      while inventory:itemTotalCount(0,"bags") > 1 do -- fills bag with items
         inventory:storeBuyItem("Rusted Axe");
      end
with

Code: Select all

local buy = inventory:itemTotalCount(0,"bags") - 1
store:buyItem("Rusted Axe", buy)
7:37pm - C:/micromacro/scripts/rom/classes/waypointlist.lua:83: Failed to compile and run Lua code for waypointlist onLoad event.
That means you messed up somewhere, can't tell you what is wrong unless you post all of the onload code.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#12 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:38 am, edited 1 time in total.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Disenchant Dealer

#13 Post by lisa »

repeat

player:openStore("Mallor", _option);

-- inventory:update() -- not needed. getItemCount updates the inventory.
-- while inventory:getItemCount("Rusted Axe") > inventory:itemTotalCount(0,"bags")-- not sure what you mean here
local buy = inventory:itemTotalCount(0,"bags") - 1
store:buyItem("Rusted Axe", buy)
end
that will always crash 100%
repeat
........
end
will never work

try this

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
	repeat
		player:openStore("Mallor", _option);
		local buy = inventory:itemTotalCount(0,"bags") - 1
		store:buyItem("Rusted Axe", buy)
		while ( inventory:getItemCount("Rusted Axe") > 0 ) do
			inventory:update()
			local boots = inventory:findItem("Rusted Axe")
			if boots then
				-- Use Disenchant skill
				RoMScript("UseSkill(1,3)") -- Make sure your Disenchant is on tab 1, skill 3.
				-- Clicks the item
				RoMScript("PickupBagItem("..boots.BagId..")")
				rest( 3550 );
			end
		end
	until inventory:itemTotalCount(0) == 0 or 10 > inventory.Money
	error("Finished disenchanting")
</onLoad>
</waypoints>
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#14 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:38 am, edited 2 times in total.
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#15 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:38 am, edited 1 time in total.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Disenchant Dealer

#16 Post by lisa »

yeah I edited it, try it again with what is posted now.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#17 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:37 am, edited 1 time in total.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Disenchant Dealer

#18 Post by rock5 »

I didn't get a compile error so maybe it's something else such as a userfunction or something.
  • 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
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#19 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:37 am, edited 1 time in total.
startxkdm
Posts: 17
Joined: Wed Dec 19, 2012 10:26 pm

Re: Disenchant Dealer

#20 Post by startxkdm »

-
Last edited by startxkdm on Mon Dec 31, 2012 5:37 am, edited 1 time in total.
Post Reply