[mod] AdvancedMarket [advanced_market]

Post Reply
arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

[mod] AdvancedMarket [advanced_market]

by arsdragonfly » Post

Trade everything everywhere, no chest-shops involved! Acts like a stock market!!!
Github repo:https://github.com/arsdragonfly/advanced_market
License:CC0
Dependencies:money,locked_signs

Quick start:
Dig some dirt.
Hold the dirt in your hand.
/am sell 5
(sell these dirt at the price of 5$ each dirt block)
/am buy default:dirt 1 5
(buy 1 dirt block at the price of 5$, in this case the deal is then concluded)
/am refreshbuffer
(the dirt is in your "buffer", and you use this command to put it back into your inventory.)

Buy low , sell high and maybe become a monopoly! :D
This mod is still WIP and has many bugs to be fixed :P

New feature
Added vieworder (/am vieworder)
Added cancelorder (/am cancelorder <order_number>
Added viewlog (/am viewlog)
Added getname (/am getname) to get the engine name of the item you're holding, like default:dirt.

A diagram to help you understand all the stuff:
Image

Data structure:
Spoiler
data structure:
Image
Image
Image
Image
Full readme:
Spoiler
advanced_market

This mod allows you to trade in minetest as if you were in a stock market. Dependencies: money locked_sign

Howto:

Command can be /am, /amarket or /advanced_market Sell the stuff you're holding: /am sell PRICE e.g. /am sell 5

Buy some stuff: /am buy ITEM AMOUNT PRICE e.g. /am buy default:dirt 1 5

View available orders of one item: /am viewstack ITEM e.g. /am viewstack default:dirt

View your buffer: /am viewbuffer

Get the engine name of wielditem: /am getname

View the log: /am viewlog

View your orders: /am vieworder (output will be like: ORDERNUMBER | blah blah blah)

Cancel an order: /am cancelorder ORDERNUMBER e.g. /am cancelorder 1

Move all the stuff in your buffer into your inventory: /am refreshbuffer

Once the deal is concluded, your money/item will be put into your buffer. use /am refreshbuffer to get them back.

arsdragonfly@gmail.com
Last edited by arsdragonfly on Sat May 31, 2014 13:17, edited 2 times in total.

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

I recommend you change your commands to /am or amarket. Shorter.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

by arsdragonfly » Post

rubenwardy wrote:I recommend you change your commands to /am or amarket. Shorter.
Updated.
https://github.com/arsdragonfly/advance ... 6a08e511b9

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

arsdragonfly wrote:
rubenwardy wrote:I recommend you change your commands to /am or amarket. Shorter.
Updated.
https://github.com/arsdragonfly/advance ... 6a08e511b9
Not to mean anything, but my money mod uses craftitem money, not virtual accounts, intentionally, because I don't like the virtual account concept, it is too easily tweaked by admin.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

You can go into players/name.txt and edit their inventory.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

rubenwardy wrote:You can go into players/name.txt and edit their inventory.
Not if they keep their money in a chest
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

by arsdragonfly » Post

Dan Duncombe wrote:
rubenwardy wrote:You can go into players/name.txt and edit their inventory.
Not if they keep their money in a chest
For the safety of your personal account, you can use your "virtual" money to buy any item which you think is valuable.
Manipulating a craftitem-based market is as easy as /giveme blah blah blah and /am buy(or sell) blah blah blah :P
Also, virtual money can be easily divided. This is a great advantage as well.
E.g. suggest cobblestone worth 0.01$/brick , 0.01craftitemoney/brick, buying 50 cobblestone would be harder on a craftitem-based market.

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

arsdragonfly wrote:
Dan Duncombe wrote:
rubenwardy wrote:You can go into players/name.txt and edit their inventory.
Not if they keep their money in a chest
For the safety of your personal account, you can use your "virtual" money to buy any item which you think is valuable.
Manipulating a craftitem-based market is as easy as /giveme blah blah blah and /am buy(or sell) blah blah blah :P
Also, virtual money can be easily divided. This is a great advantage as well.
E.g. suggest cobblestone worth 0.01$/brick , 0.01craftitemoney/brick, buying 50 cobblestone would be harder on a craftitem-based market.
You can't use giveme if you don't have the priv. Anyway, you could just give yourself 50 diamonds and sell them to the server admin and cheat that way.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

by arsdragonfly » Post

Updated!

User avatar
Krock
Developer
Posts: 4652
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

arsdragonfly wrote:Updated!
Cool, please also update image previews, they're down :/
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

by arsdragonfly » Post

Krock wrote:
arsdragonfly wrote:Updated!
Cool, please also update image previews, they're down :/
Are they ok now?

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

by arsdragonfly » Post

bump

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

Re: [mod] AdvancedMarket [advanced_market]

by arsdragonfly » Post

Update and bump!

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

Re: [mod] AdvancedMarket [advanced_market]

by arsdragonfly » Post

Updated. Now with fewer bugs.

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [mod] AdvancedMarket [advanced_market]

by rubenwardy » Post

Usually with stock markets you put limits on it, rather than a set price. Like, I want to sell for no less than £5. I want to buy for no more than £6 pounds.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

Re: [mod] AdvancedMarket [advanced_market]

by arsdragonfly » Post

rubenwardy wrote:Usually with stock markets you put limits on it, rather than a set price. Like, I want to sell for no less than £5. I want to buy for no more than £6 pounds.
That's the way it works. You can try it out yourself by wash buying/selling.

arsdragonfly
Member
Posts: 31
Joined: Wed May 01, 2013 07:55

Re: [mod] AdvancedMarket [advanced_market]

by arsdragonfly » Post

Mod updated with some tweaks/fixes.

User avatar
Anonymous_moose
Member
Posts: 39
Joined: Tue Aug 27, 2013 20:25

Re:

by Anonymous_moose » Post

Dan Duncombe wrote:
rubenwardy wrote:You can go into players/name.txt and edit their inventory.
Not if they keep their money in a chest
Anyone can get it if it is in a chest.
A locked chest, on the other hand....

User avatar
programmingchicken
Member
Posts: 540
Joined: Sat Apr 18, 2015 02:20
GitHub: pchicken
IRC: chicken pchicken
Location: not here
Contact:

Re: Re:

by programmingchicken » Post

Anonymous_moose wrote:
Dan Duncombe wrote:
rubenwardy wrote:You can go into players/name.txt and edit their inventory.
Not if they keep their money in a chest
Anyone can get it if it is in a chest.
A locked chest, on the other hand....
Can be edited with a mod to default_game and a priv.
<gamerdude> I apologize for the above content

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

Re: [mod] AdvancedMarket [advanced_market]

by prestidigitator » Post

Pretty cool. I'd suggest renaming "refreshbuffer" to something more user-centric and more intuitive, and possibly enhancing and breaking it up into smaller functions, with the understanding that the amount of stuff being handled by a user at any one time might grow quite a bit beyond test scenarios. Also an "account" metaphor might make more sense to many users than "buffer". Maybe something like:

Code: Select all

/am deposit
-> Put 5 default:wood from hand into account (5 in stock)

/am balance
-> $0
-> 5 default:wood

/am sell all default:wood for $5
-> Selling default:wood for $5 each (5 in stock, no limit)

/am orders
-> Selling default:wood for $5 each (5 in stock, no limit)

-> Henry bought 3 default:wood for $5 each ($15 total)

/am balance
-> $15
-> 2 default:wood

/am withdraw all default:wood
-> Withdrew 2 default:wood from account into inventory (0 in stock)

/am orders
-> Selling default:wood for $5 each (0 in stock, no limit)

/am deposit
-> Put 10 wool:white from hand into account

/am deposit
-> Put 4 default:steel_ingot from hand into account

/am balance
-> $15
-> 10 wool:white
-> 4 default:steel_ingot

/am sell 2 wool:white for $10
-> Selling wool:white for $10 each (10 in stock, limit 2)

/am sell all default:steel_ingot for $50
-> Selling default:steel_ingot for $50 (4 in stock, no limit)

/am buy all default:steel_ingot for $40
-> Buying default:steel_ingot for $40 (4 in stock, no limit)

-> Henry bought 1 wool:white for $10

/am balance
-> $25
-> 9 wool:white
-> 4 default:steel_ingot

/am orders
-> Selling default:wood for $5 each (0 in stock, no limit)
-> Selling wool:white for $10 each (9 in stock, limit 1)
-> Selling default:steel_ingot for $50 each (4 in stock, no limit)
-> Buying default:steel_ingot for $40 each (4 in stock, no limit)

-> Henry bought 2 default:steel_ingot

/am sell 0 wool:white
-> Canceling sale of wool:white

-> Bought 3 default:steel_ingot from Stan for $38 each ($114 total)
-> Henry bought 5 default:steel_ingot for $50 each ($250 total)

/am buy 10 default:mese_crystal for $100
-> Buying default:mese_crystal for $100 each (0 in stock, limit 10)

/am buy 5 default:mese_crystal
-> Buying default:mese_crystal for $100 each (0 in stock, limit 5)

/am orders
-> Selling default:wood for $5 each (0 in stock, no limit)
-> Selling default:steel_ingot for $50 each (0 in stock, no limit)
-> Buying default:steel_ingot for $40 each (0 in stock, no limit)
-> Buying default:mese_crystal for $100 each (0 in stock, limit 5)
(It's pointless to worry about what admins can do. Admins control mods, not the other way around. While mods should be designed to make it difficult to accidentally do something destructive, they should ultimately be focused on empowering admins rather than limiting them.)

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests