Ok... so... pastebin isn't working and the server admin wont be on for a while so... looks like I get to type all this out! well... here it goes!
This is the startup file. Make sure you have a monitor attached to the top. It's made for a 4 long by 2 tall monitor. You can change this in the code. NOTE: In order for this to work you MUST have a memcheck file on a disk and placed in a drive attached to the system before running (memcheck needs to have the number 640 in the first line). Also, there must be a lock file (you can use any password protection lock you want as long as the file is named "lock") and a btsm file with the first line of text saying "--BTSM Header". Let me know what you think! And if you'd like the other files to get the full effect just tell me and I will get to work on re-writing the code.
mon = peripheral.wrap("top")
momc = "disk/memcheck"
memcf = fs.exists(memc) and io.open(memc, "r") or nil
btsmc = "btsm"
btsmcf = fs.exists(btsmc) and io.open(btsmc, "r") or nil
--THANK YOU to JokerRH for this next part!
function set(ind)
if type(term[ind]) ~= "function" then return end
term[ind] = setmetatable({term = term[ind], monitor = mon[ind]}, {
__call = function(self, ...)
self.term(...)
self.monitor(...)
end
})
end
set("write")
set("setCursorPos")
set("print")
set("setCursorBlink")
set("clear")
set("clearLine")
set("scroll")
term.setCursorPos(term.getCursorPos())
term.clear()
term.setCursorPos(1,1)
os.pullEvent = os.pullEventRaw
print"|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^|"
print"| BouTech Corporation |"
print"|-------------------------------------|"
print""
print"BTC OS version 1.2"
sleep(2)
term.setCursorPos(1,6)
print "Memory Check"
sleep(1)
term.setCursorPos(13,6)
print"."
sleep(1)
term.setCursorPos(14,6)
sleep(1)
print"."
term.setCursorPos(15,6)
print"."
sleep(1)
if (memcf and memcf:read()=="640") then
term.setCursorPos(17,6)
print"640Kb OK!"
sleep(2)
if (btsmcf and btsmcf:read()=="--BTSM Header") then
term.setCursorPos(1,8)
print"::WARNING::"
sleep(1)
print"Authorized access only!"
sleep(1)
print"CyberPunk Security now loading..."
sleep(3)
cpsc = fs.exists("lock")
if cpsc == true then
shell.run("lock")
else
term.setCursorPos(1,11)
print"System corrupt! Running system restore..."
sleep(3)
file = fs.exists("disk/restore/sysrest")
if file == true then
shell.run("disk/restore/sysrest")
else
print"System restore file not found on disk."
print"System rebooting..."
sleep(3)
os.reboot()
end
end
else
term.setCursorPos(1,8)
print"System corrupt! Running system restore..."
sleep(3)
file = fs.exists("disk/restore/sysrest")
if file == true then
shell.run("disk/restore/sysrest")
else
print"System restore file not found on disk."
print"System rebooting..."
sleep(3)
os.reboot()
end
end
else
term.setCursorPos(17,6)
print"Memory Test Failed!"
sleep(2)
os.reboot()
end
WARNING - Just in case it was missed... you CAN NOT terminate this once it has begun! If you want to re-add the terminate function just remove line 26 of the code.
::EDIT::
I know the spacing for the BouTech Corp. sign looks off but it should be correct... for some reason adding code on the forums altered the spacing...