A few updates

master
DonBatman 2015-04-29 07:23:03 -07:00
parent be3601dc24
commit 79d615bea4
7 changed files with 133 additions and 249 deletions

View File

@ -15,61 +15,6 @@ This mod will add bitcoins to your map, (NOT REAL BITCOINS) but the basic idea o
My first mod for minetest, I plan to expand this mod a bit more as time permits..
Tested on both stable and development releases of Minetest with no other mods, no issues were found.
please contact me by the above email if you have any issues with adding or using this mod.
Installation:
Copy the bitcoin folder to the mod folder and begin mining bitcoins...
Noet: The following recipes also include a fee (top right corner) for the conversion of all denominations into Bitcoins,
Bitcents to bitcoins can only be traided up and not down. <- may change if needed.
Crafting:
x = Bitcent
O O X
X X O = 1 Bitnickel
X X X
X = Bitcent y = Bitnickel
O O X
O Y O = 1 Bitdime
O Y O
X = Bitnickel y = Bitdime z = Bitnickel
O X X
O Y O = 1 Bitquarter
O Y O
X = Bitcent y = Bitdime z = Bitnickel
X Y X
X Y O = 1 Bitquarter
X X X
x = Bitdime y = Bitquarter
O O X
O Y O = 1 Bitcoin
Y Y Y
X = Bitcoins
X X X
X X X = 1 Bitcoin Block
X X X
3/9/13 Added denominations of bitcoin Bitcent,Bitnickel,Bitdime,Bitquarter.
3/9/13 Added corresponding ors for the new coins.
3/9/13 All new textures made from scratch by me using gimp..
@ -82,13 +27,13 @@ X X X
11/30/13 added game computer and alienware comptuer
12/01/13 changed recipes for all pomputer components
12/02/13 created all new images for all computers
26th March 2014, Removed Homedecor, Mesecons and Moreores dependencies (TenPlus1), reduced abm's to only 2
April 2015, Updates by DonBatman and Nathan.S Removed all ABMs, updated the mod to work with current versions of Minetest, improved code and added more visual feedback.
April 2015, Updates by DonBatman and Nathan.S Removed all ABMs, updated the mod to work with current versions
of Minetest, improved code and added more visual feedback.
04/25/15 added on punch functionality to all computers and computers now turn off when player is logged out,
player now must punch computer to reboot and mine coins again. MilesDyson
04/28/15 added router that can turn on and off, computers now require a router to be within 30 node radius
in order to mine bitcoins.
04/29/15 added forspec to router to show network information..
Enjoy!! :D

38
ReadMe.txt~ Normal file
View File

@ -0,0 +1,38 @@
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- +
--bitcoins v2.0 by MilesDyson@DistroGeeks.com +
-- +
--LICENSE: WTFPL DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE; applies to all parts. +
-- +
--Have ideas on ways to make this mod better? email me at milesdyson@distrogeeks.com +
-- +
--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This mod will add bitcoins to your map, (NOT REAL BITCOINS) but the basic idea of bitcoins..
My first mod for minetest, I plan to expand this mod a bit more as time permits..
3/9/13 Added denominations of bitcoin Bitcent,Bitnickel,Bitdime,Bitquarter.
3/9/13 Added corresponding ors for the new coins.
3/9/13 All new textures made from scratch by me using gimp..
3/10/13 added wallet - no fees
3/28/13 adjusted depths and generation rate of the ore.
10/28/13 adjusted depths of the ore.
11/27/13 removed ores, ingots, wallet and block. added home computer
11/28/13 rewrite of abm's
11/29/13 modified all bitcoin recipe
11/30/13 added game computer and alienware comptuer
12/01/13 changed recipes for all pomputer components
12/02/13 created all new images for all computers
26th March 2014, Removed Homedecor, Mesecons and Moreores dependencies (TenPlus1), reduced abm's to only 2
April 2015, Updates by DonBatman and Nathan.S Removed all ABMs, updated the mod to work with current versions
of Minetest, improved code and added more visual feedback.
04/25/15 added on punch functionality to all computers and computers now turn off when player is logged out,
player now must punch computer to reboot and mine coins again. MilesDyson
04/28/15 added router that can turn on and off, computers now require a router to be within 30 node radius
in order to mine bitcoins.
Enjoy!! :D

View File

@ -406,7 +406,14 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "mycoins:router";
recipe = {
{ "default:steel_ingot", "homedecor:ic", "default:steel_ingot", },
{ "homedecor:ic", "default:mese", "homedecor:ic", },
{ "homedecor:plastic_base", "homedecor:plastic_base", "homedecor:plastic_base", },
};
});

View File

@ -222,13 +222,14 @@ minetest.override_item("default:stone",{
max_items = 2,
items = {
{
items = {"default:stone 1"},
items = {"default:cobble 1"},
rarity = 1,
},
{
items = {"mycoins:bitcent 1"},
rarity = 8,
rarity = 25,
},
}
}
})

216
nodes.lua
View File

@ -8,8 +8,14 @@ end
function default.computer_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec = "size[10,10]"..
"label[2,2;Booting a proprietary OS, this could take a while...]" ..
local formspec = "size[10,10]"..
"image[1,0.5;1.2,1.2;tux.png]"..
"label[2,0.8;Initializing basic system settings ... OK]" ..
"label[2,1.1;Mounting local filesystems ... OK]" ..
"label[2,1.4;Enabling swap space ... OK]" ..
"label[2,1.7;Setting up console ... OK]" ..
"label[2,2;Operaing System Loaded ... OK]" ..
"label[2,2.3;Starting cgminer 3.7.2 ]" ..
"list[nodemeta:".. spos .. ";main;1,3;8,1;]"..
"list[current_player;main;1,6;8,4;]"
return formspec
@ -26,9 +32,14 @@ end
function default.active_computer_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec = "size[10,10]"..
"label[2,2;Mining coins.]" ..
"label[2,2.5;Upgrade your computer to mine faster.]" ..
local formspec = "size[10,10]"..
"label[2,0.0;cgminer version 3.7.2 - Started]" ..
"label[2,0.2;----------------------------------------------------------------------------------]" ..
"label[2,0.4;5s:468.9K avg:468.8Kh/s : A:2304 R:0 HW:0 WU:394.4/m]" ..
"label[2,0.7;ST: 2 SS: 0 NB: 1909 LW: 34901 GF: 14 RF: 7]" ..
"label[2,1;Connected to stratum.max.bitcoin.com diff 1.02k with stratum.]" ..
"label[2,1.3;Block: 31dca6d... Diff:104 Started: 09:24:05 Best share: 618K.]" ..
"label[2,1.5;----------------------------------------------------------------------------------]" ..
"list[nodemeta:".. spos .. ";main;1,3;8,1;]"..
"list[current_player;main;1,6;8,4;]"
return formspec
@ -44,20 +55,11 @@ function default.computer_wifi_formspec(pos)
return formspec
end
-- Home Computer
minetest.register_node("mycoins:home_computer",{
drawtype = "nodebox",
description = "Home Computer",
tiles = {"mycoins_home_computer_tp.png",
"mycoins_home_computer_bt.png",
"mycoins_home_computer_rt.png",
"mycoins_home_computer_lt.png",
"mycoins_home_computer_bk.png",
"mycoins_home_computer_ft_off.png"},
tiles = {"mycoins_home_computer_tp.png","mycoins_home_computer_bt.png","mycoins_home_computer_rt.png","mycoins_home_computer_lt.png","mycoins_home_computer_bk.png","mycoins_home_computer_ft_off.png"},
paramtype = "light",
paramtype2 = "facedir",
drop = "mycoins:home_computer",
@ -70,7 +72,6 @@ minetest.register_node("mycoins:home_computer",{
{-0.500000,-0.500000,-0.500000,0.500000,-0.375,-0.03125},
},
},
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
@ -168,15 +169,7 @@ minetest.register_node("mycoins:home_computer",{
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not computer_owner(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
@ -189,30 +182,12 @@ minetest.register_node("mycoins:home_computer",{
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in home computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to home computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from home computer at "..minetest.pos_to_string(pos))
end,
})
minetest.register_node("mycoins:home_computer_active",{
drawtype = "nodebox",
description = "Home Computer",
tiles = {"mycoins_home_computer_tp.png",
"mycoins_home_computer_bt.png",
"mycoins_home_computer_rt.png",
"mycoins_home_computer_lt.png",
"mycoins_home_computer_bk.png",
"mycoins_home_computer_ft.png"},
tiles = {"mycoins_home_computer_tp.png","mycoins_home_computer_bt.png","mycoins_home_computer_rt.png","mycoins_home_computer_lt.png","mycoins_home_computer_bk.png","mycoins_home_computer_ft.png"},
paramtype = "light",
paramtype2 = "facedir",
light_source = 8,
@ -227,7 +202,6 @@ minetest.register_node("mycoins:home_computer_active",{
},
},
sounds = default.node_sound_wood_defaults(),
on_timer = function(pos)
local meta = minetest.get_meta(pos)
if ( minetest.get_player_by_name(meta:get_string("owner")) == nil ) then
@ -272,8 +246,7 @@ minetest.register_node("mycoins:home_computer_active",{
local inv = meta:get_inventory()
inv:set_size("main", 4*2)
timer:stop()
end,
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
@ -291,15 +264,7 @@ minetest.register_node("mycoins:home_computer_active",{
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not computer_owner(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
@ -312,31 +277,13 @@ minetest.register_node("mycoins:home_computer_active",{
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in home computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to home computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from home computer at "..minetest.pos_to_string(pos))
end,
})
-- Game Computer
minetest.register_node("mycoins:game_computer",{
drawtype = "nodebox",
description = "Gaming Computer",
tiles = {"mycoins_game_computer_tp.png",
"mycoins_game_computer_bt.png",
"mycoins_game_computer_rt.png",
"mycoins_game_computer_lt.png",
"mycoins_game_computer_bk.png",
"mycoins_game_computer_ft_off.png"},
tiles = {"mycoins_game_computer_tp.png","mycoins_game_computer_bt.png","mycoins_game_computer_rt.png","mycoins_game_computer_lt.png","mycoins_game_computer_bk.png","mycoins_game_computer_ft_off.png"},
paramtype = "light",
paramtype2 = "facedir",
drop = "mycoins:game_computer",
@ -447,15 +394,7 @@ minetest.register_node("mycoins:game_computer",{
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not computer_owner(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
@ -468,30 +407,12 @@ minetest.register_node("mycoins:game_computer",{
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in gaming computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to gaming computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from gaming computer at "..minetest.pos_to_string(pos))
end,
})
minetest.register_node("mycoins:game_computer_active",{
drawtype = "nodebox",
description = "Home Computer",
tiles = {"mycoins_game_computer_tp.png",
"mycoins_game_computer_bt.png",
"mycoins_game_computer_rt.png",
"mycoins_game_computer_lt.png",
"mycoins_game_computer_bk.png",
"mycoins_game_computer_ft.png"},
tiles = {"mycoins_game_computer_tp.png","mycoins_game_computer_bt.png","mycoins_game_computer_rt.png","mycoins_game_computer_lt.png","mycoins_game_computer_bk.png","mycoins_game_computer_ft.png"},
paramtype = "light",
paramtype2 = "facedir",
light_source = 8,
@ -505,7 +426,6 @@ minetest.register_node("mycoins:game_computer_active",{
{-0.500000,-0.500000,-0.500000,0.500000,-0.375,-0.03125},
},
},
sounds = default.node_sound_wood_defaults(),
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
@ -569,15 +489,7 @@ minetest.register_node("mycoins:game_computer_active",{
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not computer_owner(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
@ -590,31 +502,13 @@ minetest.register_node("mycoins:game_computer_active",{
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in gaming computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to gaming computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from gaming computer at "..minetest.pos_to_string(pos))
end,
})
-- Alienware Computer
minetest.register_node("mycoins:alien_computer",{
drawtype = "nodebox",
description = "Alienware Computer",
tiles = {"mycoins_alien_computer_tp.png",
"mycoins_alien_computer_bt.png",
"mycoins_alien_computer_rt.png",
"mycoins_alien_computer_lt.png",
"mycoins_alien_computer_bk.png",
"mycoins_alien_computer_ft_off.png"},
tiles = {"mycoins_alien_computer_tp.png","mycoins_alien_computer_bt.png","mycoins_alien_computer_rt.png","mycoins_alien_computer_lt.png","mycoins_alien_computer_bk.png","mycoins_alien_computer_ft_off.png"},
paramtype = "light",
paramtype2 = "facedir",
drop = "mycoins:alien_computer",
@ -627,7 +521,6 @@ minetest.register_node("mycoins:alien_computer",{
{-0.500000,-0.500000,-0.500000,0.500000,-0.375,-0.03125},
},
},
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
@ -644,8 +537,7 @@ minetest.register_node("mycoins:alien_computer",{
meta:get_string("owner")..")")
local inv = meta:get_inventory()
inv:set_size("main", 4*2)
end,
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
return computer_owner(meta, player)
@ -727,15 +619,7 @@ minetest.register_node("mycoins:alien_computer",{
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not computer_owner(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a Alienware computer belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
@ -748,30 +632,12 @@ minetest.register_node("mycoins:alien_computer",{
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in Alienware computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to Alienware computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from Alienware computer at "..minetest.pos_to_string(pos))
end,
})
minetest.register_node("mycoins:alien_computer_active",{
drawtype = "nodebox",
description = "Alienware Computer",
tiles = {"mycoins_alien_computer_tp.png",
"mycoins_alien_computer_bt.png",
"mycoins_alien_computer_rt.png",
"mycoins_alien_computer_lt.png",
"mycoins_alien_computer_bk.png",
"mycoins_alien_computer_ft.png"},
tiles = {"mycoins_alien_computer_tp.png","mycoins_alien_computer_bt.png","mycoins_alien_computer_rt.png","mycoins_alien_computer_lt.png","mycoins_alien_computer_bk.png","mycoins_alien_computer_ft.png"},
paramtype = "light",
paramtype2 = "facedir",
light_source = 8,
@ -849,15 +715,7 @@ minetest.register_node("mycoins:alien_computer_active",{
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if not computer_owner(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access an Alienware computer belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return stack:get_count()
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
@ -870,16 +728,4 @@ minetest.register_node("mycoins:alien_computer_active",{
end
return stack:get_count()
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in Alienware computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to Alienware computer at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from Alienware computer at "..minetest.pos_to_string(pos))
end,
})
})

View File

@ -1,3 +1,32 @@
function default.router_off_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec = "size[10,10]"..
"label[2,2;Powered Off...]"
return formspec
end
function default.router_formspec(pos)
local active_computers = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:home_computer_active","mycoins:game_computer_active","mycoins:alien_computer_active"})
local inactive_computers = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:home_computer","mycoins:game_computer","mycoins:alien_computer"})
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
local formspec = "size[10,10]"..
"label[2,2;Powered On...]"..
"label[2,2.5;Active: "..#active_computers.."]"..
"label[2,2.8;Inactive: "..#inactive_computers.."]"..
"button_exit[4,7;2,1;exit;Exit]"
return formspec
end
--WIFI Router (linksys look-a-like)
minetest.register_node("mycoins:router_on", {
description = "WIFI Router Powered On",
@ -7,8 +36,9 @@ minetest.register_node("mycoins:router_on", {
paramtype2 = "facedir",
walkable = false,
is_ground_content = true,
groups = {snappy=3},
groups = {snappy=3, not_in_creative_inventory = 1},
sound = default.node_sound_wood_defaults(),
drop = "mycoins:router",
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -22,6 +52,14 @@ minetest.register_node("mycoins:router_on", {
on_punch = function(pos)
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = 'mycoins:router', param2 = node.param2})
local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.router_off_formspec(pos))
meta:set_string("infotext", "Router")
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.router_formspec(pos))
meta:set_string("infotext", "Router")
end,
})
@ -34,6 +72,7 @@ minetest.register_node("mycoins:router", {
is_ground_content = true,
groups = {snappy=3},
sound = default.node_sound_wood_defaults(),
drop = "mycoins:router",
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -47,6 +86,14 @@ minetest.register_node("mycoins:router", {
on_punch = function(pos)
local node = minetest.get_node(pos)
minetest.swap_node(pos, {name = 'mycoins:router_on', param2 = node.param2})
local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.router_formspec(pos))
meta:set_string("infotext", "Router")
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.router_off_formspec(pos))
meta:set_string("infotext", "Router")
end,
})

BIN
textures/tux.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB