Advertisement
NekoTiki

Untitled

Oct 1st, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fs.mkDir("start")
  2. if fs.exists('start/config') == false then
  3. --reset affichage
  4. term.clear()
  5. term.setCursorPos(1, 1)
  6. --Input
  7. print("Entrez le nom du programme a lancer au demarrage :")
  8. prog = read()
  9. --Write
  10. local file = fs.open("start/config", "w")
  11. file.writeLine(prog)
  12. file.close()
  13. os.reboot()
  14. else
  15. --Lecture fichier
  16. local file = fs.open("start/config","r")
  17. ProgramName = file.readLine()
  18. file.close()
  19. end
  20.  
  21. crashcount = 0
  22.  
  23. function crash()
  24. term.setTextColor(colors.yellow)
  25. write("Le programme a crash: ")
  26. term.setTextColor(colors.red)
  27. write(crashcount)
  28. term.setTextColor(colors.yellow)
  29. print(" fois.")
  30. end
  31.  
  32. while true do
  33. term.clear()
  34. term.setCursorPos(1,1)
  35. crash()
  36. term.setTextColor(colors.green)
  37. print("Lancement du Programme ...")
  38. shell.run(ProgramName)
  39. crashcount = crashcount + 1
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement