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")
- local event, p1 = t:handleEvents(os.pullEvent())
- -- Header 1
- function ba()
- t:flash("START[A]")
- --t:toggleButton(p1)
- -- if rs.getOutput("left") == true then
- if rs.getOutput("left") == false then
- rs.setOutput("left", true)
- --t:togglebutton("Assembly [A]")
- else
- rs.setOutput("left", true)
- end
- end
- function bb()
- t:flash("STOP[A]")
- --t:toggleButton(p1)
- if rs.getOutput("left") == true then
- --t:togglebutton("Assembly [A]")
- rs.setOutput("left", false)
- else
- rs.setOutput("left", false)
- end
- end
- -- Header 2
- function bc()
- t:flash("ENABLE")
- if rs.getOutput("front") == false then
- --t:togglebutton("Forcefield")
- rs.setOutput("front", true)
- else
- rs.setOutput("front", true)
- end
- end
- function bd()
- t:flash("DISABLE")
- if rs.getOutput("front") == true then
- --t:togglebutton("Forcefield")
- rs.setOutput("front", false)
- else
- rs.setOutput("front", false)
- end
- end
- -- Header 3
- function be()
- t:flash("OPEN")
- if rs.getOutput("right") == false then
- --t:togglebutton("Assembly [B]")
- rs.setOutput("right", true)
- else
- rs.setOutput("right", true)
- end
- end
- function bf()
- t:flash("CLOSE")
- if rs.getOutput("right") == true then
- --t:togglebutton("Assembly [B]")
- rs.setOutput("right", false)
- else
- rs.setOutput("right", false)
- end
- end
- -- Header 4
- function bg()
- t:flash("START-F")
- --t:togglebutton("bc")
- if rs.getOutput("back") == false then
- rs.setOutput("back", true)
- else
- rs.setOutput("back", true)
- end
- end
- function bh()
- t:flash("STOP-F")
- if rs.getOutput("back") == true then
- --t:togglebutton("Item Feeder")
- rs.setOutput("back", false)
- else
- rs.setOutput("back", false)
- end
- end
- guicore = function()
- --minX,minY,maxX,maxY [Minx --> MaxX | MinY --> MaxY]
- t:add("Lakeistan Master Control", nil, 1, 1, 50, 2, colors.orange, colors.orange)
- t:add("Archimedes ADS", null, 1, 4, 20, 4, colors.lime, colors.red)
- t:add("START[A]", ba, 1, 6, 9, 7, colors.red, colors.lime)
- t:add("STOP[A]", bb, 12, 6, 20, 7, colors.red, colors.lime)
- t:add("Forcefield", null, 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("Punisher II Silo", null, 30, 4, 50, 4, colors.red, colors.green)
- t:add("OPEN", be, 30, 6, 38, 7, colors.red, colors.lime)
- t:add("CLOSE", bf, 42, 6, 50, 7, colors.red, colors.lime)
- t:add("Factory Master", null, 30, 10, 50, 10, colors.red, colors.lime)
- t:add("ACTIVATE", bg, 30, 12, 38, 13, colors.red, colors.lime)
- t:add("DEACTIVATE", 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