Advertisement
minimite

formati

May 3rd, 2015
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.setBackgroundColor(colors.black)
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. print("Are you sure? [Y/N] ")
  5.  
  6. local event, key = os.pullEvent("key")
  7. if key == keys.y then
  8.     os.unloadAPI(_G)
  9.     for i, v in ipairs(fs.list('/')) do
  10.                 if v ~= "rom" then
  11.             fs.delete('/'..v)
  12.             print("/"..v.." was deleted.")
  13.                 end
  14.     end
  15.     os.reboot()
  16. elseif key == keys.n then
  17.     print("Format cancelled.")
  18.     return
  19. else
  20.     print("Invalid key")
  21.     print("Format cancelled.")
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement