Advertisement
vittoema96

CyberOs

May 12th, 2019 (edited)
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.26 KB | None | 0 0
  1. --------------------------------------
  2. --        WHAT IS THIS?             --
  3. --------------------------------------
  4. -- This is a Lua script for the Minecraft
  5. -- mod Computercraft (or CC: Tweaked).
  6. -----------------------------------
  7. --           WARNING            
  8. -- This program is not meant to  
  9. -- be downloaded.                
  10. -- Please refer to:
  11. -- https://pastebin.com/qJSSf0qg    
  12. -- for an installation guide
  13. -----------------------------------
  14.  
  15. ------------------------------------
  16. --           COMMONS API          --
  17. -- It handles common problems and --
  18. -- delegates what it can't do to  --
  19. -- the guiHandlers                --
  20. ------------------------------------
  21.  
  22.  
  23. -- Definition of the base class for everything
  24. class = {}
  25. setmetatable(class, {})
  26. class.__index = class
  27.  
  28. class.version="0.1"
  29.  
  30. class.MAIN_DIR="CyberOS"
  31.  
  32. class.THEMES_DIR = class.MAIN_DIR .. "/themes"
  33. class.DEFAULT_THEME_DIR = class.THEMES_DIR .. "/default"
  34. class.DEFAULT_ICONS_DIR = class.DEFAULT_THEME_DIR .. "/icons"
  35.  
  36. function class:new(shell)
  37.     local self = {}
  38.     setmetatable(self, {__index = class})
  39.     print("Init base class")
  40.  
  41.     self.shell = shell
  42.     self.x, self.y = term.getSize()
  43.  
  44.     print(self.DEFAULT_ICONS_DIR)
  45.     fs.makeDir(class.THEMES_DIR)
  46.     fs.makeDir(class.DEFAULT_THEME_DIR)
  47.     fs.makeDir(class.DEFAULT_ICONS_DIR)
  48.    
  49.     return self
  50. end
  51.  
  52. function class:initTierApi()
  53.     error("initTierApi not implemented on this device")
  54. end
  55.  
  56. function class:initDeviceApi()
  57.     error("initDeviceApi not implemented on this device")
  58. end
  59.  
  60. function class:write(text, x, y)
  61.     return self:print(text, nil, nil, x, y)
  62. end
  63.  
  64. function class:print(text, fontColor, textColor, x, y)
  65.     error("print not implemented on this device")
  66. end
  67.  
  68. local function getIndexFunction(tierClass, deviceClass)
  69.     local func = function (tab, key)
  70.         -- Get function of base class and of tier and device classes
  71.         local baseFunc = class[key]
  72.         local tierFunc = tierClass[key]
  73.         local deviceFunc = deviceClass[key]
  74.         --  Check that the method is not simply the stub for it
  75.         if baseFunc == tierFunc then
  76.             tierFunc = nil
  77.         end
  78.         if baseFunc == deviceFunc then
  79.             deviceFunc = nil
  80.         end
  81.  
  82.         assert(tierFunc==nil or deviceFunc==nil, "Only one between tierClass and deviceClass can implement "..key)
  83.         -- Return tier or device func if present, otherwise baseFunc if present, otherwise nil
  84.         if tierFunc then return tierFunc elseif deviceFunc then return deviceFunc else return baseFunc end
  85.     end
  86.     return func
  87. end
  88.  
  89. --- Used to create the instance, extending class, tierClass and deviceClass
  90. function createInstance(tierClass, deviceClass, shell)
  91.     -- Prototype class
  92.     local instance = {}
  93.  
  94.     -- INHERITANCE HAPPENS HERE
  95.     -- When class does not have a method, it searches in tierFunc and deviceClass
  96.     setmetatable(instance, {__index = getIndexFunction(tierClass, deviceClass)})
  97.  
  98.     -- set itself as metatable
  99.     instance.__index = instance
  100.    
  101.     -- Define constructor
  102.     function instance:new(shell)
  103.         local self = class:new(shell)
  104.         setmetatable(self, {__index = instance})
  105.         print("Init Mixed class")
  106.  
  107.         self:initTierApi()
  108.         self:initDeviceApi()
  109.        
  110.         return self
  111.     end
  112.  
  113.     return instance:new(shell)
  114. end
  115.  
  116. function class:drawButton(text, x1, y1, x2, y2, func, color)
  117.     assert(x2-x1-string.len(text)>=0, "Text '"..text.."' can't be longer than button width "..x2-x1)
  118.    
  119. end
  120.  
  121.  
  122.  
  123. function class:getWidth()
  124.     return self.x
  125. end
  126.  
  127. function class:getHeight()
  128.     return self.y
  129. end
  130.  
  131. ------------------
  132. -- SHELL RUNNING--
  133. ------------------
  134.  
  135. function class:run(s, arg)
  136.     self.shell.run(s, arg)
  137. end
  138.  
  139. function class:run(s, arg1, arg2, arg3)
  140.     self.shell.run(s, arg1, arg2, arg3)
  141. end
  142.  
  143. function class:loadElementValue(setting, fileName)
  144.     local h = fs.open(fileName, "r")
  145.     local tab = textutils.unserialize(h.readAll())
  146.     h.close()
  147.     return tab[setting]
  148. end
  149.  
  150. function class:getApps()
  151.     local h
  152.     if fs.exists(".apps") == false then
  153.         h = fs.open(".apps", "w")
  154.         h.writeLine("Turtle")
  155.         h.writeLine("Mail")
  156.         h.writeLine("Lua")
  157.         h.writeLine("Disk")
  158.         if term.isColor() then --- TODO ---
  159.             h.writeLine("Paint")
  160.             h.writeLine("Game")
  161.         end
  162.         h.writeLine("Off")
  163.         h.writeLine("Add")
  164.         h.writeLine("Add")
  165.     end
  166.     h = fs.open(".apps", "r")
  167.     local tab = {}
  168.     local line = h.readLine()
  169.     local i = 1
  170.     while line ~= nil do
  171.         tab[i] = line
  172.         i = i + 1
  173.         line = h.readLine()
  174.     end
  175.     return tab
  176. end
  177.  
  178.  
  179. ----------------------------
  180. -- Draws the Main Menu    --
  181. -- for advanced computers --
  182. ----------------------------
  183.  
  184. function drawMain()
  185.        
  186.         guiHandler.drawImageTheme("blankMain") --mainBackground drawn
  187.         sFill=""
  188.         for i=1, 51-(string.len(version)+9) do
  189.             sFill=sFill.." "
  190.         end
  191.         blit("CyberOs v"..version..sFill, "0", "5",1,1) -- disegna la barra in alto
  192.        
  193.         for i=0, 9 do
  194.             local appName=""
  195.             if i==0 then appName = "Turtle"
  196.             elseif i==1 then appName = "PIM"     blit("#####","7","f",4+10*(i%5), 6+math.floor(i/5)*6)
  197.             elseif i==2 then appName = "Mail"
  198.             elseif i==3 then appName = "Lua"     blit("ua","0","5",7+10*(i%5), 6+math.floor(i/5)*6)
  199.             elseif i==4 then appName = "Disk"
  200.             elseif i==5 then appName = "Paint"
  201.             elseif i==6 then appName = "Game"
  202.             elseif i==7 then appName = "Unknown"
  203.             elseif i==8 then appName = "Unknown"
  204.             else appName = "Off" end
  205.            
  206.             local img = guiHandler.loadImageTheme("App"..appName)
  207.             paintutils.guiHandler.drawImage(img,3+10*(i%5),4+math.floor(i/5)*6)
  208.             blit(appName, "0", "f",3+10*(i%5)+math.floor((7-string.len(appName))/2), 8+math.floor(i/5)*6)
  209.         end
  210.        
  211.        
  212.         blit("MainMenu: click the Icons!", "0", "7", 12, 17)
  213.         term.setCursorPos(2,16)
  214.         term.blit("/ \\","888","f8f")
  215.         term.setCursorPos(2,17)
  216.         term.blit(" O ","888","8f8")
  217.         term.setCursorPos(2,18)
  218.         term.blit("\\ /","888","f8f")
  219.        
  220.    
  221. end
  222.  
  223. ---------------------------
  224. -- The cycle for click   --
  225. -- handling for advanced --
  226. -- computers             --
  227. ---------------------------
  228.  
  229. function wait4clickMain()
  230.     while true do
  231.             local event, button, x, y = os.pullEvent("mouse_click")
  232.             if button==1 then
  233.                 if y>3 and y<9 then
  234.                     if x>2 and x<10 then
  235.                         s="Turtle"
  236.                         turtleClick()
  237.                     elseif x>12 and x<20 then
  238.                         s="PIM"
  239.                     elseif x>22 and x<30 then
  240.                         s="Mail"
  241.                     elseif x>32 and x<40 then
  242.                         s="Lua"
  243.                         term.clear()
  244.                         sFill=""
  245.                         for i=1, 51-(string.len(version)+9) do
  246.                             sFill=sFill.." "
  247.                         end
  248.                         blit("CyberOs v"..version..sFill, "0", "5",1,1)
  249.                         term.setCursorPos(1,2)
  250.                         run("lua", "")
  251.                     elseif x>42 and x<50 then
  252.                         s="Disk"
  253.                     end
  254.                 elseif y>9 and y<15 then
  255.                     if x>2 and x<10 then
  256.                         s="Paint"
  257.                         paintClick()
  258.                     elseif x>12 and x<20 then
  259.                         s="Game"
  260.                         run("rom/programs/fun/advanced/redirection")
  261.                     elseif x>22 and x<30 then
  262.                         s="1?"
  263.                     elseif x>32 and x<40 then
  264.                         s="2?"
  265.                     elseif x>42 and x<50 then
  266.                         s="Off"
  267.                         offClick()
  268.                     end
  269.                 end
  270.             end
  271.     end
  272. end
  273.  
  274.  
  275. -----------------------
  276. -- Handles the click --
  277. -- of TURTLE app        --
  278. -----------------------
  279.  
  280.  
  281. function turtleClick()
  282.     guiHandler.drawImageTheme("blankMain")
  283.     local ids={}
  284.     local labels={}
  285.     for i=0, 7 do
  286.             local turtleLabel = loadElementValue(i+1, "label", ".registeredTurtles")
  287.             local turtleId
  288.             if i==7 then
  289.                 turtleLabel="[Back]"
  290.                 turtleId=-1
  291.             elseif turtleLabel == nil then
  292.                 turtleLabel="[+]"
  293.                 turtleId=-1
  294.             else
  295.                 turtleId=tonumber(loadElementValue(i+1, "id", ".registeredTurtles"))
  296.             end
  297.             ids[i+1]=turtleId
  298.             labels[i+1]=turtleLabel
  299.             local img
  300.             if turtleLabel=="[+]" then
  301.                 img = guiHandler.loadImageTheme("Add")
  302.             elseif turtleLabel=="[Back]" then
  303.                 img = guiHandler.loadImageTheme("Back")
  304.             else
  305.                 img = guiHandler.loadImageTheme("Turtle")
  306.             end
  307.             paintutils.guiHandler.drawImage(img,3+12*(i%4),4+math.floor(i/4)*6)
  308.             blit(turtleLabel, "0", "f",3+12*(i%4)+math.floor((7-string.len(turtleLabel))/2), 8+math.floor(i/4)*6)
  309.     end
  310.    
  311.     while true do
  312.         local event, button, x, y = os.pullEvent("mouse_click")
  313.         if button==1 then
  314.             if x>2 and (x-2)%12>0 and x<51 and y>3 and y<14 and (y-3)%6>0 then
  315.                     x=x-((x-2)%12)+1
  316.                     y=y-((y-3)%6)+1      
  317.                     i=(x-3)/12+(y-4)*4/6
  318.                     if ids[i+1]==-1 then
  319.                         if labels[i+1]=="[Back]" then
  320.                             break
  321.                         elseif labels[i+1]=="[+]" then
  322.                        
  323.                         guiHandler.drawImageTheme("blankMain")
  324.                        
  325.                         blit("        ", "0","5",3,4)
  326.                         blit(" [Add]  ", "0","5",3,5)
  327.                         blit("        ", "0","5",3,6)
  328.                        
  329.                         blit("        ", "0","e",3,8)
  330.                         blit(" [Back] ", "0","e",3,9)
  331.                         blit("        ", "0","e",3,10)
  332.                         blit("Place the TURTLE under the PC", "0","f",18,5)
  333.                         blit("and click [Add]", "0","f",18,6)
  334.                         blit("(Make sure the turtle has a MODEM,","0","f",18,7)
  335.                         blit("or it will not work)", "0","f",18,8)
  336.                         while true do
  337.                             event, button, x, y = os.pullEvent("mouse_click")
  338.                             if button==1 and y>=4 and y<=6 and x>=3 and x<=10 then
  339.                                 if (not peripheral.isPresent("bottom")) or (peripheral.isPresent("bottom") and peripheral.getType("bottom")~="turtle") then
  340.                                     blit("ERROR, NO TURTLE FOUND", "e","f",18,10)
  341.                                 end
  342.                             elseif button==1 and y>=8 and y<=10 and x>=3 and x<=10 then
  343.                                 break
  344.                             end
  345.                         end
  346.                         break
  347.                        
  348.                        
  349.                         end
  350.                     else
  351.                         guiHandler.drawImageTheme("blankMain")
  352.                         paintutils.guiHandler.drawImage(guiHandler.loadImageTheme("Turtle"),3,4)
  353.                        
  354.                         blit("[Back]", "0","e", 4, 10)
  355.                        
  356.                         centerBlit("ID","0","7", 14, 4, 10)
  357.                         centerBlit(ids[i+1],"f","8",14,5,10)
  358.                        
  359.                         centerBlit("Label","0","7", 26, 4, 10)
  360.                         centerBlit(labels[i+1],"f","8",26,5,10)
  361.                        
  362.                         centerBlit("Program Running", "0","7", 14, 8, 22)
  363.                         centerBlit("**FAILED COMUNICATION**", "f","8", 14, 9, 22)
  364.                         while true do
  365.                             event, button, x, y = os.pullEvent("mouse_click")
  366.                             if button==1 and y==10 and x>=4 and x<10 then
  367.                                 break
  368.                             end
  369.                         end
  370.                         break
  371.                     end
  372.             end
  373.         end
  374.     end
  375.     if labels[i+1]=="[Back]" then
  376.         loadMain(ADVANCEDCOMPUTER)
  377.     else
  378.         turtleClick()
  379.     end
  380. end
  381.  
  382.  
  383.  
  384. function centerBlit(text, charT, charB, x, y, length)
  385.     space=length-string.len(text)
  386.     s=""
  387.     for i=1, math.floor(space/2) do
  388.         s=s.." "
  389.     end
  390.     text=s..text
  391.     if space%2==1 then
  392.         s=s.." "
  393.     end
  394.     text=text..s
  395.     blit(text, charT, charB, x, y)
  396. end
  397.  
  398. -----------------------
  399. -- Handles the click --
  400. -- of OFF app        --
  401. -----------------------
  402.  
  403. function offClick()
  404.         guiHandler.drawImageTheme("OffPrompt")
  405.         blit("Restart", "0", "5", 11, 13)
  406.         blit("<-", "0", "5", 25, 13)
  407.         blit("Shutdown", "0", "5", 35, 13)
  408.         blit("What would you like to do?",  "0","7", 12, 17)
  409.         flag=false
  410.         while not flag do
  411.             local event, button, x, y = os.pullEvent("mouse_click")
  412.             if y>2 and y<15 then
  413.                 if x>4 and x<23 then
  414.                     os.reboot()
  415.                 elseif x>29 and x<47 then
  416.                     os.shutdown()
  417.                 elseif x>23 and x<29 and y>11 then
  418.                     flag=true
  419.                     loadMain(ADVANCEDCOMPUTER)
  420.                 end
  421.             end
  422.         end
  423. end
  424.  
  425. -----------------------
  426. -- Handles the click --
  427. -- of PAINT app      --
  428. -----------------------
  429.  
  430.  
  431. function paintClick()
  432.         guiHandler.drawImageTheme("PaintPrompt")
  433.         blit("New IMG", "0", "5", 11, 13)
  434.         blit("<-", "0", "5",25,13)
  435.         blit("Edit IMG", "0", "5", 35, 13)
  436.         blit("What would you like to do?",  "0","7",12,17)
  437.        
  438.         flag=false
  439.         while not flag do
  440.             term.setCursorPos(12,17)
  441.             local event, button, x, y = os.pullEvent("mouse_click")
  442.             if y>2 and y<15 then
  443.                 if x>4 and x<23 then
  444.                     blit("New File name:             ",  "0","7", 12,17)
  445.                     term.setCursorPos(26,17)
  446.                     term.setCursorBlink(true)
  447.                     fileName=io.read()
  448.                     run("paint","paintFiles/"..fileName)
  449.                     loadMain(ADVANCEDCOMPUTER)
  450.                 elseif x>29 and x<47 then
  451.                     --Here you edit the ImgFiles
  452.                     local tabN = table.getn(fs.list("paintFiles/"))
  453.                     local page = 0
  454.                     local pageMax = math.floor((tabN-1)/12)
  455.                     local hasToStay = true
  456.                     while hasToStay do
  457.                         guiHandler.drawImageTheme("blankMain")
  458.                         for i=0, 14 do
  459.                             fileName=""
  460.                             if  page>0 and i==12 then
  461.                                 fileName=" <<<< "
  462.                             elseif i==13 then
  463.                                 fileName=" Back "
  464.                             elseif page<pageMax and i==14 then
  465.                                 fileName=" >>>> "
  466.                             elseif page==pageMax and tabN%12>0 and i>=tabN%12 and i~=14 then
  467.                                 fileName=" - - - "
  468.                             elseif i<12 then
  469.                                 fileName=fs.list("paintFiles/")[i+page*12+1]
  470.                             end
  471.                             local backColor=""
  472.                             if fileName==" >>>> " or fileName==" <<<< " or fileName==" Back " then
  473.                                 backColor="b"
  474.                             elseif fileName=="" then
  475.                                 backColor="f"
  476.                             else
  477.                                 backColor="5"
  478.                             end
  479.                             sL = string.len(fileName)
  480.                             if sL>11 then
  481.                                 fileName = string.sub(fileName, 1, 10)..".."
  482.                             elseif sL<10 then
  483.                                 fileName=" "..fileName.." "
  484.                             end
  485.                             if fileName~="" then
  486.                                 blit(fileName, "0", backColor, 3+(i%4)*12,4+math.floor(i/4)*3)
  487.                             end
  488.                         end
  489.                        
  490.                         blit("Select the file you want to edit",  "0","7", 12, 17)
  491.  
  492.                         local event, button, x, y = os.pullEvent("mouse_click")
  493.                         if button==1 then
  494.                             if x>2 and (x-2)%12>0 and x<51 and y>3 and y<14 and (y-1)%3==0 then
  495.                                 x=x-((x-2)%12)+1
  496.                                 i=((16*y+x)-67)/12
  497.                                 if i==12 and page>0 then
  498.                                     page=page-1
  499.                                 elseif i==13 then
  500.                                     flag=true
  501.                                     hasToStay=false
  502.                                     loadMain(ADVANCEDCOMPUTER)
  503.                                 elseif i==14 and page<pageMax then
  504.                                     page=page+1
  505.                                 elseif i<12 and i+page*12<tabN-1 then
  506.                                     flag2=true
  507.                                     fname = fs.list("paintFiles/")[i+page*12+1]
  508.                                     term.write(fname)
  509.                                     run("paint","paintFiles/"..fname)
  510.                                 end
  511.                             end
  512.                         end
  513.                        
  514.                     end
  515.                 elseif x>23 and x<29 and y>11 then
  516.                     flag=true
  517.                     loadMain(ADVANCEDCOMPUTER)
  518.                 end
  519.             end
  520.         end
  521. end
  522.  
  523.  
  524. -----------------------------------------
  525. -- Enhancement of pre-existing blit    --
  526. -- Draws the TEXT with charT textColor --
  527. -- and charB backColor at X, Y coord   --
  528. -----------------------------------------
  529.  
  530. ------------------------
  531. -- gets color.COLOR   --
  532. -- returns hex for it --
  533. ------------------------
  534.  
  535. function col2hex(color)
  536.     local hexstr = '0123456789abcdef'
  537.     local s = ''
  538.     color = math.log10(color)/math.log10(2)
  539.     while color > 0 do
  540.         local mod = math.fmod(color, 16)
  541.         s = string.sub(hexstr, mod+1, mod+1) .. s
  542.         color = math.floor(color / 16)
  543.     end
  544.     if s == '' then s = '0' end
  545.     return s
  546. end
  547.  
  548. function split (inputstr, sep)
  549.         if sep == nil then
  550.                 sep = "%s"
  551.         end
  552.         local t={}
  553.         for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
  554.                 table.insert(t, str)
  555.         end
  556.         return t
  557. end
  558.  
  559. ---------------------------------
  560. -- Divides a long message in
  561. -- multiple lines given the line
  562. -- length (x)
  563. -- Specifying a y it will throw error
  564. -- if it can't divide the message in
  565. -- less than y lines of length x
  566. -----------------------------------
  567. function formatString(msg, x, y)
  568.     local i = 0
  569.     if string.len(msg) > x then
  570.         local newMsg = {}
  571.         for w = x, 1, -1 do
  572.             if string.len(msg)<=x then
  573.                 i = i+1
  574.                 newMsg[i] = msg
  575.                 break
  576.             end
  577.             if msg:sub(w, w) == " " then
  578.                 i = i+1
  579.                 newMsg[i] = msg:sub(1, w-1)
  580.                 msg = msg:sub(w+1, -1)
  581.                 w = x
  582.             end
  583.         end
  584.         msg = newMsg
  585.     else
  586.         msg = {msg}
  587.     end
  588.     if y~=nil then
  589.         if #msg>y then
  590.             basicWarning("Impossible to format the string", x, y)
  591.             assert(#msg<=y, "Impossible to format the string")
  592.         elseif #msg<=y then
  593.             local newMsg = {}
  594.             for k=1, math.floor((y-#msg)/2) do
  595.                 newMsg[k] = " "
  596.             end
  597.             local n = #newMsg
  598.             for k, line in ipairs(msg) do
  599.                 newMsg[n+k] = line
  600.             end
  601.             for k=1, math.ceil((y-#msg)/2) do
  602.                 newMsg[#newMsg+k] = " "
  603.             end
  604.             msg = newMsg
  605.         end
  606.     end
  607.     for k, word in ipairs(msg) do
  608.         msg[k] = centerWithSpaces(msg[k], x)
  609.     end
  610.     return msg
  611. end
  612.  
  613. function fillWithSpaces(str, x)
  614.     local fillLength = x-string.len(str)
  615.     return str..string.rep(" ", fillLength)
  616. end
  617.  
  618. function centerWithSpaces(str, x)
  619.     local fillLength = x-string.len(str)
  620.     return string.rep(" ", math.floor(fillLength/2))..str..string.rep(" ", math.ceil(fillLength/2))
  621. end
  622.  
  623. function drawFrame(character, topText, bottomText)
  624.  
  625.     local x, y = term.getSize()
  626.  
  627.     if character==nil then character = "#" end
  628.    
  629.     if topText then
  630.         topText = " "..topText.." "
  631.     else
  632.         topText = ""
  633.     end
  634.     local textL = string.len(topText)
  635.     topText = string.rep(character, math.floor((x-textL)/2)) .. topText .. string.rep(character, math.floor((x-textL)/2))
  636.  
  637.     term.setCursorPos(1, 1)
  638.     term.write(topText)
  639.    
  640.     if bottomText then
  641.         bottomText = " "..bottomText.." "
  642.     else
  643.         bottomText = ""
  644.     end
  645.     textL = string.len(bottomText)
  646.     bottomText = string.rep(character, math.floor((x-textL)/2)) .. bottomText .. string.rep(character, math.floor((x-textL)/2))
  647.  
  648.     term.setCursorPos(1, y)
  649.     term.write(bottomText)
  650.  
  651.     for j=1, y do      
  652.         term.setCursorPos(1, j)
  653.         term.write(character)
  654.         term.setCursorPos(x, j)
  655.         term.write(character)
  656.     end
  657. end
  658.        
  659. function basicWarning(msg)
  660.     term.clear()
  661.     drawFrame("!", "WARNING", "Press ENTER to continue")
  662.     local x, y = term.getSize()
  663.     local disclaimer = CyberOs.formatString(msg, x-4, y-4)
  664.     for k, v in ipairs(disclaimer) do
  665.         if v ~= string.rep(" ", x) then
  666.             disclaimer[k-1] = centerWithSpaces("###WARNING###", x)
  667.             break
  668.         end
  669.     end
  670.     for k, v in ipairs(disclaimer) do
  671.         term.setCursorPos(3, 3+k)
  672.         term.write(v)
  673.     end
  674.     read()
  675.     term.clear()
  676. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement