Advertisement
Guest User

pressure

a guest
Jan 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. output = false
  2. limit = 8
  3. inSide = "left"
  4. outSide = "right"
  5.  
  6. outputString = ""
  7.  
  8. term.clear()
  9.  
  10. while true do
  11.   term.setCursorPos(1,1)
  12.   os.startTimer(0.1)
  13.   os.pullEvent("timer")
  14.  
  15.   if redstone.getAnalogInput(inSide) >= limit then
  16.     output = false
  17.     outputString = "off"
  18.   else
  19.     output = true
  20.     outputString = "on"
  21.   end
  22.   reading = (redstone.getAnalogInput(inSide)/2) .. "/" .. (limit/2) .." bar" .. " -> " .. outputString
  23.  
  24.   term.clear()
  25.   if redstone.getAnalogInput("front") >= 13 then
  26.     redstone.setOutput(outSide, false)
  27.     print("Override:\nCompressors off")
  28.   else
  29.     redstone.setOutput(outSide, output)
  30.     print(reading)
  31.   end              
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement