Advertisement
Antonderman

Giga minecraft elevator rails turner

Apr 7th, 2024
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. local reader = peripheral.find("blockReader")
  2. local integrator = peripheral.find("redstoneIntegrator")
  3.  
  4. while true do
  5.     local data = reader.getBlockStates()
  6.     print("First loop")
  7.     if data["backwards"] == true then
  8.  
  9.         print("Backwards")
  10.  
  11.         if integrator.getAnalogInput("west") > 0 then
  12.             integrator.setOutput("south", true)
  13.             while true do
  14.                 local data1 = reader.getBlockStates()
  15.                 if data1["backwards"] == false then
  16.                     integrator.setOutput("south",false)
  17.                     break
  18.                 end
  19.             end
  20.         end
  21.     elseif data["backwards"] == false then
  22.  
  23.         print("Not backwards")
  24.  
  25.         if integrator.getAnalogInput("east") > 0 then
  26.             integrator.setOutput("south", true)
  27.             while true do
  28.                 local data2 = reader.getBlockStates()
  29.                 if data2["backwards"] == true then
  30.                     integrator.setOutput("south",false)
  31.                     break
  32.                 end
  33.             end
  34.         end
  35.     end
  36. end
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement