Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version = 20230625.1400
- --[[
- https://pastebin.com/AbYQMD5H
- MobSoftenerSetup
- Designed for use with MobSoftenerStartup
- and dungeon spawners
- ]]
- kb = require "lib.menu"
- local messages =
- {
- [[ Setup page 1 of 2:
- Mob lava softener using 2 sticky pistons
- Note your layout (Left or Right)
- Dispenser on RIGHT or LEFT of Computer
- | | |*| |*| | P = Sticky Piston | |*| |*| | |
- | |P|S| |*| | S = Slab | |*| |S|P| |
- | |C|D| |*| | C = Computer | |*| |D|C| |
- | |P|S| |*| | D = Dispenser | |*| |S|P| |
- | | | | |*| | * = Stone | |*| | | | |
- | | | |H| | | H = Hopper | | |H| | | |
- | | | |p| | | p = Pressure Plate | | |p| | | |
- Press Enter to see next page...]],
- [[ Setup page 2 of 2:
- Mob lava softener using 4 normal pistons
- Note your layout (Left or Right)
- Dispenser on RIGHT or LEFT of Computer
- | | |*| |*| | P = Regular Piston | |*| |*| | |
- | |P|S| |P| | S = Slab | |P| |S|P| |
- | |C|D| |C| | C = Computer | |C| |D|C| |
- | |P|S| |P| | D = Dispenser | |P| |S|P| |
- | | | | |*| | * = Stone | |*| | | | |
- | | | |H| | | H = Hopper | | |H| | | |
- | | | |p| | | p = Pressure Plate | | |p| | | |
- Press Enter to Continue]]
- }
- local function intro()
- kb.clear()
- kb.colourPrint(messages[1])
- read()
- kb.clear()
- kb.colourPrint(messages[2])
- read()
- end
- local function getPistonType()
- choice = kb.menu("Piston Type?", {"2 Sticky pistons with 1 computer", "4 Regular pistons with 2 computers"})
- return choice
- end
- local function getLayout()
- choice = kb.menu("Computer / Dispenser layout?", {"Lava Dispenser on right side of computer", "Lava Dispenser on left side of computer"})
- return choice
- end
- local function getComputerType()
- --kb.clear()
- choice = kb.menu("What computer am I...?", {"pressure plate activated server", "passive client"})
- return choice
- end
- local function writeConfig(computerType, layout, pistonType)
- kb.clear()
- local h = fs.open("config.txt", "w")
- h.writeLine(computerType) -- "single, "server", "client"
- print("Computer "..computerType)
- h.writeLine(layout)
- print("Layout "..layout)
- h.writeLine(pistonType) -- 1 = sticky, 2 = normal
- print("Piston "..pistonType)
- h.close()
- print("Config.txt file written")
- end
- local function main()
- local pistonTypes = {"sticky", "regular"}
- local computerTypes = {"single", "server", "client"}
- local layouts = {"right", "left"}
- local computerType = computerTypes[1] -- default for use with 2 sticky pistons "single"
- intro() -- display Left and Right layouts
- local pistonType = pistonTypes[getPistonType()] -- "sticky", "regular"
- local layout = layouts[getLayout()] -- "left", "right"
- if pistonType == "regular" then -- normal piston x 4, 2 computer
- computerType = computerTypes[getComputerType() + 1]
- end
- writeConfig(computerType, layout, pistonType) -- eg "single", "left", "sticky"
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement