Page 1 of 1

Mod Request: Currency

PostPosted: Wed Mar 07, 2012 02:17
by jordan4ibanez
Here's a little snippet of my idea:
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_on_newplayer will check if a person has a "bank account" if the search for the file is nil then it creates a "bank account" file and a "savings account" file in the format YOURNAME:savings YOURNAME:account

bank block - basically an ATM ..looks like an ATM, functions like an ATM

/balance - displays balance in $ from the "bank account" file

/deposit - deposit money into the "bank" if a person is pointed at a "bank block"
(this would store it in the "savings" file, and every time TIME = 0 then it would add on 10% into the "savings")

store block - this is an ABM
-If pointed to, you can type in /store FOLDER:BLOCKNAME buy/sell , which in a real world scenario would look like /store default:dirt 10/5
(but if pointed_thing = NIL then return "minetest.chat_send_player(player:get_player_name(), "There is no way to sell this!")"
-When the command "/store" is sent, the player who sent the command will become the "store owner" of the store block
-When the command "/store" sent to the server, the store block will react by creating another store block on top of it with a sign that will read Buy:THEBUYNUMBER Sell:THESELLNUMBER on the front of it, also an unbreakable representation of the block youve posted to sell will be created in front of the original store block
-The sign created is not editable
-All parts of the store block (as a whole when its "in use") are indestructible by anyone who is not the "store owner" (they will break it and it will reappear just as it was)
-If the bank blocks sign is broken by the "store owner", then the bank block ABM will remove the sign,the top bank block, and the representation, and anyone will be able to claim the blank store block
-On right click of the store block sign, it will check if that block is in your inventory, if this is true, then that item will be "sold" at to the store block (aka it will remove 1 of that block from your inventory and then it will add in the "SELL" amount that the store block is defined as)
-On left click (aka punch) of the store block sign, the server will check your inventory, if you do not have enough money then  the server will do:
minetest.chat_send_player(player:get_player_name(), "Not enough money!")
else if there is enough money, then it will deduct the amount of money in the "BUY" amount that the block is defined as and it will add in 1 of that block into your inventory

Jobs too?

any mod dev's want to take this challenge up?

PostPosted: Wed Mar 07, 2012 02:30
by RabbiBob
You may want to drop Jachoo a line. I would suggest building it on top of its own sqlite db to manage the money storage and he was openly looking for projects.

PostPosted: Wed Mar 07, 2012 02:32
by jordan4ibanez
well hopefully he sees this and gives it a shot

PostPosted: Wed Mar 07, 2012 03:11
by bob
oi im having a look at something similar in the future for mese_advanced_kit!

PostPosted: Wed Mar 07, 2012 03:43
by jordan4ibanez
oooo :D

PostPosted: Wed Mar 07, 2012 15:47
by sfan5
jordan4ibanez wrote:Here's a little snippet of my idea:
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_on_newplayer will check if a person has a "bank account" if the search for the file is nil then it creates a "bank account" file and a "savings account" file in the format YOURNAME:savings YOURNAME:account

bank block - basically an ATM ..looks like an ATM, functions like an ATM

/balance - displays balance in $ from the "bank account" file

/deposit - deposit money into the "bank" if a person is pointed at a "bank block"
(this would store it in the "savings" file, and every time TIME = 0 then it would add on 10% into the "savings")

store block - this is an ABM
-If pointed to, you can type in /store FOLDER:BLOCKNAME buy/sell , which in a real world scenario would look like /store default:dirt 10/5
(but if pointed_thing = NIL then return "minetest.chat_send_player(player:get_player_name(), "There is no way to sell this!")"
-When the command "/store" is sent, the player who sent the command will become the "store owner" of the store block
-When the command "/store" sent to the server, the store block will react by creating another store block on top of it with a sign that will read Buy:THEBUYNUMBER Sell:THESELLNUMBER on the front of it, also an unbreakable representation of the block youve posted to sell will be created in front of the original store block
-The sign created is not editable
-All parts of the store block (as a whole when its "in use") are indestructible by anyone who is not the "store owner" (they will break it and it will reappear just as it was)
-If the bank blocks sign is broken by the "store owner", then the bank block ABM will remove the sign,the top bank block, and the representation, and anyone will be able to claim the blank store block
-On right click of the store block sign, it will check if that block is in your inventory, if this is true, then that item will be "sold" at to the store block (aka it will remove 1 of that block from your inventory and then it will add in the "SELL" amount that the store block is defined as)
-On left click (aka punch) of the store block sign, the server will check your inventory, if you do not have enough money then  the server will do:
minetest.chat_send_player(player:get_player_name(), "Not enough money!")
else if there is enough money, then it will deduct the amount of money in the "BUY" amount that the block is defined as and it will add in 1 of that block into your inventory

Jobs too?

any mod dev's want to take this challenge up?

Awesome Idea!

PostPosted: Wed Mar 07, 2012 18:55
by Gatharoth
This is already done. Although, it's no longer supported by its original creator. He deleted the post for some reason.

http://www.mediafire.com/?d41zp5zinzdcba8

this is the download link which still works.

It contains a simple currency mod, + an atm mod added to it. The atm mod does exactly what you're wanting.

Proof of it being real, read this post


Edit: Note that the atm mod that was added was not by the original create of the currency (aka money) mod.

PostPosted: Wed Mar 07, 2012 19:04
by jordan4ibanez
Gatharoth wrote:This is already done. Although, it's no longer supported by its original creator. He deleted the post for some reason.

http://www.mediafire.com/?d41zp5zinzdcba8

this is the download link which still works.

It contains a simple currency mod, + an atm mod added to it. The atm mod does exactly what you're wanting.

Proof of it being real, read this post


Edit: Note that the atm mod that was added was not by the original create of the currency (aka money) mod.

no what i mean is just having currency...like the minecraft server mod..no coins.. like if you hit /balance it states your current balance

PostPosted: Wed Mar 07, 2012 19:15
by Gatharoth
jordan4ibanez wrote:no what i mean is just having currency...like the minecraft server mod..no coins.. like if you hit /balance it states your current balance


Currency with out a physical form is nothing then but a bunch of numbers. So if you don't want coins, change it then. But the basics are all there. You can change how you check the balance by replacing hitting the check block, to a chat event.

Everything you want is there. You just have to change the base to get it.

Plus, the currency mod I found for minecraft anyway, uses coins and tokens. So I doubt it's the one your talking about so I don't know.

PostPosted: Wed Mar 07, 2012 19:34
by sfan5
jordan4ibanez means something like iConomy for Bukkit

PostPosted: Wed Mar 07, 2012 19:50
by Gatharoth
sfan5 wrote:jordan4ibanez means something like iConomy for Bukkit



Still, the base for it is still there. Take out the money mod, and modify the atm mod.

The atm mod will help him get started, he just needs to finish it. :P All of the database stuff is done, he'll just need to add chat commands.


So something like this to check balance.
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_on_chat_message(function(name, message)
    if message == '/balance' then
          GetAccountBalance(name)
        end
end)


The GetAccountBalance is a function inside the atm mod, which requires the player's name.

You can also add chat commands to adding to account, as well as taking from account for say paying.

The rest is just some modding you need to do.

You know what, hell with it, I'll mod it and send it XP

PostPosted: Wed Mar 07, 2012 19:50
by sfan5
Gatharoth wrote:
sfan5 wrote:jordan4ibanez means something like iConomy for Bukkit



Still, the base for it is still there. Take out the money mod, and modify the atm mod.

The atm mod will help him get started, he just needs to finish it. :P All of the database stuff is done, he'll just need to add chat commands.


So something like this to check balance.
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_on_chat_message(function(name, message)
    if message == '/balance' then
          GetAccountBalance(name)
        end
end)


The GetAccountBalance is a function inside the atm mod, which requires the player's name.

You can also add chat commands to adding to account, as well as taking from account for say paying.

The rest is just some modding you need to do.

You know what, hell with it, I'll mod it and send it XP

Good Idea

PostPosted: Wed Mar 07, 2012 20:27
by Gatharoth
Alright, chat messages are done. Now the question I have, is what do you mean by store block?

Like the AuTomated Trader mod from tinoesroho?

For the signs that is easy, I'll just make another "sign" item that isn't craft-able, that way it will display the buy/sell names, but isn't editable.