Advertisement
Guest User

Touchscreen

a guest
Mar 8th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. mon = peripheral.wrap("left")
  2. os.loadAPI("bundleAPI")
  3. local x = true
  4. local y = true
  5. local z = true
  6. local a = true
  7. while true do
  8. event={os.pullEvent("monitor_touch")}
  9. local columnclicked = event[3]
  10. local rowclicked = event[4]
  11. local Reaktor = peripheral.wrap("BigReactors-Reactor_1")
  12.      if columnclicked >= 1 and columnclicked <= 19 and rowclicked >= 1 and rowclicked <= 2 then
  13.    -- Quarry AN/AUS
  14.    bundleAPI.toggle("bottom", "white")
  15.  elseif columnclicked >= 1 and columnclicked <= 19 and rowclicked >= 3 and rowclicked <= 4 then
  16.     -- Reaktor AN/AUS
  17.     if x == false then
  18.     x = true
  19.     Reaktor.setActive(true)
  20.     elseif x == true then
  21.     x = false
  22.     Reaktor.setActive(false)
  23.     end
  24.    
  25. elseif columnclicked >= 1 and columnclicked <= 19 and rowclicked >= 5 and rowclicked <= 6 then
  26.     -- Reaktorcomputer AN/AUS
  27.      bundleAPI.toggle("bottom", "green")
  28. elseif columnclicked >= 1 and columnclicked <= 19 and rowclicked >= 7 and rowclicked <= 8 then
  29.     bundleAPI.toggle("bottom", "blue")
  30.     -- Farm AN/AUS
  31. elseif columnclicked >= 1 and columnclicked <= 19 and rowclicked >= 9 and rowclicked <= 10 then
  32.     bundleAPI.toggle("bottom", "red")
  33.     -- XP-Farm AN/AUS
  34. end
  35. sleep(1)
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement