Sell items to player buyer shop

For everything NOT server specific support. Do NOT ask for connectivity help here!.

Moderator: Moderators

Message
Author
o12116
Noob
Noob
Posts: 8
Joined: 18 Nov 2019, 17:52
Noob?: No

Sell items to player buyer shop

#1 Post by o12116 »

Greetings all,
I wanna write a macro that sells items, say Stem, to buyer shop opened by players.
If I'm using the console, I can just type

Code: Select all

buyer 0
and

Code: Select all

buyer 1
and so on, until I find the one that's buying Stem.
Then I would use

Code: Select all

buyer #buyer_index #Stem_index #amount 
to sell it.

The thing is that when using macro, it seems that there's no way to lookup the buyer index.
So a dumb way would be to loop through, say 1 to 10, and do the sell command anyway.
However when trying to sell things to a player who's not buying it, the bots gets disconnected to server.

Anyone has a solution to this?

Btw here's my stupid code:

Code: Select all

macro sell_to_player {
	$itemIdx = @inventory (Stem)
	$sellQty = @invamount (Stem)
	$buyerIdx = 0
	while ($buyerIdx <= 10) as dumbSell
		do buyer $buyerIdx $itemIdx $sellQty
		$buyerIdx++
	end dumbSell
}
Thanks for reading this thread

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: Sell items to player buyer shop

#2 Post by fadreus »

Well, first of all; the following I'm about to say is never been attempt (myself).
So I'm just gonna talk about the possibility of doing it
(while waiting other mods/dev/or anyone more knowledgeable saying anything or might be never)
o12116 wrote:it seems that there's no way to lookup the buyer index.
For old macro (macro.pl), you try using this link as reference to get buyingStoreID as you can use command bl (Buyer list).
For new macro (eventMacro.pl) you can look into utilities.pm and try playing around with venderID. You might be able to replicate it to use with buyingID.

Or just view the buyer store and make an automacro to trigger when they are buying it rather than selling it when it's not even buying the item which is causing bot to disconnect.

TL;DR - it's rather a hassle stuff doing it for automation, I rather doing it manually.
Just an idea tho. Good luck.

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: Sell items to player buyer shop

#3 Post by Mortimal »

buyer_items receive packet is not implemented in Openkore yet... (so you really can't get buyer items - Openkore don't encode that packet when you enter buyer shop) so you just can't know what items buyer is buying therefore there is no solution for your problem currently. You can create Issue in Github, give all information (packet examples with item names and so on) than maybe some one will start doing this.

\src\Network\Receive.pm line 7607
Please use pin function for uploading your file contents!

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: Sell items to player buyer shop

#4 Post by c4c1n6kr3m1 »

all codes are inside src
you can study from commands.pm and need to repair some from other

ever thought that your auto seller will bring down the price ?

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: Sell items to player buyer shop

#5 Post by Mortimal »

hmmm maybe il just write plugin for that...
Please use pin function for uploading your file contents!

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: Sell items to player buyer shop

#6 Post by Mortimal »

ok done...

First. Add attached file to your plugins.

Second. Edit your config/sys.txt

Code: Select all

loadPlugins_list macro,profiles,breakTime,raiseStat,raiseSkill,map,reconnect,eventMacro,item_weight_recorder,xconf,selltoplayer
Third. Edit your \src\Network\Receive.pm line 7743

Code: Select all

	Plugins::callHook('packet_buying_store2', {
		buyerID => $buyerID,
		buyingStoreID => $buyingStoreID,
		buyerZenyLimit => $zeny, #add this line
		itemList => \@buyerItemList
	});
Fourth. Edit your macro like this:

Code: Select all

macro sell_to_player {
   $buyerIdx = 0
   while ($buyerIdx <= 10) as dumbSell
      do buyer $buyerIdx
      $buyerIdx++
   end dumbSell
}
Fifth. Add something like this to your config.txt

Code: Select all

sellToPlayer Stem{
   disabled 0
   minPrice 50 #optional (minimal price to sell your item)
}
ACHTUNG! Plugin is not tested use at your own risk!

If this will work I will think how to make it work without this dumb macro. If not post all errors you get and I will fix it.
Attachments

[The extension pl has been deactivated and can no longer be displayed.]

Please use pin function for uploading your file contents!

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: Sell items to player buyer shop

#7 Post by fadreus »

I'm more curious of why one decide to sell through Buying Store.
Why not just Vending it?
I could think of couple of reasons but none worth the hassle going through this.

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: Sell items to player buyer shop

#8 Post by Mortimal »

I think it is just faster for monoboting...
Please use pin function for uploading your file contents!

o12116
Noob
Noob
Posts: 8
Joined: 18 Nov 2019, 17:52
Noob?: No

Re: Sell items to player buyer shop

#9 Post by o12116 »

Thanks! You guys totally rock!

I'll test Mortimal's plugin when the buyer comes back from scheduled maintenance.
Mortimal wrote: First. Add attached file to your plugins.
Second. Edit your config/sys.txt
Third. Edit your \src\Network\Receive.pm line 7743
Fourth. Edit your macro like this:
Fifth. Add something like this to your config.txt
As for why selling to players instead of vending it, I actually don't have a good answer.

I just "guess" it's a quicker way to get zeny?
In iRO I only see 2 players buying Stem (and rarely see people vending it) so I think the demand is not high enough.
Nevertheless it's still worth a try to vend Stem near these buyers and see if they buy it lol.

Thanks again for the fun discussion 8-)

User avatar
fadreus
The Kore Devil
The Kore Devil
Posts: 708
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: Sell items to player buyer shop

#10 Post by fadreus »

o12116 wrote:In iRO I only see 2 players buying Stem (and rarely see people vending it) so I think the demand is not high enough.
It's not that people rarely vending it. It just sold out the moment it appear in ragial usually.
Things that don't have high demand never ever people put up Buying Store.

People use Buying Store when there is short supply and high demand or they just want less price, but it still in demand.
Especially crafting materials (cooking, condense potion, etc) and usable items (strawberry, MCA, etc)

Well, tips on getting zeny is to use what people suggest in warpportal forum there and implement in with openkore.
As for me, I used to make 300m daily with bounty board (magical stones + loots + bounty reward).
You might wanna try that.

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

Post Reply