Advertisement
madpond

Untitled

May 17th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 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. bac = 0
  6. bbc = 0
  7. bcc = 0
  8. bdc = 0
  9. bdc = 0
  10. bec = 0
  11. bfc = 0
  12. bgc = 0
  13. bhc = 0
  14.  
  15. -- Header 1
  16.  
  17. function ba()
  18. t:flash("START[A]")
  19. bac = 0
  20. if rs.getOutput("left") == true and bac == 0 then
  21. --Edit Within here
  22. rs.setOutput("left", false)
  23. t:togglebutton("Assembly [A]")
  24. --Edit Function Within Here
  25. bac = 1
  26. bbc = 0
  27. else
  28. rs.setOutput("left", false)
  29. end
  30. end
  31.  
  32. function bb()
  33. t:flash("STOP[A]")
  34. bbc = 0
  35. if rs.getOutput("left") == false and bbc == 0 then
  36. --Edit Within here
  37. t:togglebutton("Assembly [A]")
  38. rs.setOutput("left", true)
  39. --Edit Function Within Here
  40. bac = 0
  41. bbc = 1
  42. else
  43. rs.setOutput("left", true)
  44. end
  45. end
  46.  
  47. -- Header 2
  48.  
  49. function bc()
  50. t:flash("ENABLE")
  51. bcc = 0
  52. if rs.getOutput("front") == false and bcc == 0 then
  53. t:togglebutton("Forcefield")
  54. rs.setOutput("front", true)
  55. bcc = 1
  56. bdc = 0
  57. else
  58. rs.setOutput("front", true)
  59. end
  60. end
  61.  
  62. function bd()
  63. t:flash("DISABLE")
  64. bdc = 0
  65. if rs.getOutput("front") == true and bdc == 0 then
  66. t:togglebutton("Forcefield")
  67. rs.setOutput("front", false)
  68. bcc = 0
  69. bdc = 1
  70.  
  71. else
  72. rs.setOutput("front", false)
  73. end
  74. end
  75.  
  76. -- Header 3
  77.  
  78. function be()
  79. t:flash("START")
  80. bec = 0
  81. if rs.getOutput("right") == false and bec == 0 then
  82. t:togglebutton("Assembly [B]")
  83. rs.setOutput("right", true)
  84. bec = 1
  85. bfc = 0
  86.  
  87. else
  88. rs.setOutput("right", true)
  89. end
  90. end
  91.  
  92. function bf()
  93. bfc = 0
  94. t:flash("STOP")
  95. if rs.getOutput("right") == true and bfc == 0 then
  96. t:togglebutton("Assembly [B]")
  97. rs.setOutput("right", false)
  98. bec = 0
  99. bfc = 1
  100.  
  101. else
  102. rs.setOutput("right", false)
  103. end
  104. end
  105.  
  106. -- Header 4
  107.  
  108. function bg()
  109. bfc = 0
  110. t:flash("START-F")
  111.  
  112. if rs.getOutput("back") == true and bgc == 0 then
  113. t:togglebutton("Item Feeder")
  114. rs.setOutput("back", false)
  115. bgc = 1
  116. bhc = 0
  117.  
  118. else
  119. rs.setOutput("back", false)
  120. end
  121. end
  122.  
  123. function bh()
  124. bfc = 0
  125. t:flash("STOP-F")
  126. if rs.getOutput("back") == true == bhc == 0 then
  127. t:togglebutton("Item Feeder")
  128. rs.setOutput("back", false)
  129. bgc = 0
  130. bhc = 1
  131. else
  132. rs.setOutput("right", false)
  133. end
  134. end
  135.  
  136.  
  137. guicore = function()
  138. --minX,minY,maxX,maxY [Minx --> MaxX | MinY --> MaxY]
  139.  
  140. t:add("LKSTN <CONTROL>", nil, 1, 1, 50, 2, colors.orange, colors.orange)
  141.  
  142. t:add("Assembly [A]", header1, 1, 4, 20, 4, colors.lime, colors.red)
  143. t:add("START[A]", ba, 1, 6, 9, 7, colors.red, colors.lime)
  144. t:add("STOP[B]", bb, 12, 6, 20, 7, colors.red, colors.lime)
  145.  
  146. t:add("Forcefield", header2, 1, 10, 20, 10, colors.red, colors.lime)
  147. t:add("ENABLE", bc, 1, 12, 9, 13, colors.red, colors.lime)
  148. t:add("DISABLE", bd, 12, 12, 20, 13, colors.red, colors.lime)
  149.  
  150. t:add("Assembly [B]", header3, 30, 4, 50, 4, colors.red, colors.green)
  151. t:add("START[B]", be, 30, 6, 38, 7, colors.red, colors.green)
  152. t:add("STOP[B]", bf, 42, 6, 50, 7, colors.red, colors.lime)
  153.  
  154. t:add("Item Feeder", header4, 30, 10, 50, 10, colors.red, colors.lime)
  155. t:add("START-F", bg, 30, 12, 38, 13, colors.red, colors.lime)
  156. t:add("STOP-F", bh, 42, 12, 50, 13, colors.red, colors.lime)
  157. t:draw()
  158. end
  159.  
  160. guicore()
  161. t:run()
  162.  
  163. --[[while true do
  164. -- local event, p1 = t:handleEvents(os.pullEvent())
  165. -- if event == "button_click" then
  166. --
  167. -- t:flash(p1)
  168.  
  169. -- rs.setOutput(p1, not rs.getOutput(p1))
  170. -- end
  171. --term.setcursor(50,2)
  172. --end--]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement