323 posts
Location
Boston, MA
Posted 08 September 2013 - 12:51 AM
So, I am developing an OS with WolfNinja2, and I was wondering how FireWolf's crash screen worked, where it was put into a nice setup.
Could anyone help, just kinda list the basic functions needed?
I would like to make a Windows 8 Style blue screen. The big ":(/>" :D/>
Thanks in advance.
-deadmau5
331 posts
Posted 08 September 2013 - 01:43 AM
it uses pcall (protected call) and then displays it in a custom error format eg.
suc,err = pcall(print(var)) if not suc then print(err) end
that will show the error attempt to call number
323 posts
Location
Boston, MA
Posted 08 September 2013 - 01:53 AM
it uses pcall (protected call) and then displays it in a custom error format eg.
suc,err = pcall(print(var)) if not suc then print(err) end
that will show the error attempt to call number
And how do I implement this into a program? When do I use it?
331 posts
Posted 08 September 2013 - 02:09 AM
say in firewolf you acsess a site it sends you the code you do
suc, err = pcall(code)
if not suc then
print(err) -- or do stuff with the information
end
7508 posts
Location
Australia
Posted 08 September 2013 - 05:35 AM
Have a read of
my tutorial.
it should also be noted on top of jay5476's code that you should do the following
local ok, err = pcall(shell.run, "someProgram")
if not ok and err ~= "Terminated" then
print(err)
end
That way you're handling errors of a program, and also making sure you don't show the error screen if they terminated the program.