Rock5's tradeTo userfunction

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Rock5's tradeTo userfunction

#1 Post by rock5 » Wed Aug 20, 2014 2:25 am

This userfunction allows you to trade items to other players.

Requirements:

To have the recipient automatically accept what you send them, use the AutoTrade addon.
http://www.curse.com/addons/rom/autotrade

Syntax:

You can use any one of a number of formats.
  • A single item. (An 'item' such as is returned from inventory:findItem.
    • tradeTo("recipient", item)
    A table of items.
    • tradeTo("recipient", {item1, item2, item3})
    A number of items by name. 'number' is optional and defaults to all.
    • tradeTo("recipient", "itemname" [,number])
    A number of items by id. 'number' is optional and defaults to all.
    • tradeTo("recipient", itemid [,number])
    A table of mixed names and ids. 'number' is optional and defaults to all.
    • tradeTo("recipient", {"itemname1", "itemname2", itemid1, itemid2}[, number])
Examples:

Send 9 Fusion Stones or Random Fusion Stones.

Code: Select all

tradeTo("recipient",{"Fusion Stone","Random Fusion Stone"}, 9)
Send all created Mana Stone Tier 7 to recipient by id

Code: Select all

tradeTo("recipient", 202846)
Send your shared stated Magicbreath Belt.

Code: Select all

local item
for slot = 61, 240 do
	item = self.BagSlot[slot]
	item:update()
	if item.Name == "Magicbreath Belt" and item.Stats > 3 then
		tradeTo("recipient", item)
		break
	end;
end;
Send all unbound stated gear.

Code: Select all

local item
local itemtable = {}
for slot = 61, 240 do
	item = self.BagSlot[slot]
	item:update()
	if item.Bound == false and item.Stats > 3 then
		table.insert(itemtable, item)
	end;
end;
tradeTo("recipient", itemtable)
Credits:

Jandrana for the initial version of the function.
Attachments
userfunction_tradeTo.lua
Version 1.0 - Initial release.
(3.16 KiB) Downloaded 161 times
  • 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

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#2 Post by Desmond » Wed Aug 20, 2014 3:55 am

very grateful

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#3 Post by Desmond » Wed Aug 20, 2014 4:02 am

and which function is responsible for sending stones ie take Handbags stone and insert it into the cell of trade?

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

Re: Rock5's tradeTo userfunction

#4 Post by rock5 » Wed Aug 20, 2014 4:17 am

I'm not sure what you mean by "handbag stone" but it sounds like you need to send by name or id.

Code: Select all

tradeTo("recipient","Handbag Stone")
or

Code: Select all

tradeTo("recipient", 123456)
Of course it would have to be the right name or id.
  • 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

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#5 Post by Desmond » Wed Aug 20, 2014 4:55 am

I need to write a lot of twins is how to do?

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

Re: Rock5's tradeTo userfunction

#6 Post by rock5 » Wed Aug 20, 2014 5:08 am

What? Try again.
  • 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

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#7 Post by Desmond » Wed Aug 20, 2014 5:09 am

rock5 wrote:What? Try again.
I enter my twins 8

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#8 Post by Desmond » Wed Aug 20, 2014 5:10 am

tradeTo("Islan", 202844)
I need a lot of characters Islan, Eirloa, Gopaque, Blegei, Squerst. How do I add?

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

Re: Rock5's tradeTo userfunction

#9 Post by rock5 » Wed Aug 20, 2014 5:40 am

Try

Code: Select all

names={"Islan", "Eirloa", "Gopaque", "Blegei", "Squers"}
for _, name in pairs(names) do
    tradeTo(name, 202844, 1)
end
That sends 1 stone to each character on the list.

Note: I noticed when I was testing that the function stops working after sending 24 items. It seems to be a limit similar to what happens when sending too many mail. So keep that in mind.
  • 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

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#10 Post by Desmond » Wed Aug 20, 2014 5:42 am

thank you very much I will try

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#11 Post by Desmond » Wed Aug 20, 2014 5:49 am

that does not work you can create a waypoint?

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

Re: Rock5's tradeTo userfunction

#12 Post by rock5 » Wed Aug 20, 2014 6:39 am

I can't see why it wouldn't work. Remember travelTo only trades the item. It's still up to you to get everyone to the same location at the same time. Also don't forget to install the AutoTrade addon.
  • 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

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#13 Post by Desmond » Wed Aug 20, 2014 6:53 am

addon worth

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

Re: Rock5's tradeTo userfunction

#14 Post by rock5 » Wed Aug 20, 2014 6:55 am

Desmond wrote:addon worth
What? Was that a question?
  • 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

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#15 Post by Desmond » Wed Aug 20, 2014 7:55 am

lol working a full bag, how to do what distributed belts all also personages?

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#16 Post by Desmond » Wed Aug 20, 2014 8:26 am

Rock5, I ask please treat, does not work

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
                accountpw = {
    [5] = "do628783",
    [6] = "k80681852902",
    [7] = "Oksanya1988",
}
BuyFromItemShop(829, accountpw[getAcc()], 1)
                local ammoCount = GetInventoryItemCount("228966",1); then
                Fusion_MakeMaxManaStones(5)
		tradeTo("Islan", 202844)
                		
		
</onLoad>
</waypoints>

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

Re: Rock5's tradeTo userfunction

#17 Post by rock5 » Wed Aug 20, 2014 8:35 am

please don't forget to use the code tags when posting code to this forum. Just select the code and click the "Code" button at the top of the edit box. I've done it for you this time.

It would help if you told me what it did. Did you get an error? Did it buy the items? Did it make the stones?
  • 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

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#18 Post by Desmond » Wed Aug 20, 2014 8:48 am

yes
Last edited by Desmond on Wed Aug 20, 2014 8:52 am, edited 1 time in total.

User avatar
Desmond
Posts: 184
Joined: Wed Jan 08, 2014 4:39 pm
Location: Ukraine

Re: Rock5's tradeTo userfunction

#19 Post by Desmond » Wed Aug 20, 2014 8:50 am

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
                accountpw = {
    [5] = "do628783",
    [6] = "k80681852902",
    [7] = "Oksanya1988",
}
BuyFromItemShop(829, accountpw[getAcc()], 1)
                local ammoCount = GetInventoryItemCount("228966",1); then
                Fusion_MakeMaxManaStones(5)
      tradeTo("Islan", 202844)
                      
      
</onLoad>
</waypoints>
Last edited by Desmond on Wed Aug 20, 2014 9:02 am, edited 1 time in total.

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

Re: Rock5's tradeTo userfunction

#20 Post by rock5 » Wed Aug 20, 2014 9:00 am

You have to select all the code before clicking the 'code' button. The

Code: Select all

[/b] goes before the code and [b]
[/b] goes after the code.
Desmond wrote:yes
"yes" what? Describe what happened. What didn't work?
  • 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