buying specific items from merchant.

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

buying specific items from merchant.

#1 Post by lisa » Thu Jan 13, 2011 12:18 pm

I did a fare bit of searching and couldn't find much on this, which seemed weird to me. Searched thru all the setting.lua functions.lua macros.lua and couldn't find any "buy" or "merchant" mentioned anywhere.

Well anyway best I could come up with was

Code: Select all

/script StoreBuyItem(1,99)
So would obviously need to be used as a sendmacro, I'm sure there has to be a better way to buy items, especially by name or id as opposed to the slot it is in at merchant.
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

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

Re: buying specific items from merchant.

#2 Post by rock5 » Thu Jan 13, 2011 7:51 pm

I've commented before that I think there should be such a function. I should add it to me todo list. Actually it's probably not that big a job, I could whip up some code now. I'll look into it.
  • 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
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: buying specific items from merchant.

#3 Post by rock5 » Thu Jan 13, 2011 8:59 pm

Currently we have player:merchant() that uses inventory:storeBuyConsumable() to buy items so I was thinking of creating an inventory:storeBuyItem(nameidorindex, quantity) and a player:openStore(npcname) functions. Maybe to be thorough we need to include a sell item function? eg. item = inventory:findItem("itemname") item:storeSellItem().
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: buying specific items from merchant.

#4 Post by lisa » Thu Jan 13, 2011 9:07 pm

Sounds like a good plan to me.

This was last thing on my to do list for my fully auto any human class 1-10/10.
I'm just using the storebuyitem code for now.

The "addon" does everything I want it to, some things need to be adjusted like how I use the VK_ in skills. Otherwise it works perfectly, just need to make some really good WP to go with it, ones I use atm aren't so great, takes 90 mins 1-10. About 3 hours all up for 1-10/10.
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

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

Re: buying specific items from merchant.

#5 Post by rock5 » Fri Jan 14, 2011 2:17 am

Ok I've added the store buy function to rev 559.

Here's the changelog
  • Added function inventory:storeBuyItem(nameIdOrIndex, quantity)
  • Added function player:openStore(npcname, option)
  • Updated inventory:storeBuyConsumable() to use my more efficient inventory:storeBuyItem() function.
  • Updated CPlayer:merchant() to use player:openStore()
  • Moved parseItemLink from the CItem class to the functions.lua file.
I'll update the wiki. Something I'd like to point out, though, is buying no longer buys 1 item at a time. Now it buys upto the full stack size possible. eg. if a consumable has a stacksize of 99 and you have your settings to buy 200 then it will buy 99, 99 and then 2 instead of buying them 1 at a time. Should save stacks of time. :)
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: buying specific items from merchant.

#6 Post by lisa » Fri Jan 14, 2011 2:45 am

Awesome work yet again =)
rock5 wrote: Now it buys upto the full stack size possible. eg. if a consumable has a stacksize of 99 and you have your settings to buy 200 then it will buy 99, 99 and then 2 instead of buying them 1 at a time. Should save stacks of time. :)
Trouble is if you don't have the gold then it won't buy any? or did you put in so if it's unsuccessful at buying then to try to buy half as many? Wouldn't be an issue for most people though, so I wouldn't be too worried about making it work like this.

On a slightly related note, with the NPC detection what is the range? I have noticed a few times if char is beyond arms reach then it doesn't interact with the npc.
Any chance to have the detection distance a little further and use the attack button to run to the npc if out of interaction range?
Either that or maybe a check to see if it has targeted the npc and if not then increase the detection range and then try to move in closer.

In most of my WP I find if the bot fails to interact with NPC then it kinda messes up the whole WP. It doesn't happen often but I do notice it from time to time. The coords seem to get a little out of whack.
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

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

Re: buying specific items from merchant.

#7 Post by rock5 » Fri Jan 14, 2011 3:32 am

As far as I know there is no distance limitation on targeting npcs and to target them it uses RoMScript("UseSkill(1,1)") which is equivalent to using the attack key so something else is happening with you.
  • 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

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: buying specific items from merchant.

#8 Post by swietlowka » Fri Jan 14, 2011 3:47 am

so now when u made the missing function i have no choice but to tweak your golde script with the futher i added to it (pet craft) to auto go out buy staff and go in :o and then present to community... but not today maybe tommarow ;p

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

Re: buying specific items from merchant.

#9 Post by rock5 » Fri Jan 14, 2011 6:04 am

swietlowka wrote:so now when u made the missing function i have no choice but to tweak your golde script with the futher i added to it (pet craft) to auto go out buy staff and go in :o and then present to community... but not today maybe tommarow ;p
Actually I have an updated Golden Egg script that I have been working on for awhile that I haven't uploaded yet. I'll see if that is ready to post.

No wait, I was going to add eggpet tools to the shopping options first.

Stuff is really starting to pile up.
  • 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

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: buying specific items from merchant.

#10 Post by swietlowka » Fri Jan 14, 2011 6:39 am

i have lets say one that was working for some time, but some errors occurs... i could send my to you if ur intrested

User avatar
jduartedj
Posts: 599
Joined: Sat Dec 19, 2009 12:18 am
Location: Lisbon
Contact:

Re: buying specific items from merchant.

#11 Post by jduartedj » Fri Jan 14, 2011 6:58 am

personally I'm waiting on:
rock5 wrote:I was going to add eggpet tools to the shopping options first
to do that to my script.
Thanks for reading! :D

Some of you might find this useful: RoM-bot Wiki
User Functions Repository (and other useful files): Addon Repo
Latest SVN updates: SVN updates

Solist
Posts: 3
Joined: Tue Mar 01, 2011 4:20 am

Re: buying specific items from merchant.

#12 Post by Solist » Tue Mar 01, 2011 4:23 am

Is it possible to see the durability of selected item before buying ?

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

Re: buying specific items from merchant.

#13 Post by rock5 » Tue Mar 01, 2011 4:28 am

Don't merchant bought items have a default dura?
  • 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

Solist
Posts: 3
Joined: Tue Mar 01, 2011 4:20 am

Re: buying specific items from merchant.

#14 Post by Solist » Tue Mar 01, 2011 5:05 am

I am about items being sold by traders in the Limo. These items have a random durability up to 120.

Moreover, I'm interested in items with a random stats for memento.

There is helpful to see what you are buying, before you buy :idea:

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

Re: buying specific items from merchant.

#15 Post by rock5 » Tue Mar 01, 2011 7:25 am

If you can't see the info manually then the bot is not going to be able to get it either. Probably they are added after purchase.
  • 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

CanceR
Posts: 33
Joined: Sun Jul 22, 2012 9:28 am

Re: buying specific items from merchant.

#16 Post by CanceR » Sun Jan 20, 2013 11:16 am

Hello all,

i tried numerous times with "inventory:storeBuyItem(itemIDorIndex, 99);" and with "RoMScript("StoreBuyItem(5,99)");". in command prompt it works, but micromacro does not want to buy items.
i am trying to set micromacro in waypoint code to buy stack of crafting tools.
i would ask for a bit of help pls.

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

Re: buying specific items from merchant.

#17 Post by rock5 » Sun Jan 20, 2013 11:46 am

Are you opening the store first?

Code: Select all

player:openStore("NPCName")
Maybe a look at the code you use would help.
  • 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

CanceR
Posts: 33
Joined: Sun Jul 22, 2012 9:28 am

Re: buying specific items from merchant.

#18 Post by CanceR » Sun Jan 20, 2013 1:59 pm

Code: Select all

	<!-- #  9 --><waypoint x="-6851" z="-3564" y="173">
		player:merchant(_PetHunter);
		sendMacro("ChoiceOption(1)");
		
		for i,_minInvCount,1 do
			inventory:storeBuyItem(204232, 99)
			--RoMScript("StoreBuyItem(5,99)");
		end
	</waypoint>
this is how my waypoint looks like, where i am trying to buy 5 stacks of Small Hatchets

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

Re: buying specific items from merchant.

#19 Post by rock5 » Sun Jan 20, 2013 2:10 pm

I believe "player:merchant" opens the store, does the autosell and buying based on your profile options, then closes the store.

Try the openStore command I showed you above instead. If the option to open the store is option 1 then you don't need the ChoiceOption command.
  • 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

CanceR
Posts: 33
Joined: Sun Jul 22, 2012 9:28 am

Re: buying specific items from merchant.

#20 Post by CanceR » Sun Jan 20, 2013 4:10 pm

Code: Select all

		player:openStore(_PetHunter)
		inventory:storeBuyItem(herbtools, 99)
in this way it works flowlessly, but in this way

Code: Select all

		player:openStore(_PetHunter)
		for i,_minInvCount,1 do
			inventory:storeBuyItem(herbtools, 99)
		end
micromacro shows error: "- scripts/rom/bot.lua:827: Failed to compile and run Lua code for waypoint #10" - i think i m writing wrong "for i" cycle, can you advice me how to repair, please.
and one more thing for now: how to choose from a list (or how to organize a list):

Code: Select all

GROUP1 = {
[1] = {Name = TEXT("Sys200335_name"), ID = 200335, Lvl = 1, Value = 2},
[2] = {Name = TEXT("Sys202552_name"), ID = 202552, Lvl = 1, Value = 3},
[3] = {Name = TEXT("Sys200334_name"), ID = 200334, Lvl = 8, Value = 4},
}
meaning: if item name is in list do: craftItem( ItemNameOrID, "all");

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 5 guests