Guest User

startup

a guest
Dec 31st, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. local sPath = ".:/bin/programs"
  2. if turtle then
  3.     sPath = sPath..":/bin/programs/turtle"
  4. else
  5.     sPath = sPath..":/bin/programs/computer"
  6. end
  7. if http then
  8.     sPath = sPath..":/bin/programs/http"
  9. end
  10. if term.isColor() then
  11.     sPath = sPath..":/bin/programs/color"
  12. end
  13.  
  14. shell.setPath( sPath )
  15. help.setPath( "/bin/help" )
  16.  
  17. shell.setAlias( "ls", "list" )
  18. shell.setAlias( "dir", "list" )
  19. shell.setAlias( "cp", "copy" )
  20. shell.setAlias( "mv", "move" )
  21. shell.setAlias( "rm", "delete" )
  22.  
  23. if fs.exists( "/bin/autorun" ) and fs.isDir( "/bin/autorun" ) then
  24.     local tFiles = fs.list( "/bin/autorun" )
  25.     table.sort( tFiles )
  26.     for n, sFile in ipairs( tFiles ) do
  27.         if string.sub( sFile, 1, 1 ) ~= "." then
  28.             local sPath = "/bin/autorun/"..sFile
  29.             if not fs.isDir( sPath ) then
  30.                 shell.run( sPath )
  31.             end
  32.         end
  33.     end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment