SHARE
TWEET
Untitled
a guest
Jan 29th, 2018
47
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- CurrtedProgram = "Desktop"
- CurrtedWebsite = ""
- while true do
- term.setCursorPos(1,1)
- term.setBackgroundColor(colors.yellow)
- term.setTextColor(colors.white)
- term.clear()
- function PrintCentered(sText)
- local w, h = term.getSize()
- local x, y = term.getCursorPos()
- x = math.max(math.floor((w / 2) - (#sText / 2)), 0)
- term.setCursorPos(x, y)
- print(sText)
- end
- term.setBackgroundColor(colors.cyan)
- term.setTextColor(colors.white)
- term.setCursorPos(1,1)
- term.clearLine()
- write(" TMOS "..CurrtedProgram)
- term.setCursorPos(1,2)
- term.setBackgroundColor(colors.blue)
- function createWindow()
- a = {
- [1] = {txt=" ",b=colors.blue,t=colors.white};
- [2] = {txt=" (X) ",b=colors.blue,t=colors.white};
- [3] = {txt=" ",b=colors.blue,t=colors.white};
- [4] = {txt=" ",b=colors.white,t=colors.black};
- [5] = {txt=" ",b=colors.white,t=colors.black};
- [6] = {txt=" ",b=colors.white,t=colors.black};
- [7] = {txt=" ",b=colors.white,t=colors.black};
- [8] = {txt=" ",b=colors.white,t=colors.black};
- [9] = {txt=" ",b=colors.white,t=colors.black};
- [10] = {txt=" ",b=colors.white,t=colors.black};
- [12] = {txt=" ",b=colors.white,t=colors.black};
- [13] = {txt=" ",b=colors.white,t=colors.black};
- [14] = {txt=" ",b=colors.white,t=colors.black};
- [15] = {txt=" ",b=colors.white,t=colors.black};
- [16] = {txt=" ",b=colors.white,t=colors.black};
- [17] = {txt=" ",b=colors.white,t=colors.black};
- [18] = {txt=" ",b=colors.white,t=colors.black};
- [19] = {txt=" ",b=colors.white,t=colors.black};
- }
- d = 2
- for i,n in pairs(a) do
- term.setCursorPos(1,d)
- term.setBackgroundColor(n.b)
- term.setTextColor(n.t)
- write(n.txt)
- d = d + 1
- end
- end
- local image = paintutils.loadImage("/a2/tskmag")
- paintutils.drawImage(image, 5, 3)
- term.setBackgroundColor(colors.yellow)
- term.setTextColor(colors.black)
- write("\n WebBrowser")
- local image = paintutils.loadImage("/a2/cmd")
- paintutils.drawImage(image, 5, 7)
- term.setBackgroundColor(colors.yellow)
- term.setTextColor(colors.black)
- write("\n Terminal")
- local event,button,x,y = os.pullEvent("mouse_click")
- if button == 1 and y == 5 and x > 1 and x < 12 then
- while true do
- term.setCursorPos(7,1)
- term.setBackgroundColor(colors.cyan)
- term.setTextColor(colors.white)
- write("WebBrowser")
- createWindow()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.setCursorPos(6,3)
- rednet.open("top")
- write("https://www. ")
- term.setCursorPos(18,3)
- CurrtedWebsite = read()
- rednet.broadcast(CurrtedWebsite)
- term.setCursorPos(1,5)
- print("Getting Info...")
- id,msg = rednet.receive()
- term.setCursorPos(1,5)
- print("Executeing /.tmp.html")
- a = fs.open(".tmp","w")
- a.write(msg)
- a.close()
- shell.run(".tmp")
- local event,button,x,y = os.pullEvent("mouse_click")
- if y == 3 and x > 1 and x < 4 then
- break
- end
- end
- elseif button == 1 and y == 9 and x > 1 and x < 12 then
- while true do
- term.setCursorPos(7,1)
- term.setBackgroundColor(colors.cyan)
- term.setTextColor(colors.white)
- write("Terminal")
- sleep(2)
- createWindow()
- term.setCursorPos(2,3)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- write("Terminal")
- w,h = term.getSize()
- paintutils.drawFilledBox(1, 5, 51, 19, colors.black)
- x,y = term.getCursorPos()
- if y == 19 then
- term.setCursorPos(1,5)
- else
- term.setCursorPos(x,y)
- end
- while true do
- write("/device/1/"..shell.dir().." #")
- input = read()
- if input=="exit" then
- break
- else
- shell.run(input)
- end
- y = y + 1
- end
- break
- end
- elseif x > 1 and x < 6 and y == 1 then
- while true do
- a = {
- " ";
- " shutdown ";
- " reboot ";
- " ";
- }
- k = 2
- for i,n in pairs(a) do
- term.setCursorPos(1,k)
- term.setBackgroundColor(colors.cyan)
- term.setTextColor(colors.white)
- term.write(n)
- k = k + 1
- end
- local event,button,x,y = os.pullEvent("mouse_click")
- if y == 3 and x < 12 and button == 1 then
- os.shutdown()
- elseif y == 4 and x < 12 and button == 1 then
- os.reboot()
- else
- break
- end
- end
- end
- end
RAW Paste Data

