Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fs.mkDir("start")
- if fs.exists('start/config') == false then
- --reset affichage
- term.clear()
- term.setCursorPos(1, 1)
- --Input
- print("Entrez le nom du programme a lancer au demarrage :")
- prog = read()
- --Write
- local file = fs.open("start/config", "w")
- file.writeLine(prog)
- file.close()
- os.reboot()
- else
- --Lecture fichier
- local file = fs.open("start/config","r")
- ProgramName = file.readLine()
- file.close()
- end
- crashcount = 0
- function crash()
- term.setTextColor(colors.yellow)
- write("Le programme a crash: ")
- term.setTextColor(colors.red)
- write(crashcount)
- term.setTextColor(colors.yellow)
- print(" fois.")
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- crash()
- term.setTextColor(colors.green)
- print("Lancement du Programme ...")
- shell.run(ProgramName)
- crashcount = crashcount + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement