Jackson_Pike

Turbine Control On/Off Button

Jun 24th, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. ---------Code By Jackson_Pike
  2.  
  3. while true do
  4. mon = peripheral.wrap("top")
  5. turb = peripheral.wrap("BigReactors-Turbine_0")
  6. monX, monY = mon.getSize()
  7. poll = turb.getActive()
  8.  
  9.  
  10. if poll == true then
  11.   local event, side, x, y = os.pullEvent("monitor_touch")
  12.   if x >= monX-3 and y == 1 then
  13.   turb.setActive(false)
  14.   end
  15. else
  16.   local event, side, x, y = os.pullEvent("monitor_touch")
  17.   if x >= monX-2  and y == 1 then
  18.   turb.setActive(true)
  19.   end
  20. end
  21. sleep(0.1)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment