Craft4Cube

UniversalSwitch

Sep 3rd, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. psa=' OFF '
  2. psb=' ON1 '
  3. psc=' ON2 '
  4. mon = peripheral.wrap(b)
  5. mon.clear()
  6. mon.setCursorPos(1,1)
  7. mon.write(psa)
  8. mon.setCursorPos(1,2)
  9. mon.write(psb)
  10. mon.setCursorPos(1,3)
  11. mon.write(psc)
  12. while true do
  13.  event, side, x, y = os.pullEvent("monitor_touch")
  14.   if x > 1 and x < 6 and y == 1 then
  15.     rs.setBundledOutput("top",0)
  16.   end
  17.   if x > 1 and x < 6 and y == 2 then
  18.     rs.setBundledOutput("top",colors.white)
  19.   end
  20.   if x > 1 and x < 6 and y == 3 then
  21.     rs.setBundledOutput("top",colors.white+colors.orange)
  22.   end
  23. os.sleep(0.5)
  24. end
Advertisement
Add Comment
Please, Sign In to add comment