Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --# Made By HDR - @MartinRefseth #--
- --# Version 1.1 Remote Client #-
- --# Thanks to Lyqyd for his Button API http://www.computercraft.info/forums2/index.php?/topic/14784-touchpoint-api/ #--
- os.loadAPI("touchpoint")
- rednet.open("back")
- local page1 = touchpoint.new()
- local page2 = touchpoint.new()
- local t
- local input = io.input()
- local id = nil
- if fs.exists("id.txt") ~= true then
- mswrite = fs.open("id.txt", "w")
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.orange)
- term.setBackgroundColor(colors.gray)
- print("Enter"," "..os.getComputerID()," ","Into The Server")
- term.setCursorPos(1,2)
- term.write("Insert Server ID ")
- local idinput = read()
- idput = idinput
- mswrite.write(idput)
- mswrite.close()
- end
- function idCheck()
- fileHandler = io.open( "id.txt", "r" )
- content = fileHandler:read("*a")
- fileHandler:close()
- id = tonumber(content)
- end
- function pg1()
- page2:flash("Page 1")
- t = page1
- --#OverWrites Part Of Touchpoint API#--
- t.draw = function(self)
- local old = term.redirect(self.mon)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- term.clear()
- term.setCursorPos(1,20)
- term.setTextColor(colors.orange)
- term.write("v1.0")
- for name, buttonData in pairs(self.buttonList) do
- if buttonData.active then
- term.setBackgroundColor(buttonData.activeColor)
- term.setTextColor(buttonData.activeText)
- else
- term.setBackgroundColor(buttonData.inactiveColor)
- term.setTextColor(buttonData.inactiveText)
- end
- for i = buttonData.yMin, buttonData.yMax do
- term.setCursorPos(buttonData.xMin, i)
- term.write(buttonData.label[i - buttonData.yMin + 1])
- end
- end
- if old then
- term.redirect(old)
- else
- term.restore()
- end
- end
- end
- function pg2()
- page1:flash("Page 2")
- t = page2
- --#OverWrites Part Of Touchpoint API#--
- t.draw = function(self)
- local old = term.redirect(self.mon)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- term.clear()
- term.setCursorPos(23,20)
- term.setTextColor(colors.orange)
- term.write("v1.0")
- for name, buttonData in pairs(self.buttonList) do
- if buttonData.active then
- term.setBackgroundColor(buttonData.activeColor)
- term.setTextColor(buttonData.activeText)
- else
- term.setBackgroundColor(buttonData.inactiveColor)
- term.setTextColor(buttonData.inactiveText)
- end
- for i = buttonData.yMin, buttonData.yMax do
- term.setCursorPos(buttonData.xMin, i)
- term.write(buttonData.label[i - buttonData.yMin + 1])
- end
- end
- if old then
- term.redirect(old)
- else
- term.restore()
- end
- end
- end
- function main()
- t = page1
- --#OverWrites Part Of Touchpoint API#--
- t.draw = function(self)
- local old = term.redirect(self.mon)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- term.clear()
- term.setCursorPos(1,20)
- term.setTextColor(colors.orange)
- term.write("v1.0")
- for name, buttonData in pairs(self.buttonList) do
- if buttonData.active then
- term.setBackgroundColor(buttonData.activeColor)
- term.setTextColor(buttonData.activeText)
- else
- term.setBackgroundColor(buttonData.inactiveColor)
- term.setTextColor(buttonData.inactiveText)
- end
- for i = buttonData.yMin, buttonData.yMax do
- term.setCursorPos(buttonData.xMin, i)
- term.write(buttonData.label[i - buttonData.yMin + 1])
- end
- end
- if old then
- term.redirect(old)
- else
- term.restore()
- end
- end
- end
- function Thir()
- t:flash("13")
- idCheck()
- rednet.send(id,"Thir")
- end
- function Cat()
- t:flash("Cat")
- idCheck()
- rednet.send(id,"Cat")
- end
- function Blocks()
- t:flash("Blocks")
- idCheck()
- rednet.send(id,"Blocks")
- end
- function Chirp()
- t:flash("Chirp")
- idCheck()
- rednet.send(id,"Chirp")
- end
- function Far()
- t:flash("Far")
- idCheck()
- rednet.send(id,"Far")
- end
- function Mall()
- t:flash("Mall")
- idCheck()
- rednet.send(id,"Mall")
- end
- function Mellohi()
- t:flash("Mellohi")
- idCheck()
- rednet.send(id,"Mellohi")
- end
- function Stal()
- t:flash("Stal")
- idCheck()
- rednet.send(id,"Stal")
- end
- function Strad()
- t:flash("Strad")
- idCheck()
- rednet.send(id,"Strad")
- end
- function Ward()
- t:flash("Ward")
- idCheck()
- rednet.send(id,"Ward")
- end
- function Elev()
- t:flash("11")
- idCheck()
- rednet.send(id,"Elev")
- end
- function Wait()
- t:flash("Wait")
- idCheck()
- rednet.send(id,"Wait")
- end
- function Question()
- t:flash("???")
- idCheck()
- rednet.send(id,"Question")
- end
- function GaiaOne()
- t:flash("Gaia 1")
- idCheck()
- rednet.send(id,"GaiaOne")
- end
- function GaiaTwo()
- t:flash("Gaia 2")
- idCheck()
- rednet.send(id,"GaiaTwo")
- end
- function Roop()
- t:flash("R-Loop")
- idCheck()
- rednet.send(id,"Roop")
- end
- function Slive()
- t:flash("S-Alive")
- idCheck()
- rednet.send(id,"Slive")
- end
- function WYG()
- t:flash("WYG")
- idCheck()
- rednet.send(id,"WYG")
- end
- function WDR()
- t:flash("Wanderer")
- idCheck()
- rednet.send(id,"WDR")
- end
- function Stop()
- t:flash("Stop")
- idCheck()
- rednet.send(id,"Stop")
- end
- function Reboot()
- t:flash("Reboot")
- idCheck()
- rednet.send(id,"Reboot")
- os.reboot()
- end
- function Random()
- t:flash("Random")
- idCheck()
- rednet.send(id,"Random")
- end
- do
- page1:add("13", Thir, 2,3,8,5, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Cat", Cat, 10,3,17,5, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Blocks", Blocks, 19,3,25,5, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Chirp", Chirp, 2,7,8,9, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Far", Far, 10,7,17,9, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Mall", Mall, 19,7,25,9, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Mellohi", Mellohi, 2,11,8,13, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Stal", Stal, 10,11,17,13, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Strad", Strad, 19,11,25,13, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Ward", Ward, 2,15,8,17, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("11", Elev, 10,15,17,17, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Wait", Wait, 19,15,25,17, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Stop", Stop, 10,1,17,1, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Reboot", Reboot, 19,1,26,1, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Random", Random, 1,1,8,1, colors.cyan, colors.lime, colors.orange, colors.orange)
- page1:add("Page 2", pg2, 19,20,26,20, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("Gaia 1", GaiaOne, 4,3,12,5, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("Gaia 2", GaiaTwo, 15,3,23,5, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("???", Question, 4,7,12,9, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("R-Loop", Roop, 15,7,23,9, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("S-Alive", Slive, 4,11,12,13, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("WYG", WYG, 15,11,23,13, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("Wanderer", WDR, 9,15,18,17, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("Page 1", pg1, 1,20,8,20, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("Stop", Stop, 10,1,17,1, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("Reboot", Reboot, 19,1,26,1, colors.cyan, colors.lime, colors.orange, colors.orange)
- page2:add("Random", Random, 1,1,8,1, colors.cyan, colors.lime, colors.orange, colors.orange)
- end
- main()
- while true do
- t:draw()
- local event, p1 = t:handleEvents(os.pullEvent())
- if event == "button_click" then
- t.buttonList[p1].func()
- end
- end
Add Comment
Please, Sign In to add comment