[Mod] Item sell/buy system / banking (for servers) [economy]

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

[Mod] Item sell/buy system / banking (for servers) [economy]

by orwell » Tue Feb 23, 2016 21:53

Yet another money system!
Warning! This is not intended for singleplayer use! The machines need to be protected using area protection mods like denaid or areas!
This mod adds three new machines to Minetest:
+ Vending machine
+ Banking machine
+ Vending machine(player-controlled, craftable)

The currency used is TestDollar, abbreviated by the Unicode character ŧ (a 't' with 2 horizontal dashes). TestDollar do not exist as items and are only present as value on a virtual bank account.
The machines do not have crafting recipes, get them by /giveme-ing economy:vending or economy:bank
Of course there is an API to interface with the TestDollar money system. See documentation in readme.txt inside mod directory. Depend on this mod to use.

Depends on:
default
dye
(only for the crafting)

License:
Code: LGPL 3.0 (Node definition for the machines by VanessaE (homedecor soda vending machine))
Machine model and textures(modified) by VanessaE (homedecor soda vending machine): CC-by-SA 3.0

Now on github: https://github.com/orwell96/economy

Download:
economy_1_2.zip
v. 1.2
(21.78 KiB) Downloaded 267 times

added intllib support and German translation
added administrative chat commands
fixed stuff

Older versions:
economy_1_1.zip
v. 1.1
(17.2 KiB) Downloaded 245 times

added player controlled vending machines

economy_1_0.zip
v. 1.0
(9.2 KiB) Downloaded 213 times

Initial release
Last edited by orwell on Sat May 28, 2016 21:27, edited 7 times in total.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
mahmutelmas06
Member
 
Posts: 355
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by mahmutelmas06 » Wed Feb 24, 2016 23:15

First of all thanks for the mod

Instead of new money, you could have used bitchange and currency mods moneys.
My Mods:

Beverage
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by orwell » Thu Mar 10, 2016 21:45

v. 1.1 released
Included player-controlled vending machines.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
ErrorNull
Member
 
Posts: 94
Joined: Thu Mar 03, 2016 00:43

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by ErrorNull » Mon Mar 28, 2016 15:04

nice! i will definitely try this out.. been looking for a mod like this for my server.
 

User avatar
linushsao
Member
 
Posts: 331
Joined: Mon Jan 27, 2014 12:56
IRC: linushsao
In-game: linus

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by linushsao » Tue Mar 29, 2016 11:37

awesome,i like selling machine.it maybe used to create some "minetest offical shop" for some material of items(ex. for technic/mesecons) for players. players could have choice to dig by himself or buy from "minetest offical shop".

and players could exchange money by items no longer needed.

i really need this mod.

but the bank machine could not let me transfer money to other players, only could transfer to myself.(i has create other players for test).

Image
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by orwell » Fri Apr 01, 2016 12:37

Ok thanks, i will check that ASAP.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by orwell » Wed May 04, 2016 16:04

Version 1.2
added intllib support and German translation
added administrative chat commands
fixed stuff
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
AnxiousInfusion
Member
 
Posts: 146
Joined: Sun Aug 02, 2015 05:43
GitHub: AnxiousInfusion[GitLab]
IRC: AnxiousInfusion
In-game: AnxiousInfusion

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by AnxiousInfusion » Fri Aug 19, 2016 05:57

Nice! I like that it doesn't just take the lazy route of operating through chat. I always felt the players should need to travel to a physical location to do things like buying or selling. Does this support 0.4.14?
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by orwell » Fri Aug 19, 2016 09:07

To Do List:
Remove a possible 'cheat' (I won't tell you what it's about, but server safety is not in danger)
create interfaces for 'hard-money' mods.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
AnxiousInfusion
Member
 
Posts: 146
Joined: Sun Aug 02, 2015 05:43
GitHub: AnxiousInfusion[GitLab]
IRC: AnxiousInfusion
In-game: AnxiousInfusion

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by AnxiousInfusion » Thu Sep 01, 2016 06:54

I have decided to implement your mod on my server. I've made some tweaks, maybe you will want or not. It is important to me that players are able to set up their own town banks so I have added a crafting recipe for the banking machine:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_craft({
   output = "economy:bank",
   recipe = {
      {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
      {"dye:blue", "dye:cyan", "dye:blue"},
      {"default:steel_ingot", "default:copperblock", "default:steel_ingot"},
   },
})


I have also redone the inventory images to better match the art style. Files attached:
Attachments
economy_vending_inv.png
economy_vending_inv.png (639 Bytes) Viewed 7393 times
economy_playervendor_inv.png
economy_playervendor_inv.png (703 Bytes) Viewed 7393 times
economy_bank_inv.png
economy_bank_inv.png (590 Bytes) Viewed 7393 times
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by christoferlevich » Mon Feb 20, 2017 16:44

I have started messing with this mod for an educational purpose but I have two minor issues I am hoping someone might be able to help with... the first is this: I have been able to add a decimal to the currency and created nodes for us coins and bills.

1) Everything seems to be working well until the balance is '.00' In other words, one dime and one cent displays as "$.11" but a single dime it displays as '.1'. Any idea on how to get it to show ".10"? Maybe an invisible wildcard character?

2) Is there anyway to create an atm to accept the us currency nodes in trade for an automatic deposit into the players banking account? I can accept the nodes in game manually and add the currency via chat, but it seems like an automated atm would be better.
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by christoferlevich » Mon Feb 20, 2017 17:49

I messed up and dont know how to delete my post
Last edited by christoferlevich on Mon Feb 20, 2017 21:36, edited 1 time in total.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by Byakuren » Mon Feb 20, 2017 18:37

christoferlevich wrote:1) Everything seems to be working well until the balance is '.00' In other words, one dime and one cent displays as "$.11" but a single dime it displays as '.1'. Any idea on how to get it to show ".10"? Maybe an invisible wildcard character?

You can use string.format to get a properly formatted string. e.g.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local str = string.format("%2.2f", 4.4)


Also I would be careful with using vanilla floating point numbers for money, since you might accumulate precision errors. The best method would be to store the number of cents as an integer and just divide it by 100 when you display it.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by orwell » Mon Feb 20, 2017 19:17

I have not been working on this mod for a long time. There are some other alternatives around which can keep up to and are better than my mod in some aspects, some are worse. I also won't continue developing this except if you have revolutionary ideas.
+ Spoiler
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by Byakuren » Mon Feb 20, 2017 21:06

Every time a mod API is left undocumented, a koala dies.
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by christoferlevich » Mon Feb 20, 2017 21:40

Byakuren wrote:You can use string.format to get a properly formatted string. e.g.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
local str = string.format("%2.2f", 4.4)


Also I would be careful with using vanilla floating point numbers for money, since you might accumulate precision errors. The best method would be to store the number of cents as an integer and just divide it by 100 when you display it.


Well, I am trying to do it by counting everything as a penny (us) so 100 pennies is a dollar, etc. There are a lot of things I'd like to do with this mod that would make an educational server hum, but its going to take time for me to figure out how to do it.
 

christoferlevich
Member
 
Posts: 55
Joined: Thu Dec 01, 2016 23:44

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by christoferlevich » Mon Feb 20, 2017 21:49

orwell wrote:I have not been working on this mod for a long time. There are some other alternatives around which can keep up to and are better than my mod in some aspects, some are worse. I also won't continue developing this except if you have revolutionary ideas.


Its actually working pretty well for what I need except I would also like to use it to have my imaginary shops have the ability to purchase items back at a user defined price. In the world we set up, for instance, we created items to represent coins and bills but they can't be physically 'sold' to a back to put the monetary amount into the accounts. Nothing really revolutionary. If I can figure out how to make a vending machine that does purchasing I'll be set.
 

Michael Eh?
Member
 
Posts: 282
Joined: Sun Jan 01, 2012 17:21

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by Michael Eh? » Thu Mar 30, 2017 05:36

Tried the player vending machine. It's okay but I would like to define quantity sold and price. I can add pine cone nuts but all for one price... not lets say 25 for 10t
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by orwell » Thu Mar 30, 2017 10:56

I am not really developing this mod anymore. There are some better cash mods out there, I would recommend Minegeld.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

gpcf
Member
 
Posts: 57
Joined: Fri May 27, 2016 10:48
In-game: gabriel

Re: [Mod] Item sell/buy system / banking (for servers) [econ

by gpcf » Fri Mar 31, 2017 14:34

The mod that provides minegeld is called currency. See https://github.com/minetest-mods/currency.
 


Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 15 guests

cron