Advertisement
madpond

Untitled

May 17th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 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. else
  71. rs.setOutput("front", false)
  72. end
  73. end
  74.  
  75. -- Header 3
  76.  
  77. function be()
  78. t:flash("START")
  79. bec = 0
  80. if rs.getOutput("right") == false and bec == 0 then
  81. t:togglebutton("Assembly [B]")
  82. rs.setOutput("right", true)
  83. bec = 1
  84. bfc = 0
  85.  
  86. else
  87. rs.setOutput("right", true)
  88. end
  89. end
  90.  
  91. function bf()
  92. bfc = 0
  93. t:flash("STOP")
  94. if rs.getOutput("right") == true and bfc == 0 then
  95. t:togglebutton("Assembly [B]")
  96. rs.setOutput("right", false)
  97. bec = 0
  98. bfc = 1
  99.  
  100. else
  101. rs.setOutput("right", false)
  102. end
  103. end
  104.  
  105. -- Header 4
  106.  
  107. function bg()
  108. bfc = 0
  109. t:flash("START-F")
  110.  
  111. if rs.getOutput("back") == false and bfc == 0 then
  112. t:togglebutton("Item Feeder")
  113. rs.setOutput("back", true)
  114. bgc = 1
  115. bhc = 0
  116.  
  117. else
  118. rs.setOutput("back", true)
  119. end
  120. end
  121.  
  122. function bh()
  123. bhc = 0
  124. t:flash("STOP-F")
  125. if rs.getOutput("back") == true == bhc == 0 then
  126. t:togglebutton("Item Feeder")
  127. rs.setOutput("back", false)
  128. bgc = 0
  129. bhc = 1
  130. else
  131. rs.setOutput("right", false)
  132. end
  133. end
  134.  
  135.  
  136. guicore = function()
  137. --minX,minY,maxX,maxY [Minx --> MaxX | MinY --> MaxY]
  138.  
  139. t:add("LKSTN <CONTROL>", nil, 1, 1, 50, 2, colors.orange, colors.orange)
  140.  
  141. t:add("Assembly [A]", null, 1, 4, 20, 4, colors.lime, colors.red)
  142. t:add("START[A]", ba, 1, 6, 9, 7, colors.red, colors.lime)
  143. t:add("STOP[A]", bb, 12, 6, 20, 7, colors.red, colors.lime)
  144.  
  145. t:add("Forcefield", null, 1, 10, 20, 10, colors.red, colors.lime)
  146. t:add("ENABLE", bc, 1, 12, 9, 13, colors.red, colors.lime)
  147. t:add("DISABLE", bd, 12, 12, 20, 13, colors.red, colors.lime)
  148.  
  149. t:add("Assembly [B]", null, 30, 4, 50, 4, colors.red, colors.green)
  150. t:add("START[B]", be, 30, 6, 38, 7, colors.red, colors.green)
  151. t:add("STOP[B]", bf, 42, 6, 50, 7, colors.red, colors.lime)
  152.  
  153. t:add("Item Feeder", null, 30, 10, 50, 10, colors.red, colors.lime)
  154. t:add("START-F", bg, 30, 12, 38, 13, colors.red, colors.lime)
  155. t:add("STOP-F", bh, 42, 12, 50, 13, colors.red, colors.lime)
  156. t:draw()
  157. end
  158.  
  159. guicore()
  160. t:run()
  161.  
  162. --[[while true do
  163. -- local event, p1 = t:handleEvents(os.pullEvent())
  164. -- if event == "button_click" then
  165. --
  166. -- t:flash(p1)
  167.  
  168. -- rs.setOutput(p1, not rs.getOutput(p1))
  169. -- end
  170. --term.setcursor(50,2)
  171. --end--]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement