Page 1 of 1

disenchant question by mailman

Posted: Tue Jun 21, 2011 8:06 pm
by lisa
So really looking around and didnt see anything like this. Is there a bot that just stands and buys items, then disenchants them? I tried to work on something, but i dont have RoM here, so its patched together just with some ideas i had from other people on the forum. If someone could help me out or offer some pointers that would be great! Thanks.

Code: Select all

player.free_counter1 = 0
player:openStore(_npcname, _option);

inventory:update()
  while inventory:getItemCount("Apprentice Boots") > inventory:itemTotalCount("<EMPTY>","bags")
    inventory:storeBuyItem("Apprentice Boots");
    player.free_counter1 = player.free_counter1 + 1;
end

while ( player.free_counter1 > 0 )
     -- run disenchant macro... not sure what to use for this
     rest( 3550 );
     player.free_counter1 = player.free_counter1 - 1;
     -- takes about 3.5 seconds to disenchant an object
     -- maybe have it fire this macro
  
end


Re: disenchant question by mailman

Posted: Wed Jun 22, 2011 8:17 am
by rock5
I don't think you need the counter. You can just count the items. I think I would do it like this.

Code: Select all

player:openStore(_npcname, _option);

-- inventory:update() -- not needed. getItemCount updates the inventory.
-- while inventory:getItemCount("Apprentice Boots") > inventory:itemTotalCount("<EMPTY>","bags")-- not sure what you mean here
while 1 > inventory:itemTotalCount("<EMPTY>","bags") do -- fills bag with items
	inventory:storeBuyItem("Apprentice Boots");
end

while ( inventory:getItemCount("Apprentice Boots") > 0 ) do
	-- run disenchant macro... not sure what to use for this
	-- Find some boots
	local boots = inventory:findItem("Apprentice Boots")
	-- 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

Re: disenchant question by mailman

Posted: Wed Jun 22, 2011 10:27 am
by mailman
Great thanks! ill have to try it out!