Jackson_Pike icon

Turbine Control On/Off Button

Jackson_Pike | PRO | 06/24/16 10:49:23 PM UTC | 0 ⭐ | 249 👁️ | Never ⏰ | []
Lua |

470 B

|

None

|

0 👍

/

0 👎

---------Code By Jackson_Pike
 
while true do
mon = peripheral.wrap("top")
turb = peripheral.wrap("BigReactors-Turbine_0")
monX, monY = mon.getSize()
poll = turb.getActive()
 
 
if poll == true then
  local event, side, x, y = os.pullEvent("monitor_touch")
  if x >= monX-3 and y == 1 then
  turb.setActive(false)
  end
else
  local event, side, x, y = os.pullEvent("monitor_touch")
  if x >= monX-2  and y == 1 then
  turb.setActive(true)
  end
end
sleep(0.1)
end

Comments