Dissassemble Materials

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Dissassemble Materials

#1 Post by Draakje » Fri Aug 16, 2013 4:27 am

someone can write a small or short macro to dissassemble materials:
has like right click the material (object or item), wait 1sec then right click again (loop it for 999 times)


trying something out, but im missing lot, no idea how start it.

UseItem("Dark Crystal Sand")
wait 1

ratzuk
Posts: 19
Joined: Wed Dec 01, 2010 7:39 am

Re: Dissassemble Materials

#2 Post by ratzuk » Fri Aug 16, 2013 5:01 am

I Use this:

Code: Select all

<waypoints type="TRAVEL">
	<onLoad>	
	itemname ="Sinners Palm Sap"	
	
	RoMScript("CloseAllWindows()") -- Don't want to accidentaly sell stuff!
	while inventory:getItemCount(itemname) > 0 do
		for i, item in pairs(inventory.BagSlot) do					
			if item.Name == itemname then
				item:use() -- Breaks it up
				yrest(1200)
			end
		end
	end
	</onLoad>	
</waypoints>
Change itemname to suit

Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Dissassemble Materials

#3 Post by Draakje » Fri Aug 16, 2013 5:10 am

ratzuk wrote:I Use this:

Code: Select all

<waypoints type="TRAVEL">
	<onLoad>	
	itemname ="Sinners Palm Sap"	
	
	RoMScript("CloseAllWindows()") -- Don't want to accidentaly sell stuff!
	while inventory:getItemCount(itemname) > 0 do
		for i, item in pairs(inventory.BagSlot) do					
			if item.Name == itemname then
				item:use() -- Breaks it up
				yrest(1200)
			end
		end
	end
	</onLoad>	
</waypoints>
Change itemname to suit
where u place this in?

Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Dissassemble Materials

#4 Post by Draakje » Fri Aug 16, 2013 6:01 am

got it, ty

Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Dissassemble Materials

#5 Post by Draakje » Wed Aug 21, 2013 10:54 am

is it possible to make an addon macro of this? so u can activate dissassemble materials ingame by type /Start Dissassemble and maybe possible change item name ingame too. So diff materials can be done ingame, without editing file constantly.

Gave it a try write myself, but gues some probs in it:

Lua file

Code: Select all

local activate = true -- Starting value

SLASH_DissMats1 = "/DissambleMaterials"
SLASH_DissMats2 = "/DM" -- Add as many variations as you like just increment the number
SlashCmdList["DissMats"] = function(editBox, msg)
    if msg then
        msg = string.lower(msg)
        if msg == "start" then -- start
            activate = true
        elseif msg == "stop" then -- stop
            activate = false
        else
            activate = not activate -- Toggles addon if 'start' or 'stop' is not used.
        end
        if activate then
            itemname ="Dark Crystal Ingot"

            RoMScript("CloseAllWindows()") -- Don't want to accidentaly sell stuff!
            while inventory:getItemCount(itemname) > 0 do
                for i, item in pairs(inventory.BagSlot) do
                    if item.Name == itemname then
                        item:use() -- Breaks it up
                        yrest(1200)
                    end
                end
            end
        else
            SendSystemChat("Dissambling Materials has been stopped")
        end
    end
end




local DissMats = {} -- the AddOn namespace, all your functions should be placed inside here instead of as globals.
_G.DissMats = DissMats -- expose it to the global scope




    local time_remaining = 0.5 -- in seconds
       function DissMats:OnUpdate(elapsed)
        if activate == false then
        return
        end
       end
Xml file

Code: Select all

<Ui xmlns="http://www.runewaker.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.runewaker.com/UI.xsd">
    <Frame name="DissambleMaterials_Frame">
        <Scripts>
            <OnUpdate>
                DissMats:OnUpdate(elapsed)
            </OnUpdate>
        </Scripts>
    </Frame>
</Ui>

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Dissassemble Materials

#6 Post by rock5 » Wed Aug 21, 2013 11:31 am

You can't use rombot functions such as RoMScript and inventory:itemTotalCount in a game addon. You would have to use only in game function.
  • 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

Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Dissassemble Materials

#7 Post by Draakje » Wed Aug 21, 2013 12:38 pm

ah i see

Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Dissassemble Materials

#8 Post by Draakje » Wed Aug 21, 2013 12:39 pm

but its still possible? what functions should be needed then

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Dissassemble Materials

#9 Post by rock5 » Wed Aug 21, 2013 2:33 pm

Try this for your lua. No guarantee it will work though.

Code: Select all

local activate = true -- Starting value
local itemname ="Dark Crystal Ingot"


SLASH_DissMats1 = "/DissambleMaterials"
SLASH_DissMats2 = "/DM" -- Add as many variations as you like just increment the number
SlashCmdList["DissMats"] = function(editBox, msg)
    if msg then
        msg = string.lower(msg)
        if msg == "start" then -- start
            activate = true
        elseif msg == "stop" then -- stop
            activate = false
        else
            activate = not activate -- Toggles addon if 'start' or 'stop' is not used.
        end
    end
end

local time_remaining = 1.2 -- in seconds
function DissMats:OnUpdate(elapsed)
	if activate = false then
		return
	end
	
	time_remaining = time_remaining - elapsed
	if time_remaining > 0 then
		-- cut out early, we're not ready yet
		return
	end

	-- Search for item
	local item, name, found
	for slot = 1,60 do
		index, _, name = GetBagItemInfo(slot)
		if name == itemname then
			found = index
			break 
		end
	end 
	
	if found then
		StoreFrame:Hide()
		UseBagItem(found)
	else
		activate = false
	end
	time_remaining = 2 -- reset to 2 seconds
end
	
I've set it to stop when it runs out of items so you need to start it after getting the 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

Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Dissassemble Materials

#10 Post by Draakje » Wed Aug 21, 2013 2:44 pm

can u also adjust itemname function change, with typing ingame what material u want dissamble?

Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Dissassemble Materials

#11 Post by Draakje » Wed Aug 21, 2013 4:04 pm

its not working so far, will have look tommrow what could be wrong

Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Dissassemble Materials

#12 Post by Draakje » Wed Aug 21, 2013 4:08 pm

Maybe its missing the right click function, or i read somewhere they use: UseItemByName(".....")

added: end at bottom and my program also give maybe error part at

Code: Select all

function DissMats:OnUpdate(elapsed)
    if activate = false then
    return
    end

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Dissassemble Materials

#13 Post by rock5 » Thu Aug 22, 2013 6:11 am

Draakje wrote:Maybe its missing the right click function, or i read somewhere they use: UseItemByName(".....")
UseBagItem and UseItemByName is basically the same thing done 2 different ways. You could try using UseItemByName but I suspect it's not working because the function is disabled in addons. A lot of functions are disabled in addons and can't be used.
Draakje wrote:added: end at bottom and my program also give maybe error part at
I think my code is missing an 'end'. I'll update the above code and put the extra 'end' in the right place.
  • 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

Draakje
Posts: 63
Joined: Sat Aug 10, 2013 6:24 am

Re: Dissassemble Materials

#14 Post by Draakje » Thu Aug 22, 2013 12:17 pm

hmm still not working

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Dissassemble Materials

#15 Post by rock5 » Thu Aug 22, 2013 12:29 pm

Then I don't think it's possible.
  • 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

lolilol
Posts: 18
Joined: Tue Mar 27, 2012 2:17 pm

Re: Dissassemble Materials

#16 Post by lolilol » Wed Dec 11, 2013 3:46 pm

I have this message when I start this waypoint : No waypoints to go to waypoint file.
can someone help me please?

thanks

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Dissassemble Materials

#17 Post by noobbotter » Wed Dec 11, 2013 6:54 pm

Probably the best bet for Draakje at this point would be to create a script similar to the "createpath" Lua file where it would bring up a menu and you could use the numpad keys to select which item you want to break down. You'd have to build out the menus to where when you select the item you want to breakdown, the lua would set the variable to the correct item name and run the function that loops through the bag items.

Seems like a lot of work though versus the other option... Create a subfolder and make copies of the waypoint file that breaks an item down. Each copy could easily be named by the item it breaks down. That way all those same scripts are in the same location and they all do the same thing. They just each have a different item name in the variable.

Just some thoughts.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Dissassemble Materials

#18 Post by rock5 » Wed Dec 11, 2013 10:05 pm

I think the easiest would be to add an option to the slash command eg.

Code: Select all

/DM Start "Dark Crystal Ingot"
or even easier, to have it disassemble any mat in slot 1 of the bag, by default. Then you wouldn't even need to type the name. Just put the item you want to disassemble into slot 1 and it disassembles all items of that name.
  • 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

lolilol
Posts: 18
Joined: Tue Mar 27, 2012 2:17 pm

Re: Dissassemble Materials

#19 Post by lolilol » Thu Dec 12, 2013 4:51 am

I don't understand one thing, this code :
<waypoints type="TRAVEL">
<onLoad>
itemname ="Sinners Palm Sap"

RoMScript("CloseAllWindows()") -- Don't want to accidentaly sell stuff!
while inventory:getItemCount(itemname) > 0 do
for i, item in pairs(inventory.BagSlot) do
if item.Name == itemname then
item:use() -- Breaks it up
yrest(1200)
end
end
end
</onLoad>
</waypoints>
it's a waypoint or I need to put in an other file?

Thanks for help

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Dissassemble Materials

#20 Post by lisa » Thu Dec 12, 2013 5:01 am

<waypoints type="TRAVEL">
Yes it is definately a waypoint and needs to be the only code inside the wp, easiest thing to do would be to copy an existing WP and then rename it. Then open it and delete all existing code in the new file and paste in the code that was posted here, then save and give it a try.

=)
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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest