While messing around with the idea of a linux-like OS and seeing stuff like the awesome FakeOS…
I saw THAT, made by NeverCast. The thing is, he's offline since 2014 and the code is kinda broken in the new versions of ComputerCraft.
While thinking it was an amazing idea and that it should still work I started rewriting the script by hand (just to understand the code, idk why that works with me) and trying various things out.
I even let the code print it's status step-by-step just to see where the hell it crashed and I even had to look at the shell and bios.lua file. (Yeah it's not that hard and this sounds fucking stupid but leave me alone :(/> )
Then I noticed this:
- The bios does not wait for an input when the shell exits
- The bios doesn't start a timer when the shell exits
- It simply shuts the OS down
- The code sets awkward stages that do not longer matter BECAUSE the bios doesn't wait for anything (anymore… idk if it did that in 2013/14)
- The way NeverCast searched for 'shell' didn't work (anymore)
Redirected every 'fake' new Event directly to the stage "biosexit"Reworked the way we search for 'shell' with getfenv()Added in a 'tutorial' how to add your own program to the "queue"- UPDATE: The code doesn't search for shell anymore, in fact it only queues "terminate" as event and rewrites printError before that (idea by apemanzilla) (I could've queued "rednet_message",0 too, buuuuut it doesn't matter)
Information for people who didn't know about NeverCast's script:
- This program "injects" your program(s) way before CraftOS gets loaded, that means that your program(s) will run at the same level (the complete top) , having access to all coroutines. (for example you could get rid of CraftOS and let your own OS boot, not leaving the user the ability to get to CraftOS (could be useful for linux-like OSes) or you could make your own rednet implementation)
- For example: You could run an antivirus/AppUpdater to scan/update your applications, while using something else… e.g. an OS or play a game or code something… EDIT: For those who like having them running without leaving programs the ability to somehow crash it. (Idk if thats true, sry if I'm wrong)
- My idea would be for example checking for updates in an OS in the background and notifying the user when an update is available
pastebin get yzfDMjwf injectmystuff
NeverCast's code:
pastebin get 2SQAzrWi startup
[attachment=2660:Capture.PNG]