Trade items

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Parra33
Posts: 6
Joined: Sun Dec 11, 2011 12:46 am

Trade items

#1 Post by Parra33 » Fri Sep 14, 2012 4:47 pm

How can I trade items with my two accounts using micromacro?

Example: I farm 5 items and i need trade this 5 items to my other bot.

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

Re: Trade items

#2 Post by rock5 » Sat Sep 15, 2012 3:03 am

Sending by mail is easy using my mail userfunction. The sender goes to the mail box and sends, then goes on about it's business. The receiver goes to the mailbox occasionally and checks for mail. Easy.

But trading is more difficult as there is no easy way to have 2 characters communicate. The 2 characters would have to be at the same place at the same time which can be tricky. Which probably explains why there is no trading userfunction. If you want a solution it will very much depend on what your characters are doing when you want them to trade.

So we will need some more information. Are they doing different things? Is one following the other? Are you using the party scripts?
  • 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

Alleexx
Posts: 120
Joined: Sun May 15, 2011 4:28 am
Location: Sweden

Re: Trade items

#3 Post by Alleexx » Sat Sep 15, 2012 7:43 am

To accept the trade you can use this addon: http://www.curse.com/addons/rom/autotrade

I use that when farming tempest height necklaces for guild quests to be used by my guild. I have one character standing in one spot OR I have it following my char, then whenever I get 30 necklaces (max) I trade it to my other char and keep farming.

Not sure how you would do that with the bot though.

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

Re: Trade items

#4 Post by rock5 » Sat Sep 15, 2012 9:55 am

Cool, so you only need to do one side of the trade. I should be able to come up with something.

Let me see... try this.

Code: Select all

-- The code you use to find items to send can vary. This is a simple example to send just one item
local item = inventory:findItem("itemname")
local RecipientName = "MrSomething"
if item then -- Lets trade
	local Recipient = player:findNearestNameOrId(RecipientName)
	if Recipient then
		repeat
			player:target(Recipient) yrest(1000)
			RoMScript("RequestTrade('target')") 
			yrest(5000) -- Not sure how long the addon needs to react and accept the trade but it will try again until it answers		
		until RoMScript("TradeFramne:IsVisible()")

		yrest(1000)
		item:use()
		yrest(1000)
		RoMScript("AcceptTrade('".. RecipientName .."')")
		yrest(1000) -- Again not sure what pause is necessary for addon to react
		RoMScript("AcceptTrade('".. RecipientName .."')")
	end
end
Untested.
  • 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

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Trade items

#5 Post by Jandrana » Sat Dec 22, 2012 8:16 am

I tried to use this trade feature, but I couldn't make it work.

There is a small typo in: RoMScript("TradeFrame:IsVisible()"), but this was easy to fix.

The problem is that item:use() is like "right clicking" the item. This does not put
items into the trade frame. Either the char tries to equip this item, or you get the
message "item cannot be used" or special item like runes get highlighted, because
they expect you to click an item to embed the rune.

Seems some cursor based implementation is required.

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Trade items

#6 Post by Jandrana » Sat Dec 22, 2012 8:35 am

I looked for some other functions and now I got a working solution:

Code: Select all

function tradeTo(RecipientName,itemTable)
    local tradeIndex = 1;
	if itemTable then -- Lets trade
	   local Recipient = player:findNearestNameOrId(RecipientName)
	   if Recipient then
		  repeat
			 player:target(Recipient) yrest(500)
			 RoMScript("RequestTrade('target')") 
			 yrest(500) -- Not sure how long the addon needs to react and accept the trade but it will try again until it answers      
		  until RoMScript("TradeFrame:IsVisible()")
          RoMScript("BagFrame:Show()");
		  yrest(500)
		  for j, element in pairs(itemTable) do
		    RoMScript("PickupBagItem("..tostring(element.SlotNumber)..")");
			RoMScript("ClickTradeItem("..tostring(tradeIndex)..")");
			tradeIndex = tradeIndex + 1;
			if tradeIndex > 8 then
			   break;
			end
			yrest(200);
		  end
		  yrest(500)
		  RoMScript("AcceptTrade('".. RecipientName .."')")
		  yrest(500) -- Again not sure what pause is necessary for addon to react
		  RoMScript("AcceptTrade('".. RecipientName .."')")
	   end
	end
end

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Trade items

#7 Post by ZZZZZ » Fri Feb 28, 2014 2:52 am

in the above function, what does the

Code: Select all

for j, element in pairs(itemTable) do
part do? Not really sure how the j, element in pairs is supposed to work. I get

Code: Select all

6:48pm - IGF:\PickupBagItem(nil)\ [string "local a={PickupBagItem(nil)} return a
"]:1: bad argument #1 to 'PickupBagItem' (number expected, got nil)
when running ' tradeTo(name,{"Dreamland Crystal Dust"}) '

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

Re: Trade items

#8 Post by rock5 » Wed Aug 20, 2014 2:32 am

  • 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

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests