Minetest: Digilines Ice & Drink Machine
Last Updated: 2024 September 17 (2024 Aug 18)
Beyond working as intended, this machine happens to create infinite buckets. Which would be an interesting bug report if I was inclined to file one.
In Minetest, some crafting recipes involve a bucket of water. Buckets of water are non-stackable, meaning each item will always occupy a single slot in the inventory. Because of this, any recipe involving a bucket of water can not be performed in bulk. (The player will have to remove the empty bucket from the crafting grid.)
To save the trouble, I built a machine for crafting any recipe with
water buckets. Beyond the usual pipeworks:
,
digilines:
, and so on, this machine uses an item from
cottages:
.
There are two parts to the machine.
The Crafter
This machine currently relies on permissions to load ice into the alloy furnace.
This consists of:
- a lua controller
technic:
alloy furnace (with control logic unit)- an autocrafter (with stackwise filter-injector)
- an wooden chest to store output
- a sorting tube
digistuff:
touchscreen
What this machine does is:
- (Alloy furnace) Melts ice into buckets of water.
- Send buckets of water to the autocrafter.
- (Touchscreen) Receive user input: which item and how many to craft.
- Send created items to the output chest.
Source Code (luacontroller)
A large portion of the source code involves loading recipes onto the autocrafter and drawing the interface on the touchscreen. It can be read at:
https://notabug.org/scuti/minetest-machines/src/master/watercrafts.lua
The Ice Maker
Also the infinite bucket maker. (This machine can be used by anyone, but needs someone with permissions to load empty glass cups into the autocrafter.)
The crafting portion of the machine relies on ice and an empty bucket to create buckets of water. The reason is that both ice and empty buckets can be stacked (thus conveniently stored.)
This portion consists of:
cottages:
tree trunk well- node breaker loaded with empty bucket
technic:
freezer (with control logic unit)- autocrafter (with stackwise filter-injector)
- a wooden chest to store output
- lua-controlled tube attached to a lever
What happens is:
- the node breaker hits the tree trunk well with a bucket.
- the well fills the bucket with river water
(
bucket:bucket_river_water
is different frombucket:bucket_water
) - if the lever is flipped upwards,
- then the lua-controlled tube sends the bucket of river water to the autocrafter to create glass of water.
- else, the lua-controlled tube sends the bucket of river water to the freezer to create ice.
- send ice, empty buckets, and glass of water if either exists to the output chest.
As a result, the server I play on has an insane number of buckets in circulation.
The Source Code (lua-controlled tube)
The code loaded in the lua-controlled tube is trivial and operates on the state of the lever.
local function main()
local glass = "green";
local ice = "blue";
if pin.red == true then
return glass
end
return ice
end
return main()
Where you can play with it
The ice and drink machine is in Subterra Lobby to the left of the
point of arrival, beyond a stone ladder. You can find the teleporter
to it at juneland.fr:30000
(-961,
12.5, 1911). There is also another machine (Digilines
Vending Machine) in the vicinity at Subterra Market.
Have fun!
Thanks for reading! Who doesn't love comments? Let me know what you think on my guestbook by e-mail or neocities.