Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ChooseMode()
- print("1. Casting d'item\n")
- print("2. Création de blocs\n")
- print("3. Extraction du liquide\n")
- print("4. Tout étéindre")
- -- We print possible choices and ask user which mode he does want
- print("Choix du mode : ")
- local reading = read()
- return reading
- end
- function CastMode( isOn )
- if isOn == true then
- redstone.setOutput("back", false)
- else
- redstone.setOutput("back", true)
- end
- -- Redstone has to be off to activate redstone clock
- end
- function BlockMode(isOn)
- if isOn == true then
- redstone.setOutput("left", false)
- else
- redstone.setOutput("left", true)
- end
- -- Redstone has to be off to activate redstone clock
- end
- function LiquidExtraction( isOn )
- if isOn == true then
- redstone.setOutput("right", true)
- else
- redstone.setOutput("right", false)
- end
- -- Redstone has to be on in order to activate liquid extraction
- end
- -- ========================================
- while true do
- term.clear()
- term.setCursorPos(1,1)
- local mode = ChooseMode()
- if mode == "1" then
- CastMode(true)
- BlockMode(false)
- LiquidExtraction(false)
- elseif mode == "2" then
- CastMode(false)
- BlockMode(true)
- LiquidExtraction(false)
- elseif mode == "3" then
- CastMode(false)
- BlockMode(false)
- LiquidExtraction(true)
- elseif mode == "4" then
- CastMode(false)
- BlockMode(false)
- LiquidExtraction(false)
- end
- end
- -- ========================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement