Advertisement
maumagro

Nuclear individual

Jun 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. API = require("buttonAPI")
  2. local event = require("event")
  3. local computer = require("computer")
  4. local term = require("term")
  5. local component = require("component")
  6. local gpu = component.gpu
  7.  
  8. local rs = component.redstone
  9. local colors = require("colors")
  10. local sides = require("sides")
  11.  
  12. function API.fillTable()
  13.   API.setTable("Start", test1, 10,32,3,15)
  14.   API.setTable("Exit", test5, 34,50,3,15)
  15.   API.screen()
  16. end
  17.  
  18. function getClick()
  19.   local _, _, x, y = event.pull(1,touch)
  20.   if x == nil or y == nil then
  21.     local h, w = gpu.getResolution()
  22.     gpu.set(h, w, ".")
  23.     gpu.set(h, w, " ")
  24.   else
  25.     API.checkxy(x,y)
  26.   end
  27. end
  28.  
  29. function test1()
  30.   API.toggleButton("Start")
  31.   term.setCursor(1,25)
  32.   term.write("Active                         ")
  33.   rs.setOutput(sides.up,15)
  34.   os.sleep(2500)
  35.   term.setCursor(1,25)
  36.   term.write("Check core to start               ")
  37.   rs.setOutput(sides.up,0)
  38.   API.toggleButton("Start")
  39. end
  40.  
  41. function test5()
  42.   term.clear()
  43.   os.exit()
  44. end
  45.  
  46.  
  47. term.setCursorBlink(false)
  48. gpu.setResolution(80, 25)
  49. API.clear()
  50. API.fillTable()
  51. API.heading("Nuclear generator control system")
  52. API.label(1,24,"McPrime 2017. maumagro")
  53.  
  54. while true do
  55.   getClick()
  56. end
  57.  
  58.  
  59.  
  60. --eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement