ChaddJackson12

CC Computer Wiper

Dec 26th, 2012
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. --[[Functions ]]--
  2. -- Layout --
  3. function clear()
  4.     term.clear()
  5.     term.setCursorPos(1, 1)
  6. end
  7.  
  8. function Reset()
  9.     clear()
  10.     term.setTextColor(colors.red)
  11.     write("Computer Wiper")
  12.     term.setTextColor(colors.yellow)
  13.     term.setTextColor(colors.white)
  14.     w, h = term.getSize()
  15.     print(string.rep("-", w)) write("\n")
  16. end
  17.  
  18. --[[ Interface ]]--
  19. Reset()
  20. write("Wiping Computer")
  21. Progs = fs.list("/")
  22. for k, v in pairs(Progs) do
  23.     if v == "rom" or v == "disk" then
  24.  
  25.     else
  26.         term.setTextColor(colors.red)
  27.         write("\nDeleting File: ") term.setTextColor(colors.white) write(v)
  28.         fs.delete(v)
  29.         os.sleep(1)
  30.     end
  31. end
  32. term.setTextColor(colors.lime)
  33. print("\nComputer Has Been Wiped!")
  34. term.setTextColor(colors.yellow)
  35. print("\n(-)OK")
  36. term.setTextColor(colors.white)
  37. repeat
  38.     event, key = os.pullEvent("key")
  39.     os.sleep(0.1)
  40. until key == 28
  41. os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment