Advertisement
madpond

Untitled

May 17th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. -- Grab some of that touchpoint api sonnnnnn
  2. shell.run("pastebin", "get", "pFheia96", "touchpoint")
  3. os.loadAPI("touchpoint")
  4. local t = touchpoint.new("top")
  5. local event, p1 = t:handleEvents(os.pullEvent())
  6.  
  7. -- Header 1
  8.  
  9. function ba()
  10. t:flash("START[A]")
  11.  
  12.  
  13.  
  14. --t:toggleButton(p1)
  15. -- if rs.getOutput("left") == true then
  16. if rs.getOutput("left") == false then
  17. rs.setOutput("left", true)
  18. --t:togglebutton("Assembly [A]")
  19.  
  20.  
  21. else
  22. rs.setOutput("left", true)
  23.  
  24. end
  25.  
  26. end
  27.  
  28. function bb()
  29. t:flash("STOP[A]")
  30.  
  31.  
  32. --t:toggleButton(p1)
  33. if rs.getOutput("left") == true then
  34. --t:togglebutton("Assembly [A]")
  35. rs.setOutput("left", false)
  36. else
  37. rs.setOutput("left", false)
  38.  
  39. end
  40. end
  41.  
  42. -- Header 2
  43.  
  44. function bc()
  45. t:flash("ENABLE")
  46.  
  47. if rs.getOutput("front") == false then
  48. --t:togglebutton("Forcefield")
  49. rs.setOutput("front", true)
  50.  
  51. else
  52. rs.setOutput("front", true)
  53. end
  54. end
  55.  
  56. function bd()
  57. t:flash("DISABLE")
  58.  
  59. if rs.getOutput("front") == true then
  60. --t:togglebutton("Forcefield")
  61. rs.setOutput("front", false)
  62.  
  63. else
  64. rs.setOutput("front", false)
  65. end
  66. end
  67.  
  68. -- Header 3
  69.  
  70. function be()
  71. t:flash("OPEN")
  72.  
  73. if rs.getOutput("right") == false then
  74. --t:togglebutton("Assembly [B]")
  75. rs.setOutput("right", true)
  76.  
  77.  
  78. else
  79. rs.setOutput("right", true)
  80. end
  81. end
  82.  
  83. function bf()
  84.  
  85. t:flash("CLOSE")
  86. if rs.getOutput("right") == true then
  87. --t:togglebutton("Assembly [B]")
  88. rs.setOutput("right", false)
  89.  
  90.  
  91. else
  92. rs.setOutput("right", false)
  93. end
  94. end
  95.  
  96. -- Header 4
  97.  
  98. function bg()
  99.  
  100. t:flash("START-F")
  101. --t:togglebutton("bc")
  102. if rs.getOutput("back") == false then
  103.  
  104. rs.setOutput("back", true)
  105.  
  106.  
  107. else
  108. rs.setOutput("back", true)
  109. end
  110. end
  111.  
  112. function bh()
  113.  
  114. t:flash("STOP-F")
  115. if rs.getOutput("back") == true then
  116. --t:togglebutton("Item Feeder")
  117. rs.setOutput("back", false)
  118.  
  119. else
  120. rs.setOutput("back", false)
  121. end
  122. end
  123.  
  124.  
  125. guicore = function()
  126. --minX,minY,maxX,maxY [Minx --> MaxX | MinY --> MaxY]
  127.  
  128. t:add("Lakeistan Master Control", nil, 1, 1, 50, 2, colors.orange, colors.orange)
  129.  
  130. t:add("Archimedes ADS", null, 1, 4, 20, 4, colors.lime, colors.red)
  131. t:add("START[A]", ba, 1, 6, 9, 7, colors.red, colors.lime)
  132. t:add("STOP[A]", bb, 12, 6, 20, 7, colors.red, colors.lime)
  133.  
  134. t:add("Forcefield", null, 1, 10, 20, 10, colors.red, colors.lime)
  135. t:add("ENABLE", bc, 1, 12, 9, 13, colors.red, colors.lime)
  136. t:add("DISABLE", bd, 12, 12, 20, 13, colors.red, colors.lime)
  137.  
  138. t:add("Punisher II Silo", null, 30, 4, 50, 4, colors.red, colors.green)
  139. t:add("OPEN", be, 30, 6, 38, 7, colors.red, colors.lime)
  140. t:add("CLOSE", bf, 42, 6, 50, 7, colors.red, colors.lime)
  141.  
  142. t:add("Factory Master", null, 30, 10, 50, 10, colors.red, colors.lime)
  143. t:add("ACTIVATE", bg, 30, 12, 38, 13, colors.red, colors.lime)
  144. t:add("DEACTIVATE", bh, 42, 12, 50, 13, colors.red, colors.lime)
  145. t:draw()
  146. end
  147.  
  148. guicore()
  149. t:run()
  150.  
  151. --[[while true do
  152. -- local event, p1 = t:handleEvents(os.pullEvent())
  153. -- if event == "button_click" then
  154. --
  155. -- t:flash(p1)
  156.  
  157. -- rs.setOutput(p1, not rs.getOutput(p1))
  158. -- end
  159. --term.setcursor(50,2)
  160. --end--]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement