Page 1 of 1
Dismantle waypoint ? ?
Posted: Tue Apr 03, 2012 12:54 pm
by Wo0olf07
Hi ..
is there any waypoint for dismantle a weapon which worth 10 gold to get blend runes , activation runes ....... etc ?
Re: Dismantle waypoint ? ?
Posted: Tue Apr 03, 2012 2:00 pm
by rock5
Do a search for "disenchant". You should be able to find some code or functions.
Re: Dismantle waypoint ? ?
Posted: Wed Apr 04, 2012 10:48 am
by Wo0olf07
Thank you Rock5 but when i used 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
it says :
haltOnError: false
Did not find any crashed game clients.
6:22pm - ...m_bot_30-3-2012/scripts/rom/classes/waypointlist.lua:22: XML Parse
rror.
File: ..._bot_30-3-2012/scripts/rom/waypoints/test - Copy.xml
Line: 1
Column: 17
Pos: 17
Message: not well-formed (invalid token)
btw i searched before posting this and i found that code but it didn't work for me so i thought it is old or something likethat ..
Re: Dismantle waypoint ? ?
Posted: Wed Apr 04, 2012 2:43 pm
by BillDoorNZ
I doubt it will be liking the <EMPTY> text that is in there, to get total number of empty bag slots do:
Re: Dismantle waypoint ? ?
Posted: Thu Apr 05, 2012 5:04 am
by Wo0olf07
I tried many times but I still getting the same error
btw I am not programmer so please don't tell me what is the error just fix it

Thanks ,
Re: Dismantle waypoint ? ?
Posted: Thu Apr 05, 2012 8:58 am
by rock5
Wo0olf07 wrote:Thank you Rock5 but when i used this
We need to see the whole file to find the error. If that is your whole file then there is a lot missing.
Re: Dismantle waypoint ? ?
Posted: Thu Apr 05, 2012 10:24 am
by Wo0olf07
It's the whole file because i took it from
Here 
Re: Dismantle waypoint ? ?
Posted: Thu Apr 05, 2012 1:24 pm
by rock5
Well it needs to be put into something. You can put it in a waypoint files onload section or you could make it into a userfunction. I think the way the code is written it was meant to go in a userfunction
So, try this.
Code: Select all
function Disenchant(_npcname, _itemname)
player:openStore(_npcname);
while 1 > inventory:itemTotalCount(0) do -- fills bag with items
inventory:storeBuyItem(_itemname);
end
while ( inventory:getItemCount(_itemname) > 0 ) do
-- Find some items
local item = inventory:findItem(_itemname)
-- Use Disenchant skill
RoMScript("UseSkill(1,3)") -- Make sure your Disenchant is on tab 1, skill 3.
-- Clicks the item
RoMScript("PickupBagItem("..item.BagId..")")
rest( 3550 );
end
end
Put it into a userfunction file, lets call it "userfunction_disenchant.lua" and put it into the userfunctions folder. Then start the commandline.xml and type
Code: Select all
Disenchant("npc name","Apprentice Boots")
Re: Dismantle waypoint ? ?
Posted: Fri Apr 06, 2012 8:17 am
by Wo0olf07
It works but not very well
I think there is a problem in this line. It doen't work
while 1 > inventory:itemTotalCount(0) do -- fills bag with items
the bot starts then open the store then stop but if you have the item which
you want to dismantle then it will dismantle it then stop ..
so I deleted that line then everything is going fine .
the bot starts then buy one item ( or more if i want ) then dismantle it then stop
And what I want is to make it repeat it self .. Can you do it please

?
here is the whole file
Code: Select all
function Disenchant(_npcname, _itemname)
player:openStore(_npcname);
do inventory:storeBuyItem(_itemname);
end
do inventory:storeBuyItem(_itemname);
end
while ( inventory:getItemCount(_itemname) > 0 ) do
-- Find some items
local item = inventory:findItem(_itemname)
-- Use Disenchant skill
RoMScript("UseSkill(1,3)") -- Make sure your Disenchant is on tab 1, skill 3.
-- Clicks the item
RoMScript("PickupBagItem("..item.BagId..")")
rest( 3550 );
end
end
bad english .. yea i know
