Advertisement
Terraxel

Smeltery program

Jul 31st, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1.     function ChooseMode()
  2.         print("1. Casting d'item\n")
  3.         print("2. Création de blocs\n")
  4.         print("3. Extraction du liquide\n")
  5.         print("4. Tout étéindre")
  6.         -- We print possible choices and ask user which mode he does want
  7.         print("Choix du mode : ")
  8.         local reading = read()
  9.         return reading
  10.     end
  11.  
  12.     function CastMode( isOn )
  13.         if isOn == true then
  14.             redstone.setOutput("back", false)
  15.         else
  16.             redstone.setOutput("back", true)
  17.         end
  18.         -- Redstone has to be off to activate redstone clock
  19.     end
  20.  
  21.     function BlockMode(isOn)
  22.         if isOn == true then
  23.             redstone.setOutput("left", false)
  24.         else
  25.             redstone.setOutput("left", true)
  26.         end
  27.         -- Redstone has to be off to activate redstone clock
  28.     end
  29.  
  30.     function LiquidExtraction( isOn )
  31.         if isOn == true then
  32.             redstone.setOutput("right", true)
  33.         else
  34.             redstone.setOutput("right", false)
  35.         end
  36.         -- Redstone has to be on in order to activate liquid extraction
  37.     end
  38.  
  39. -- ========================================
  40.  
  41. while true do
  42.     term.clear()
  43.     term.setCursorPos(1,1)
  44.     local mode = ChooseMode()
  45.  
  46.     if mode == "1" then
  47.         CastMode(true)
  48.         BlockMode(false)
  49.         LiquidExtraction(false)
  50.     elseif mode == "2" then
  51.         CastMode(false)
  52.         BlockMode(true)
  53.         LiquidExtraction(false)
  54.     elseif mode == "3" then
  55.         CastMode(false)
  56.         BlockMode(false)
  57.         LiquidExtraction(true)
  58.     elseif mode == "4" then
  59.         CastMode(false)
  60.         BlockMode(false)
  61.         LiquidExtraction(false)
  62.     end
  63. end
  64. -- ========================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement