Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Grab some of that touchpoint api sonnnnnn
- shell.run("pastebin", "get", "pFheia96", "touchpoint")
- os.loadAPI("touchpoint")
- local t = touchpoint.new("top")
- bac = 0
- bbc = 0
- bcc = 0
- bdc = 0
- bdc = 0
- bec = 0
- bfc = 0
- bgc = 0
- bhc = 0
- -- Header 1
- function ba()
- t:flash("START[A]")
- bac = 0
- if rs.getOutput("left") == true and bac == 0 then
- --Edit Within here
- rs.setOutput("left", false)
- t:togglebutton("Assembly [A]")
- --Edit Function Within Here
- bac = 1
- bbc = 0
- else
- rs.setOutput("left", false)
- end
- end
- function bb()
- t:flash("STOP[A]")
- bbc = 0
- if rs.getOutput("left") == false and bbc == 0 then
- --Edit Within here
- t:togglebutton("Assembly [A]")
- rs.setOutput("left", true)
- --Edit Function Within Here
- bac = 0
- bbc = 1
- else
- rs.setOutput("left", true)
- end
- end
- -- Header 2
- function bc()
- t:flash("ENABLE")
- bcc = 0
- if rs.getOutput("front") == false and bcc == 0 then
- t:togglebutton("Forcefield")
- rs.setOutput("front", true)
- bcc = 1
- bdc = 0
- else
- rs.setOutput("front", true)
- end
- end
- function bd()
- t:flash("DISABLE")
- bdc = 0
- if rs.getOutput("front") == true and bdc == 0 then
- t:togglebutton("Forcefield")
- rs.setOutput("front", false)
- bcc = 0
- bdc = 1
- else
- rs.setOutput("front", false)
- end
- end
- -- Header 3
- function be()
- t:flash("START")
- bec = 0
- if rs.getOutput("right") == false and bec == 0 then
- t:togglebutton("Assembly [B]")
- rs.setOutput("right", true)
- bec = 1
- bfc = 0
- else
- rs.setOutput("right", true)
- end
- end
- function bf()
- bfc = 0
- t:flash("STOP")
- if rs.getOutput("right") == true and bfc == 0 then
- t:togglebutton("Assembly [B]")
- rs.setOutput("right", false)
- bec = 0
- bfc = 1
- else
- rs.setOutput("right", false)
- end
- end
- -- Header 4
- function bg()
- bfc = 0
- t:flash("START-F")
- if rs.getOutput("back") == true and bgc == 0 then
- t:togglebutton("Item Feeder")
- rs.setOutput("back", false)
- bgc = 1
- bhc = 0
- else
- rs.setOutput("back", false)
- end
- end
- function bh()
- bfc = 0
- t:flash("STOP-F")
- if rs.getOutput("back") == true == bhc == 0 then
- t:togglebutton("Item Feeder")
- rs.setOutput("back", false)
- bgc = 0
- bhc = 1
- else
- rs.setOutput("right", false)
- end
- end
- guicore = function()
- --minX,minY,maxX,maxY [Minx --> MaxX | MinY --> MaxY]
- t:add("LKSTN <CONTROL>", nil, 1, 1, 50, 2, colors.orange, colors.orange)
- t:add("Assembly [A]", header1, 1, 4, 20, 4, colors.lime, colors.red)
- t:add("START[A]", ba, 1, 6, 9, 7, colors.red, colors.lime)
- t:add("STOP[B]", bb, 12, 6, 20, 7, colors.red, colors.lime)
- t:add("Forcefield", header2, 1, 10, 20, 10, colors.red, colors.lime)
- t:add("ENABLE", bc, 1, 12, 9, 13, colors.red, colors.lime)
- t:add("DISABLE", bd, 12, 12, 20, 13, colors.red, colors.lime)
- t:add("Assembly [B]", header3, 30, 4, 50, 4, colors.red, colors.green)
- t:add("START[B]", be, 30, 6, 38, 7, colors.red, colors.green)
- t:add("STOP[B]", bf, 42, 6, 50, 7, colors.red, colors.lime)
- t:add("Item Feeder", header4, 30, 10, 50, 10, colors.red, colors.lime)
- t:add("START-F", bg, 30, 12, 38, 13, colors.red, colors.lime)
- t:add("STOP-F", bh, 42, 12, 50, 13, colors.red, colors.lime)
- t:draw()
- end
- guicore()
- t:run()
- --[[while true do
- -- local event, p1 = t:handleEvents(os.pullEvent())
- -- if event == "button_click" then
- --
- -- t:flash(p1)
- -- rs.setOutput(p1, not rs.getOutput(p1))
- -- end
- --term.setcursor(50,2)
- --end--]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement