Advertisement
joshgreatuk

LUAOS filebrowser 0.1 indev

Jun 22nd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. term.clear()
  2. function fb()
  3.   print("directory:",dir)
  4.   print("type a command")
  5.   cmd = read()
  6.   if cmd == "cd" then
  7.     print("enter a directory to go to")
  8.     ed = read()
  9.     if not fs.exists(ed) then
  10.       print("directory not found")
  11.       fb()
  12.     end
  13.   dir = ed
  14.   fb()
  15.   else if cmd == "ls" then
  16.     ls = fs.list(dir)
  17.     print(ls)
  18.     fb()
  19.   else if cmd == "exit" then
  20.     os.reboot()
  21.   end
  22.   end
  23.   end
  24. end
  25. dir = "LUAOS/C/"
  26. fb()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement