--Copyright Simlor (http://www.computercraft.info/forums2/index.php?/user/55655-simlor/) -  Alle Rechte an diesen Programm sind Simlor vorbehalten.


os.pullEvent = os.pullEventRaw


if peripheral.getType("front") == "monitor" then
 bildausgabeSystem = "front"
 
elseif peripheral.getType("left") == "monitor" then
 bildausgabeSystem = "left"
 
elseif peripheral.getType("right") == "monitor" then
 bildausgabeSystem = "right"
 
elseif peripheral.getType("top") == "monitor" then
 bildausgabeSystem = "top"
 
elseif peripheral.getType("bottom") == "monitor" then
 bildausgabeSystem = "bottom"
 
elseif peripheral.getType("back") == "monitor" then
 bildausgabeSystem = "back"
 
else
 bildausgabeSystem = "normal"
 
end
 
if bildausgabeSystem == "normal" then
else
 term.setTextColor(1)
 term.setBackgroundColor(32768)
 term.clear()
 term.setCursorPos(1,1)
 print("Boot SimSoft on monitor ("..bildausgabeSystem..")?")
 print(" yes [y] - no [n]")
 print("")
 
 write("y/n > ")
 st = read()
 
 if st == "y" or st == "yes" then
 elseif st == "n" or st == "no" then
  bildausgabeSystem = "normal"
 else
  os.reboot()
 end
end

if bildausgabeSystem == "normal" then
 shell.run("SimSoft/System/SystemStart")
else
 shell.run("monitor "..bildausgabeSystem.." SimSoft/System/SystemStart")
end

--SystemBruch

term.setBackgroundColor(256)
term.setTextColor(1)
term.setCursorBlink(false)
term.clear()
term.setCursorPos(1,1)

--Nachricht
print("SimSoft has crashed!")
print("")
print("Wait for reboot...")
sleep(2)

os.reboot()

--end