daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jan 29th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CurrtedProgram = "Desktop"
  2. CurrtedWebsite = ""
  3. while true do
  4. term.setCursorPos(1,1)
  5. term.setBackgroundColor(colors.yellow)
  6. term.setTextColor(colors.white)
  7. term.clear()
  8.    
  9. function PrintCentered(sText)
  10.     local w, h = term.getSize()
  11.     local x, y = term.getCursorPos()
  12.     x = math.max(math.floor((w / 2) - (#sText / 2)), 0)
  13.     term.setCursorPos(x, y)
  14.     print(sText)
  15. end
  16. term.setBackgroundColor(colors.cyan)
  17. term.setTextColor(colors.white)
  18. term.setCursorPos(1,1)
  19. term.clearLine()
  20. write(" TMOS "..CurrtedProgram)
  21. term.setCursorPos(1,2)
  22. term.setBackgroundColor(colors.blue)
  23. function createWindow()
  24. a = {
  25.     [1] = {txt="                                                   ",b=colors.blue,t=colors.white};
  26.     [2] = {txt=" (X)                                               ",b=colors.blue,t=colors.white};
  27.     [3] = {txt="                                                   ",b=colors.blue,t=colors.white};
  28.     [4] = {txt="                                                   ",b=colors.white,t=colors.black};
  29.     [5] = {txt="                                                   ",b=colors.white,t=colors.black};
  30.     [6] = {txt="                                                   ",b=colors.white,t=colors.black};
  31.     [7] = {txt="                                                   ",b=colors.white,t=colors.black};
  32.     [8] = {txt="                                                   ",b=colors.white,t=colors.black};
  33.     [9] = {txt="                                                   ",b=colors.white,t=colors.black};
  34.     [10] = {txt="                                                   ",b=colors.white,t=colors.black};
  35.     [12] = {txt="                                                   ",b=colors.white,t=colors.black};
  36.     [13] = {txt="                                                   ",b=colors.white,t=colors.black};
  37.     [14] = {txt="                                                   ",b=colors.white,t=colors.black};
  38.     [15] = {txt="                                                   ",b=colors.white,t=colors.black};
  39.     [16] = {txt="                                                   ",b=colors.white,t=colors.black};
  40.     [17] = {txt="                                                   ",b=colors.white,t=colors.black};
  41.     [18] = {txt="                                                   ",b=colors.white,t=colors.black};
  42.     [19] = {txt="                                                   ",b=colors.white,t=colors.black};
  43. }
  44. d = 2
  45. for i,n in pairs(a) do
  46.  
  47.     term.setCursorPos(1,d)
  48.     term.setBackgroundColor(n.b)
  49.     term.setTextColor(n.t)
  50.     write(n.txt)
  51.     d = d + 1
  52. end
  53. end
  54.    
  55. local image = paintutils.loadImage("/a2/tskmag")
  56. paintutils.drawImage(image, 5, 3)
  57. term.setBackgroundColor(colors.yellow)
  58. term.setTextColor(colors.black)
  59. write("\n WebBrowser")
  60. local image = paintutils.loadImage("/a2/cmd")
  61. paintutils.drawImage(image, 5, 7)
  62. term.setBackgroundColor(colors.yellow)
  63. term.setTextColor(colors.black)
  64. write("\n Terminal")
  65. local event,button,x,y = os.pullEvent("mouse_click")
  66. if button == 1 and y == 5 and x > 1 and x < 12 then
  67.     while true do
  68.         term.setCursorPos(7,1)
  69.         term.setBackgroundColor(colors.cyan)
  70. term.setTextColor(colors.white)
  71. write("WebBrowser")
  72.     createWindow()
  73.     term.setBackgroundColor(colors.white)
  74.     term.setTextColor(colors.black)
  75.     term.setCursorPos(6,3)
  76. rednet.open("top")
  77.     write("https://www.                               ")
  78.     term.setCursorPos(18,3)
  79.     CurrtedWebsite = read()
  80.     rednet.broadcast(CurrtedWebsite)
  81.     term.setCursorPos(1,5)
  82.     print("Getting Info...")
  83.     id,msg = rednet.receive()
  84.     term.setCursorPos(1,5)
  85.     print("Executeing /.tmp.html")
  86.     a = fs.open(".tmp","w")
  87.     a.write(msg)
  88.     a.close()
  89.     shell.run(".tmp")
  90.     local event,button,x,y = os.pullEvent("mouse_click")
  91.     if y == 3 and x > 1 and x < 4 then
  92.         break
  93.     end
  94.     end
  95. elseif button == 1 and y == 9 and x > 1 and x < 12 then
  96.     while true do
  97.         term.setCursorPos(7,1)
  98.         term.setBackgroundColor(colors.cyan)
  99.         term.setTextColor(colors.white)
  100.         write("Terminal")
  101.         sleep(2)
  102.         createWindow()
  103.         term.setCursorPos(2,3)
  104.         term.setBackgroundColor(colors.blue)
  105.         term.setTextColor(colors.white)
  106.         write("Terminal")
  107.        w,h = term.getSize()
  108.         paintutils.drawFilledBox(1, 5, 51, 19, colors.black)
  109.         x,y = term.getCursorPos()
  110.         if y == 19 then
  111.             term.setCursorPos(1,5)
  112.         else
  113.             term.setCursorPos(x,y)
  114.         end
  115.         while true do    
  116.         write("/device/1/"..shell.dir().." #")
  117.          input = read()
  118.          if input=="exit" then
  119.             break
  120.          else
  121.             shell.run(input)
  122.          end  
  123.          y = y + 1
  124.         end
  125.         break  
  126.     end
  127. elseif x > 1 and x < 6 and y == 1 then
  128.     while true do
  129.         a = {
  130.             "           ";
  131.             " shutdown  ";
  132.             " reboot    ";
  133.             "           ";        
  134.         }
  135.         k = 2
  136.         for i,n in pairs(a) do
  137.             term.setCursorPos(1,k)
  138.             term.setBackgroundColor(colors.cyan)
  139.             term.setTextColor(colors.white)
  140.             term.write(n)
  141.             k = k + 1
  142.         end
  143.         local event,button,x,y = os.pullEvent("mouse_click")
  144.     if y == 3 and x < 12 and button == 1 then
  145.         os.shutdown()
  146.     elseif y == 4 and x < 12 and button == 1 then
  147.         os.reboot()    
  148.     else
  149.         break
  150.     end    
  151.     end
  152. end
  153. end
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top