Advertisement
Skullblade

ShockBrowser V2.00pr2

Jan 7th, 2013
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.74 KB | None | 0 0
  1. vers="2.00pr2"
  2. --ShockBrowser V1.10
  3. --By Skullblade/Skullblade213
  4. --A Basic GUI File Browser In Beta
  5. --Credits!
  6. --Special Thanks to BigSHinyToys for permission to use his GUI setup:D
  7. --Lua-users.org rounding function (http://lua-users.org/wiki/SimpleRound)
  8.  
  9. function round(num, idp)
  10.     local mult = 10^(idp or 0)
  11.     return math.floor(num * mult + 0.5) / mult
  12. end
  13. function Scrolling(msg)
  14.     term.setBackgroundColor(ButtonBack)
  15.     y=4
  16.     for i=1,15 do
  17.         term.setCursorPos(51,y)
  18.         print(" ")
  19.         if i==1 then
  20.             term.setCursorPos(51,y)
  21.             print("-")
  22.         end
  23.         if i==15 then
  24.             term.setCursorPos(51,y)
  25.             print("+")
  26.         end
  27.         y=y+1
  28.         i=i+1
  29.     end
  30.     FileList = fs.list(direct)
  31.     nume=1
  32.     while FileList[nume] ~= nil do
  33.         nume=nume+1
  34.     end
  35.     term.setCursorPos(1,1)
  36.     Current=round(CursorChange/nume*15, 0)
  37.     if Current>15 then
  38.         Current=15
  39.     end
  40.     term.setBackgroundColor(colors.gray)
  41.     if Current+4>18 then
  42.         Current=18-4
  43.     end
  44.     term.setCursorPos(51,Current+4)
  45.     print(" ")
  46. end
  47. function ColorCheck()
  48.     if fs.exists("SB-Config") == false then
  49.         file=fs.open("SB-Config", "w")
  50.         file.writeLine("--Colors")
  51.         file.writeLine("   ")
  52.         file.writeLine("HeaderBack=2048")
  53.         file.writeLine("HeaderText=colors.purple")
  54.         file.writeLine("ButtonBack=256")
  55.         file.writeLine("ButtonText=1")
  56.         file.writeLine("Background=8")
  57.         file.writeLine("Text=32768")
  58.         file.writeLine("   ")
  59.         file.writeLine("--Use any computercraft color code format")
  60.         file.writeLine("--Defult Color Codes")
  61.         file.writeLine("   ")
  62.         file.writeLine("--HeaderBack=2048")
  63.         file.writeLine("--HeaderText=colors.purple")
  64.         file.writeLine("--ButtonBack=1")
  65.         file.writeLine("--ButtonText=256")
  66.         file.writeLine("--Background=8")
  67.         file.writeLine("--Text=32768")
  68.         file.writeLine("   ")
  69.         file.writeLine("--Auto Check For Updates")
  70.         file.writeLine("   ")
  71.         file.writeLine("AutoCheck=true")
  72.         file.writeLine("   ")
  73.         file.writeLine("--'Icons'")
  74.         file.writeLine("   ")
  75.         file.writeLine('DirIcon="[D]"')
  76.         file.writeLine('DirColor=colors.red')
  77.         file.writeLine('DiskIcon="[E]"')
  78.         file.writeLine('DiskColor=colors.pink')
  79.         file.writeLine('RecyIcon="[R]"')
  80.         file.writeLine('RecyColor=colors.yellow')
  81.         file.writeLine('FileIcon="[F]"')
  82.         file.writeLine('FileColor=colors.lime')
  83.         file.close()
  84.     end
  85. end
  86. function Updater()
  87.     runningProg=shell.getRunningProgram()
  88.     if fs.exists(".temp") == true then
  89.         fs.delete(".temp")
  90.     end
  91.     if ForceU==true and http then
  92.         print("Force Update")
  93.         sleep(.5)
  94.         file=fs.open(".temp", "w")
  95.         file.writeLine('fs.delete(runningProg) shell.run("pastebin get pcaVwGY8 "..runningProg) fs.delete(".temp") term.clear() term.setCursorPos(1,1) print("Downloaded to "..runningProg)')
  96.         file.close()       
  97.         shell.run(".temp")
  98.     elseif AutoCheck==true and http and ForceU==false then
  99.         action="No"
  100.         term.setTextColor(colors.black)
  101.         shell.run("pastebin get byX1Gv6a .temp")
  102.         term.setTextColor(colors.white)
  103.         shell.run(".temp")
  104.         fs.delete(".temp")
  105.         if version~=vers then
  106.             term.clear()
  107.             term.setBackgroundColor(colors.blue)
  108.             term.setCursorPos(10,5)
  109.             write("Update?                         ")
  110.             term.setBackgroundColor(colors.red)
  111.             print("X")
  112.             term.setCursorPos(10,6)
  113.             term.setBackgroundColor(colors.lightGray)
  114.             print("                                 ")
  115.             term.setCursorPos(10,7)
  116.             print("                                 ")
  117.             term.setCursorPos(10,8)
  118.             print("                                 ")
  119.             term.setCursorPos(10,9)
  120.             print("                                 ")
  121.             term.setCursorPos(10,10)
  122.             print("                                 ")
  123.             term.setCursorPos(10,11)
  124.             print("                                 ")
  125.             term.setCursorPos(10,6)
  126.             term.setTextColor(colors.black)
  127.             print(" Update ShockBrowser?")
  128.             term.setTextColor(colors.white)
  129.             term.setCursorPos(10,7)
  130.             print(" Current Version="..version)
  131.             term.setCursorPos(10,8)
  132.             print(" Your Version="..vers)
  133.             term.setTextColor(colors.red)
  134.             term.setCursorPos(10,10)
  135.             print("     [Yes]          [No]")
  136.             term.setTextColor(colors.white)
  137.             term.setBackgroundColor(colors.black)
  138.             while true do
  139.                 action="none"
  140.                 event, button,x, y = os.pullEvent("mouse_click")
  141.                 if x>14 and x<20 and y==10 then
  142.                     action="Yes"
  143.                     break
  144.                 end
  145.                 if (x>29 and x<34 and y==10) or (y==5 and x==42) then
  146.                     action="No"
  147.                     break
  148.                 end
  149.             end
  150.             if action=="Yes" then
  151.                 file=fs.open(".temp", "a")
  152.                 file.writeLine('fs.delete(runningProg) shell.run("pastebin get pcaVwGY8 "..runningProg) term.clear() term.setCursorPos(1,1) print("Downloaded to "..runningProg)')
  153.                 file.close()
  154.                 shell.run(".temp")
  155.             end
  156.         end
  157.     end
  158.     if fs.exists(".temp") == true then
  159.         fs.delete(".temp")
  160.     end
  161. end
  162. function yInc()
  163.     if yChange=="Up" then
  164.         y1=y1-1
  165.     end
  166.     if yChange=="Down" then
  167.         y1=y1+1
  168.     end
  169. end
  170. function Run(types)
  171.     term.setBackgroundColor(colors.black)
  172.     term.setTextColor(colors.white)
  173.     term.clear()
  174.     term.setCursorPos(1,1)
  175.     shell.run(Direct.."/"..FileList[y-3+CursorChange],ar)
  176.     term.setCursorPos(9,17)
  177.     print("Finished Running : "..FileList[y-3+CursorChange])
  178.     term.setCursorPos(9,18)
  179.     print("Click anywere to continue")
  180.     event, buttonb, xx, yy = os.pullEvent("mouse_click")
  181. end
  182. function Draw()
  183.     ColorCheck()
  184.     shell.run("SB-Config")
  185.     term.setTextColor(Text)
  186.     term.setBackgroundColor(Background)
  187.     term.clear()
  188.     term.setCursorPos(1,1)
  189.     term.setBackgroundColor(HeaderBack)
  190.     term.setTextColor(HeaderText)
  191.     term.clearLine()
  192.     print("ShockBrowser")
  193.     term.setCursorPos(51, 1)
  194.     term.setTextColor(colors.white)
  195.     term.setBackgroundColor(colors.red)
  196.     print("X")
  197.     term.setCursorPos(1,2)
  198.     term.setBackgroundColor(ButtonBack)
  199.     term.setTextColor(ButtonText)
  200.     term.clearLine()
  201.     dir = Direct
  202.     if Direct == "" then
  203.         dir = "/"
  204.     end
  205.     print(dir)
  206.     term.setCursorPos(1,3)
  207.     term.setBackgroundColor(HeaderBack)
  208.     term.setTextColor(HeaderText)
  209.     write(" < ")
  210.     term.setBackgroundColor(Background)
  211.     term.setTextColor(Text)
  212.     print("Back")
  213. end
  214. function message(msg)
  215.     term.setCursorPos(15,7)
  216.     term.setBackgroundColor(HeaderBack)
  217.     term.setTextColor(HeaderText)
  218.     write("                        ")
  219.     term.setBackgroundColor(colors.red)
  220.     term.setTextColor(colors.white)
  221.     print("X")
  222.     term.setCursorPos(15,7)
  223.     term.setBackgroundColor(HeaderBack)
  224.     term.setTextColor(HeaderText)
  225.     print(msg[1])
  226.     term.setBackgroundColor(ButtonBack)
  227.     term.setTextColor(ButtonText)
  228.     term.setCursorPos(15,8)
  229.     print("                         ")
  230.     term.setCursorPos(15,9)
  231.     print("                         ")
  232.     term.setCursorPos(15,10)
  233.     print("                         ")
  234.     term.setCursorPos(15,11)
  235.     print("                      OK ")
  236.     if msg[2]~=nil then
  237.         term.setCursorPos(15,8)
  238.         print(msg[2])
  239.     end
  240.     term.setBackgroundColor(ButtonText)
  241.     term.setTextColor(ButtonBack)
  242.     term.setCursorPos(16,10)
  243.     print("/                      ")
  244.     input=""
  245.     while true do
  246.         event,param1,param2,param3=os.pullEvent()
  247.         if event=="mouse_click" then
  248.             if param2==39 and param3==7 then
  249.                 break
  250.             end
  251.             if (param2>15 and param2<39) and param3==10 then
  252.                 term.setBackgroundColor(ButtonText)
  253.                 term.setTextColor(ButtonBack)
  254.                 term.setCursorPos(16,10)
  255.                 print("/                      ")
  256.                 term.setCursorPos(17,10)
  257.                 input=read()
  258.             end
  259.             if input~="" and (param2==37 or param2==38) and param3==11 then
  260.                 return input
  261.             end
  262.         end
  263.         if event=="key" then
  264.             if param1==28 and input~="" then
  265.                 return input
  266.             end
  267.         end
  268.     end
  269. end
  270. function DrawMenu(cords,msg,act)
  271.     if cords[3]~=nil and cords[3]=="calc" and yChange=="Up" then
  272.         cords[2]=yarc-(cords[2]-yarc)
  273.     elseif cords[3]==nil then
  274.         if cords[2]>18 then
  275.             cords[2]=18
  276.         end
  277.         yarc=cords[2]
  278.         y1=cords[2]
  279.         x1=cords[1]
  280.         yChange="Down"
  281.         if y1+msg[1]>18 then
  282.             yChange="Up"
  283.         end
  284.     end
  285.     yarc=cords[2]
  286.     y1=cords[2]
  287.     x1=cords[1]
  288.     term.setBackgroundColor(HeaderBack)
  289.     term.setTextColor(HeaderText)
  290.     term.setCursorPos(x1,y1)
  291.     print(msg[2])
  292.     yInc()
  293.     term.setBackgroundColor(ButtonBack)
  294.     term.setTextColor(ButtonText)
  295.     for h=3,#msg do
  296.         term.setCursorPos(x1,y1)
  297.         print(msg[h])
  298.         yInc()
  299.         h=h+1
  300.     end
  301.     event, button, xx, yy = os.pullEvent("mouse_click")
  302.     if yChange=="Down" and act[yy-cords[2]]~=nil then
  303.         if xx>cords[1]-1 and string.len(msg[yy-cords[2]+2])+cords[1]>xx then
  304.             act[yy-cords[2]]()
  305.         end
  306.     elseif yChange=="Up" and act[cords[2]-yy]~=nil then
  307.         if xx>cords[1]-1 and string.len(msg[cords[2]-yy+2])+cords[1]>xx then
  308.             act[cords[2]-yy]()
  309.         end
  310.     end
  311. end
  312. function FileL(direct)
  313.     CursorChange=0
  314.     while true do
  315.         Direct = direct
  316.         Draw()
  317.         Scrolling(direct)
  318.         term.setBackgroundColor(Background)
  319.         term.setTextColor(Text)
  320.         if recents[1] == direct then
  321.             table.remove(recents, 1)
  322.         end
  323.         table.insert(recents, 1, direct)
  324.         if direct == "" then
  325.             recents = {}
  326.         end
  327.         FileList = fs.list(direct)
  328.         num=1
  329.         nume=#FileList+1
  330.         y=4
  331.         while FileList[num+CursorChange] ~= nil do
  332.             if num == 16 then
  333.                 break
  334.             end
  335.             isDir = fs.isDir(direct.."/"..FileList[num+CursorChange])
  336.             if isDir == true then  
  337.                 term.setCursorPos(1,y)
  338.                 term.setTextColor(DirColor)
  339.                 write(DirIcon)
  340.                 if FileList[num+CursorChange] == "disk" or FileList[num+CursorChange] == "disk2" or FileList[num+CursorChange] == "disk3" or FileList[num+CursorChange] == "disk4" or FileList[num+CursorChange] == "disk5" or FileList[num+CursorChange] == "disk6" then
  341.                     term.setCursorPos(1,y)
  342.                     term.setTextColor(DiskColor)
  343.                     write(DiskIcon)
  344.                 end
  345.                 if FileList[num+CursorChange] == "RecycleBin" then
  346.                     term.setCursorPos(1,y)
  347.                     term.setTextColor(RecyColor)
  348.                     write(RecyIcon)
  349.                 end
  350.             else
  351.                 term.setCursorPos(1,y)
  352.                 term.setTextColor(FileColor)
  353.                 write(FileIcon)
  354.             end
  355.             term.setTextColor(Text)
  356.             print(FileList[num+CursorChange])
  357.             num=num+1
  358.             y=y+1
  359.         end
  360.         Mouse()
  361.         if broke == "true" then
  362.             term.setBackgroundColor(colors.black)
  363.             term.clear()
  364.             term.setTextColor(colors.yellow)
  365.             term.setCursorPos(1,1)
  366.             print("Thanks For Using ShockBrowser")
  367.             term.setTextColor(colors.white)
  368.             return
  369.         end
  370.     end
  371. end
  372. function Mouse()
  373.     event, button, x, y = os.pullEvent()   
  374.     if event=="mouse_click" then
  375.         OldClick = "False"
  376.         broke = "false"
  377.         if y>4 and y<18 and x==51 then
  378.             CursorChange=round(((y-4)/15)*nume, 0)
  379.             OldClick="True"
  380.         end
  381.         if y == 1 and x == 51 and OldClick ~= "True" then
  382.             broke = "true"
  383.             OldClick = "True"
  384.         end
  385.         FileLen=0
  386.         if FileList[y-3+CursorChange] ~= nil then
  387.             FileLen = string.len(FileList[y-3+CursorChange])
  388.         end
  389.         if (x==51 and y==4) and OldClick ~= "True" then
  390.             if CursorChange~=0 then
  391.                 CursorChange=CursorChange-1
  392.             end
  393.             OldClick = "True"
  394.         end
  395.         if (x==51 and y==18) and OldClick ~= "True" then
  396.             if CursorChange ~= nume-2 then
  397.                 CursorChange=CursorChange+1
  398.             end
  399.             OldClick = "True"
  400.         end
  401.         if OldClick ~= "True" and broke=="false" then
  402.             if ((x==1 or x==2 or x==3) and y > 3 and y < num+3) or (x < FileLen+4 and x > 3 and y > 3 and y < num+3 and button == 2) then
  403.                 isDir = fs.isDir(Direct.."/"..FileList[y-3+CursorChange])
  404.                 Old="False"
  405.                 if isDir == true and ((FileList[y-3+CursorChange] == "disk") or (FileList[y-3+CursorChange] == "disk2") or (FileList[y-3+CursorChange] == "disk3") or (FileList[y-3+CursorChange] == "disk4") or (FileList[y-3+CursorChange] == "disk5") or (FileList[y-3+CursorChange] == "disk6")) then
  406.                     Old="True"
  407.                     DrawMenu({x,y},{4,"Disk       ","Open       ","Label      ","Eject      "},
  408.                     {function() direct = tostring(Direct.."/"..FileList[y-3+CursorChange]) FileL(direct);end,
  409.                     function() dn=message({"Disk Side"}) if dn~=nil then ld=message({"Disk Label"}) if ld~=nil then S={"left","right","front","back","top","bottom"}realSide=false for i=1,#S do if S[i]==dn then realSide=true end i=i+1 sleep(0) end if realSide==true and disk.getMountPath(dn)==FileList[y-3+CursorChange] then disk.setLabel(dn,ld) end end end;end,
  410.                     function() dn=message({"Disk Side"}) if dn~=nil then S={"left","right","front","back","top","bottom"}realSide=false for i=1,#S do if S[i]==dn then realSide=true end i=i+1 sleep(0) end if realSide==true and disk.getMountPath(dn)==FileList[y-3+CursorChange] then disk.eject(dn)end end;end})
  411.                 end
  412.                 if string.lower(shell.resolve(Direct.."/"..FileList[y-3+CursorChange]))=="recyclebin" then
  413.                     Old="True"
  414.                     DrawMenu({x,y},{3,"Recycle    ","Open       ","Dump       "},
  415.                     {function() direct = tostring(Direct.."/"..FileList[y-3+CursorChange]) FileL(direct);end,
  416.                     function()
  417.                     dlist=fs.list(FileList[y-3+CursorChange])
  418.                     for i=1,#dlist do
  419.                         fs.delete("RecycleBin/"..dlist[i])
  420.                         i=i+1
  421.                     end
  422.                     ;end})
  423.                 end
  424.                 if isDir == true and Old=="False" then
  425.                     Old="True"
  426.                     DrawMenu({x,y},{7,"Folder     ","Open       ","Copy       ","Cut        ","Delete     ","Rename     ","Move       "},
  427.                     {function() direct = tostring(Direct.."/"..FileList[y-3+CursorChange]) FileL(direct);end,
  428.                     function() ClipBoard={Direct.."/"..FileList[y-3+CursorChange],"Copy",FileList[y-3+CursorChange]};end,
  429.                     function() if not fs.isReadOnly(Direct.."/"..FileList[y-3+CursorChange]) then ClipBoard={Direct.."/"..FileList[y-3+CursorChange],"Cut",FileList[y-3+CursorChange]}end;end,
  430.                     function() if string.lower(shell.resolve(Direct))~="recyclebin" and fs.exists("RecycleBin/"..FileList[y-3+CursorChange]) and not fs.isReadOnly(Direct.."/"..FileList[y-3+CursorChange]) then fs.delete("RecycleBin/"..FileList[y-3+CursorChange]) fs.move(Direct.."/"..FileList[y-3+CursorChange],"RecycleBin/"..FileList[y-3+CursorChange]) end if string.lower(shell.resolve(Direct))~="recyclebin" and not fs.exists("RecycleBin/"..FileList[y-3+CursorChange]) and not fs.isReadOnly(Direct.."/"..FileList[y-3+CursorChange]) then fs.move(Direct.."/"..FileList[y-3+CursorChange],"RecycleBin/"..FileList[y-3+CursorChange]) end if string.lower(shell.resolve(Direct))=="recyclebin" and not fs.isReadOnly(Direct.."/"..FileList[y-3+CursorChange]) then fs.delete(Direct.."/"..FileList[y-3+CursorChange]) end ;end,
  431.                     function() if not fs.isReadOnly(Direct.."/"..FileList[y-3+CursorChange]) then rn=message({"Rename Folder"}) if rn~=nil and not fs.exists(rn) then fs.move(Direct.."/"..FileList[y-3+CursorChange],Direct.."/"..rn)end end;end,
  432.                     function() if not fs.isReadOnly(Direct.."/"..FileList[y-3+CursorChange]) then mv=message({"Move Folder"}) if mv~=nil and not fs.exists(mv) then fs.move(Direct.."/"..FileList[y-3+CursorChange],mv)end end;end
  433.                     })
  434.                 end
  435.                 if fs.exists(Direct.."/"..FileList[y-3+CursorChange]) == true and Old=="False" then
  436.                     Old="True"
  437.                     DrawMenu({x,y},{8,"File       ","Run        ","Edit       ","Copy       ","Cut        ","Delete     ","Rename     ","Move       "},
  438.                     {function()
  439.                     if shell.getRunningProgram()~=(Direct.."/"..FileList[y-3+CursorChange]) then
  440.                         DrawMenu({x+11,yarc+1,"calc"},{3,"Run     ","Norm    ","Args    "},{function() ar="" Run() ;end,function() ar=message({"Run With Args"}) if ar~=nil then Run() end;end})
  441.                     end;end,
  442.                     function() shell.run("/rom/programs/edit",Direct.."/"..FileList[y-3+CursorChange]) ;end,
  443.                     function() ClipBoard={Direct.."/"..FileList[y-3+CursorChange],"Copy",FileList[y-3+CursorChange]};end,
  444.                     function() ClipBoard={Direct.."/"..FileList[y-3+CursorChange],"Cut",FileList[y-3+CursorChange]};end,
  445.                     function() if string.lower(shell.resolve(Direct))~="recyclebin" and fs.exists("RecycleBin/"..FileList[y-3+CursorChange]) then fs.delete("RecycleBin/"..FileList[y-3+CursorChange]) fs.move(Direct.."/"..FileList[y-3+CursorChange],"RecycleBin/"..FileList[y-3+CursorChange]) end if string.lower(shell.resolve(Direct))~="recyclebin" and not fs.exists("RecycleBin/"..FileList[y-3+CursorChange]) then fs.move(Direct.."/"..FileList[y-3+CursorChange],"RecycleBin/"..FileList[y-3+CursorChange]) end if string.lower(shell.resolve(Direct))=="recyclebin" then fs.delete("RecycleBin/"..FileList[y-3+CursorChange]) end ;end,
  446.                     function() rn=message({"Rename File"}) if rn~=nil and not fs.exists(rn) then fs.move(Direct.."/"..FileList[y-3+CursorChange],Direct.."/"..rn)end;end,
  447.                     function() mv=message({"Move File"}) if mv~=nil and not fs.exists(mv) then fs.move(Direct.."/"..FileList[y-3+CursorChange],mv)end;end
  448.                     })
  449.                 end
  450.                 OldClick = "True"
  451.             end
  452.         end
  453.         if OldClick ~= "True" then
  454.             if x < FileLen+4 and x > 3 and y > 3 and y < num+3 and button == 1 and OldClick ~= "True" then
  455.                 dire = tostring(FileList[y-3+CursorChange])
  456.                 isDir = fs.isDir(Direct.."/"..dire)
  457.                 if isDir == true then
  458.                     direct = tostring(Direct.."/"..FileList[y-3+CursorChange])
  459.                     FileL(direct)
  460.                 end
  461.                 if isDir == false and broke ~= "true" then
  462.                     Run()
  463.                 end
  464.                 OldClick = "True"
  465.             end
  466.         end
  467.         if (x == 1 or x == 2 or x == 3) and y == 3 and button == 1 and OldClick ~= "True" then
  468.             direr = recents[2]
  469.             if recents[2] == nil then
  470.                 direr = ""
  471.             end
  472.             table.remove(recents, 1)
  473.             table.remove(recents, 1)
  474.             FileL(direr)
  475.             OldClick = "True"
  476.         end
  477.         if y == 2 and button == 1 and OldClick ~= "True" then
  478.             term.setCursorPos(1,2)
  479.             term.setBackgroundColor(ButtonBack)
  480.             term.clearLine()
  481.             write("/")
  482.             jumpto = read()
  483.             f = fs.isDir(jumpto)
  484.             jumpto = "/"..jumpto
  485.             jumpto=string.lower(jumpto)
  486.             if f == true then
  487.                 FileL(jumpto)
  488.             end
  489.             OldClick = "True"
  490.         elseif y>3 and button == 2 and OldClick ~= "True" then
  491.             nf=""
  492.             DrawMenu({x,y},
  493.             {4,"Options    ","New        ","CPULabel   ","Paste      "},
  494.             {function() DrawMenu({x+11,yarc+1,"calc"},{3,"New     ","File    ","Folder  "},{function() nf=message({"New File"}) if nf~=nil and not fs.exists("nf") then f=fs.open(Direct.."/"..nf,"w") f.write("") f.close() end ;end,function() nf=message({"New Folder"}) if nf~=nil and not fs.exists("nf") then fs.makeDir(Direct.."/"..nf) end;end});end,function() label=message({"Label Computer"}) if label~=nil then os.setComputerLabel(label) end;end,function() if ClipBoard[1]~=nil and ClipBoard[2]~=nil and ClipBoard[3]~=nil then if not fs.exists(Direct.."/"..ClipBoard[3]) and fs.exists(ClipBoard[1]) then if ClipBoard[2]=="Copy" then fs.copy(ClipBoard[1], Direct.."/"..ClipBoard[3]) end if ClipBoard[2]=="Cut" then fs.move(ClipBoard[1], Direct.."/"..ClipBoard[3]) end end end;end})
  495.         end
  496.     end
  497.     if event=="mouse_scroll" then
  498.         broke = "false"
  499.         if button==-1 then --Up
  500.             if CursorChange~=0 then
  501.                 CursorChange=CursorChange-1
  502.             end
  503.         end
  504.         if button==1 then --Down
  505.             if CursorChange ~= nume-2 then
  506.                 CursorChange=CursorChange+1
  507.             end
  508.         end
  509.     end
  510.     if event=="mouse_drag" then
  511.         if y>4 and y<18 and x==51 then
  512.             CursorChange=round(((y-4)/15)*nume, 0)
  513.             OldClick="True"
  514.         end
  515.     end
  516. end
  517.  
  518.  
  519. if not fs.exists("RecycleBin") then
  520.     fs.makeDir("RecycleBin")
  521. end
  522. ForceU=false
  523. tArgs = (...)
  524.  
  525. shell.run("SB-Config")
  526. if tArgs=="-u" then
  527.     AutoCheck=true
  528. end
  529. if tArgs=="-f" then
  530.     ForceU=true
  531. end
  532. Updater()
  533. if action ~="Yes" then
  534.     ColorCheck()
  535.     ClipBoard={"","",""}
  536.     term.clear()
  537.     direct = ""
  538.     recents = {""}
  539.     FileL("")
  540. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement