Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --# load the Touchpoint API
- loadup = function()
- shell.run("pastebin", "get", "pFHeia96", "touchpoint")
- os.loadAPI("touchpoint")
- print("Touchpoint API Loaded")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- end
- loadup()
- --# intialize a new button set on the top monitor
- local t = touchpoint.new("top")
- --rs.getOutput LEFT.
- function leftAction()
- t:toggleButton("Pump")
- if rs.getOutput("left") == true then
- rs.setOutput("left", false)
- else
- rs.setOutput("left", true)
- end
- end
- --rs.getOutput RIGHT.
- function rightAction()
- t:toggleButton("Refinery")
- if rs.getOutput("right") == true then
- rs.setOutput("right", false)
- else
- rs.setOutput("right", true)
- end
- end
- --rs.getOutput BACK
- function backAction()
- t:toggleButton("BACK")
- if rs.getOutput("back") == true then
- rs.setOutput("back", false)
- else
- rs.setOutput("back", true)
- end
- end
- --this function must be below the three other functions.
- buttonLoads = function()
- t:add("Pump", leftAction, 4, 4, 16, 7, colors.red, colors.slime)
- t:add("BACK", backAction, 32, 4, 44, 7, colors.red, colors.slime)
- t:add("Refinery", rightAction, 18, 4, 30, 7, colors.red, colors.slime)
- t:draw()
- end
- buttonLoads()
- t:run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement