Guest User

format

a guest
May 2nd, 2015
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  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.         fs.delete('/'..v)
  11.         print("/"..v.." was deleted.")
  12.     end
  13.     os.reboot()
  14. elseif key == keys.n then
  15.     print("Format cancelled.")
  16.     return
  17. else
  18.     print("Invalid key")
  19.     print("Format cancelled.")
  20. end
Advertisement
Add Comment
Please, Sign In to add comment