Chep : Simple cash exchanger
Hello everyone!
Here's my mod which adds simple cash exchanger.
It's been a while since I created it but I couldn't reach minetest's forums then for a number of reasons. But I think it's nevertheless just right to post this mod here, at the heart of minetest community.
License:
WTFPL for all, but default stone texture, 'cause it's "default" ;)
Download:
chep.zip
Dependencies:
Description:
This mod adds 2 new blocks: "cash_xchanger" and "misc".
The first one is a "tool" to exchange your valuable ores/ingots:
Also exchanger has some protection from cheating, like placing 99 mese in the "from" slot and then swap it to some useless trash like "misc". Anyway, you're wellcome to try ;)
Some screens:
Craft:

What does it look like outside (default stone texture + "face panel" drawn by me):

What does it look like inside:

Usage:
1. Put anything in the left slot and press button in the middle of form. Button's caption would change and you will be given a message, explaining what could you get. Plus, all the ratings are listed above the exchangement slot, so it's hard to get confused ;)
2. Once you're ready - press "convert" button and grab your item from the second slot. Voila! ;)
"Misc" is worth of 1 MT as well, as the most other blocks.
Some "technical" notes and known issues:
1. Keep in mind, that if you have 30fps or less, you shouldn't expect "speed C velocity" ( (c) one of the Prism Rangers) from the exchanger. It uses "on receive filelds" method, implemented in 0.4.2 which isn't very fast, but it works like a charm ;)
2. This mod contains some code, that is unnecessary for it to work properly. Why? Well, This version is "clipped". I planned to create some kind of banking system, so each player could create it's own exchanger with his own exchange rates (using "linked" user owned locked chests). But it had started to took too much time (1. I'm still new to lua; 2. I really need to do my course paper and so ;)
So I edited the source code to work with global values only.
3. Yes, at the time only "server" could change rates by editing the "banks.txt" file or by editing the "init.lua" file directly.
4. I hadn't find the way to change all exchanger's ratings after changing them in one of the files mentioned earlier, though.
I don't really want to store all exchanger coordinates and check them on "on tick" in order to make ratings be equal to the ones in config. So, for now only break&place-it-again method works.
5. Current state of this mod is "unfinished till some request", which means that "I have some ideas about improving this mod, but currently busy with other activities" and "I don't want to do anything that no one needs".
Please, post your opinion and/or ideas/suggestions and I see, what could be done ;)
Here's my mod which adds simple cash exchanger.
It's been a while since I created it but I couldn't reach minetest's forums then for a number of reasons. But I think it's nevertheless just right to post this mod here, at the heart of minetest community.
License:
WTFPL for all, but default stone texture, 'cause it's "default" ;)
Download:
chep.zip
Dependencies:
- Default
- Moreores
- Minetest 0.4.2 or higher
Description:
This mod adds 2 new blocks: "cash_xchanger" and "misc".
The first one is a "tool" to exchange your valuable ores/ingots:
- - mythril
- - mese
- - gold
- - silver
- - bronze
- - copper
- - steel
and the last (but certainly not least) - - tin
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
default_misc_value = 1 -- everything could be exchanged for ores, yet the price is dear...
default_tin_value = 5
default_steel_value = 10
default_copper_value = 30
default_bronze_value = 45
default_silver_value = 100
default_gold_value = 1000
default_mese_value = 5000
default_mythril_value = 10000
Also exchanger has some protection from cheating, like placing 99 mese in the "from" slot and then swap it to some useless trash like "misc". Anyway, you're wellcome to try ;)
Some screens:
Craft:

What does it look like outside (default stone texture + "face panel" drawn by me):

What does it look like inside:

Usage:
1. Put anything in the left slot and press button in the middle of form. Button's caption would change and you will be given a message, explaining what could you get. Plus, all the ratings are listed above the exchangement slot, so it's hard to get confused ;)
2. Once you're ready - press "convert" button and grab your item from the second slot. Voila! ;)
"Misc" is worth of 1 MT as well, as the most other blocks.
Some "technical" notes and known issues:
1. Keep in mind, that if you have 30fps or less, you shouldn't expect "speed C velocity" ( (c) one of the Prism Rangers) from the exchanger. It uses "on receive filelds" method, implemented in 0.4.2 which isn't very fast, but it works like a charm ;)
2. This mod contains some code, that is unnecessary for it to work properly. Why? Well, This version is "clipped". I planned to create some kind of banking system, so each player could create it's own exchanger with his own exchange rates (using "linked" user owned locked chests). But it had started to took too much time (1. I'm still new to lua; 2. I really need to do my course paper and so ;)
So I edited the source code to work with global values only.
3. Yes, at the time only "server" could change rates by editing the "banks.txt" file or by editing the "init.lua" file directly.
4. I hadn't find the way to change all exchanger's ratings after changing them in one of the files mentioned earlier, though.
I don't really want to store all exchanger coordinates and check them on "on tick" in order to make ratings be equal to the ones in config. So, for now only break&place-it-again method works.
5. Current state of this mod is "unfinished till some request", which means that "I have some ideas about improving this mod, but currently busy with other activities" and "I don't want to do anything that no one needs".
Please, post your opinion and/or ideas/suggestions and I see, what could be done ;)