Xen0Xys

Alarm

Apr 30th, 2021 (edited)
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. function check(p)
  2.     if p ~= nil then
  3.         if table.getn(p.tanks()) >= 1 then
  4.             redstone.setOutput("top", false)
  5.             redstone.setOutput("left", true)
  6.             if p.tanks()[1].amount < 10 then
  7.                 redstone.setOutput("top", true)
  8.                 redstone.setOutput("left", false)
  9.             else
  10.                 redstone.setOutput("top", false)
  11.                 redstone.setOutput("left", true)
  12.             end
  13.         else
  14.             redstone.setOutput("top", true)
  15.             redstone.setOutput("left", false)
  16.         end
  17.     else
  18.         redstone.setOutput("top", true)
  19.         redstone.setOutput("left", false)
  20.     end
  21. end
  22.  
  23. while true do
  24.     check(peripheral.wrap("back"))
  25. end
Add Comment
Please, Sign In to add comment