Well..right now im totally lost…. well..
my tArgs inside the function is now outside. ( at the top )
should i then make a new
local tArgs = {...}
local oldFsLock = fs.open
fs.isLocked = function(...) -- now i dont know what i should do...
my code right now is:
Spoiler
local tArgs = {...}
function Lock()
oldFsOpen = fs.open
fs.open = function(...)
local lockFiles = {
"startup",
"/startup",
"/.@main@./config.cfg",
".@main@./config.cfg",
"/.@main@./passwordSys",
".@main@./passwordSys",
".@main@./version.ver",
"/.@main@./version.ver",
".@main@./Uninstall",
"/.@main@./Uninstall",
".@main@./update",
"/.@main@./update",
".@main@./animations/LockTF",
"/.@main@./animations/LockTF",
".@main@./animations/Uninstall",
"/.@main@./animations/Uninstall",
".@main@./animations/download",
"/.@main@./animations/download",
"/.@main@.",
".@main@."
}
if tArgs[1] == lockFiles[1] or tArgs[1] == lockFiles[2] or tArgs[1] == lockFiles[3] or tArgs[1] == lockFiles[4] or tArgs[1] == lockFiles[5] or tArgs[1] == lockFiles[6] or tArgs[1] == lockFiles[7] or tArgs[1] == lockFiles[8] or tArgs[1] == lockFiles[9] or tArgs[1] == lockFiles[10] or tArgs[1] == lockFiles[11] or tArgs[1] == lockFiles[12] or tArgs[1] == lockFiles[13] or tArgs[1] == lockFiles[14] or tArgs[1] == lockFiles[15] or tArgs[1] == lockFiles[16] or tArgs[1] == lockFiles[17] or tArgs[1] == lockFiles[18] or tArgs[1] == lockFiles[19] or tArgs[1] == lockFiles[20] or tArgs[1] == lockFiles[21] or tArgs[1] == lockFiles[22] or tArgs[1] == lockFiles[23] or tArgs[1] == lockFiles[24] or tArgs[1] == lockFiles[25] or tArgs[1] == lockFiles[26] or tArgs[1] == lockFiles[27] then
error("Access denied!\[er.num:1:\]", 3)
else
return oldFsOpen(unpack(tArgs))
end
end
oldDelete = fs.delete
fs.delete = function(...)
local lockFiles = {
"startup",
"/startup",
"/.@main@./config.cfg",
".@main@./config.cfg",
"/.@main@./passwordSys",
".@main@./passwordSys",
".@main@./version.ver",
"/.@main@./version.ver",
".@main@./Uninstall",
"/.@main@./Uninstall",
"pass",
"/pass",
"update",
"/update",
".@main@./update",
"/.@main@./update",
".@main@./animations/LockTF",
"/.@main@./animations/LockTF",
".@main@./animations/Uninstall",
"/.@main@./animations/Uninstall",
".@main@./animations/download",
"/.@main@./animations/download",
"/.@main@.",
".@main@."
}
if tArgs[1] == lockFiles[1] or tArgs[1] == lockFiles[2] or tArgs[1] == lockFiles[3] or tArgs[1] == lockFiles[4] or tArgs[1] == lockFiles[5] or tArgs[1] == lockFiles[6] or tArgs[1] == lockFiles[7] or tArgs[1] == lockFiles[8] or tArgs[1] == lockFiles[9] or tArgs[1] == lockFiles[10] or tArgs[1] == lockFiles[11] or tArgs[1] == lockFiles[12] or tArgs[1] == lockFiles[13] or tArgs[1] == lockFiles[14] or tArgs[1] == lockFiles[15] or tArgs[1] == lockFiles[16] or tArgs[1] == lockFiles[17] or tArgs[1] == lockFiles[18] or tArgs[1] == lockFiles[19] or tArgs[1] == lockFiles[20] or tArgs[1] == lockFiles[21] or tArgs[1] == lockFiles[22] or tArgs[1] == lockFiles[23] or tArgs[1] == lockFiles[24] or tArgs[1] == lockFiles[25] or tArgs[1] == lockFiles[26] or tArgs[1] == lockFiles[27] then
error("Access denied!\[er.num:2:\]", 2)
term.clear()
else
return oldDelete(unpack(tArgs))
end
end
end
function unLock()
oldFsOpen = fs.open
fs.open = function(...)
local lockFiles = {
"startup",
"/startup",
"/.@main@./config.cfg",
".@main@./config.cfg",
"/.@main@./passwordSys",
".@main@./passwordSys",
".@main@./version.ver",
"/.@main@./version.ver",
".@main@./Uninstall",
"/.@main@./Uninstall",
".@main@./update",
"/.@main@./update",
".@main@./animations/LockTF",
"/.@main@./animations/LockTF",
".@main@./animations/Uninstall",
"/.@main@./animations/Uninstall",
".@main@./animations/download",
"/.@main@./animations/download",
"/.@main@.",
".@main@."
}
if tArgs[1] == lockFiles[1] or tArgs[1] == lockFiles[2] or tArgs[1] == lockFiles[3] or tArgs[1] == lockFiles[4] or tArgs[1] == lockFiles[5] or tArgs[1] == lockFiles[6] or tArgs[1] == lockFiles[7] or tArgs[1] == lockFiles[8] or tArgs[1] == lockFiles[9] or tArgs[1] == lockFiles[10] or tArgs[1] == lockFiles[11] or tArgs[1] == lockFiles[12] or tArgs[1] == lockFiles[13] or tArgs[1] == lockFiles[14] or tArgs[1] == lockFiles[15] or tArgs[1] == lockFiles[16] or tArgs[1] == lockFiles[17] or tArgs[1] == lockFiles[18] or tArgs[1] == lockFiles[19] or tArgs[1] == lockFiles[20] or tArgs[1] == lockFiles[21] or tArgs[1] == lockFiles[22] or tArgs[1] == lockFiles[23] or tArgs[1] == lockFiles[24] or tArgs[1] == lockFiles[25] or tArgs[1] == lockFiles[26] or tArgs[1] == lockFiles[27] then
return oldFsOpen(unpack(tArgs))
else
return oldFsOpen(unpack(tArgs))
end
end
oldDelete = fs.delete
fs.delete = function(...)
local lockFiles = {
"startup",
"/startup",
"/.@main@./config.cfg",
".@main@./config.cfg",
"/.@main@./passwordSys",
".@main@./passwordSys",
".@main@./version.ver",
"/.@main@./version.ver",
".@main@./Uninstall",
"/.@main@./Uninstall",
"pass",
"/pass",
"update",
"/update",
".@main@./update",
"/.@main@./update",
".@main@./animations/LockTF",
"/.@main@./animations/LockTF",
".@main@./animations/Uninstall",
"/.@main@./animations/Uninstall",
".@main@./animations/download",
"/.@main@./animations/download",
"/.@main@.",
".@main@."
}
if tArgs[1] == lockFiles[1] or tArgs[1] == lockFiles[2] or tArgs[1] == lockFiles[3] or tArgs[1] == lockFiles[4] or tArgs[1] == lockFiles[5] or tArgs[1] == lockFiles[6] or tArgs[1] == lockFiles[7] or tArgs[1] == lockFiles[8] or tArgs[1] == lockFiles[9] or tArgs[1] == lockFiles[10] or tArgs[1] == lockFiles[11] or tArgs[1] == lockFiles[12] or tArgs[1] == lockFiles[13] or tArgs[1] == lockFiles[14] or tArgs[1] == lockFiles[15] or tArgs[1] == lockFiles[16] or tArgs[1] == lockFiles[17] or tArgs[1] == lockFiles[18] or tArgs[1] == lockFiles[19] or tArgs[1] == lockFiles[20] or tArgs[1] == lockFiles[21] or tArgs[1] == lockFiles[22] or tArgs[1] == lockFiles[23] or tArgs[1] == lockFiles[24] or tArgs[1] == lockFiles[25] or tArgs[1] == lockFiles[26] or tArgs[1] == lockFiles[27] then
return oldDelete(unpack(tArgs))
else
return oldDelete(unpack(tArgs))
end
end
end
tArgsI = {...}
if tArgsI == nil then
error("i need 1 parametre")
else
if tArgsI[1] == "true" then
Lock()
elseif tArgsI[1] == "false" then
unLock()
end
end
edit: i edited the same code, but now it works fine…
i type in.
>.@main@./Lock.op true
> edit startup
Bios:358: Acces denied![er.num1]
> .@main@./Lock.op false
> edit startup – now when i run this… the screen turns off, ( i could not see any errors, because it was turning off to quick, after showing error.. (IF it was an error))
Spoiler
local tArgs = {}
function Lock()
oldFsOpen = fs.open
fs.open = function(...)
tArgs = {...}
local lockFiles = {
"startup",
"/startup",
"/.@main@./config.cfg",
".@main@./config.cfg",
"/.@main@./passwordSys",
".@main@./passwordSys",
".@main@./version.ver",
"/.@main@./version.ver",
".@main@./Uninstall",
"/.@main@./Uninstall",
".@main@./update",
"/.@main@./update",
".@main@./animations/LockTF",
"/.@main@./animations/LockTF",
".@main@./animations/Uninstall",
"/.@main@./animations/Uninstall",
".@main@./animations/download",
"/.@main@./animations/download",
"/.@main@.",
".@main@."
}
if tArgs[1] == lockFiles[1] or tArgs[1] == lockFiles[2] or tArgs[1] == lockFiles[3] or tArgs[1] == lockFiles[4] or tArgs[1] == lockFiles[5] or tArgs[1] == lockFiles[6] or tArgs[1] == lockFiles[7] or tArgs[1] == lockFiles[8] or tArgs[1] == lockFiles[9] or tArgs[1] == lockFiles[10] or tArgs[1] == lockFiles[11] or tArgs[1] == lockFiles[12] or tArgs[1] == lockFiles[13] or tArgs[1] == lockFiles[14] or tArgs[1] == lockFiles[15] or tArgs[1] == lockFiles[16] or tArgs[1] == lockFiles[17] or tArgs[1] == lockFiles[18] or tArgs[1] == lockFiles[19] or tArgs[1] == lockFiles[20] or tArgs[1] == lockFiles[21] or tArgs[1] == lockFiles[22] or tArgs[1] == lockFiles[23] or tArgs[1] == lockFiles[24] or tArgs[1] == lockFiles[25] or tArgs[1] == lockFiles[26] or tArgs[1] == lockFiles[27] then
error("Access denied!\[er.num:1:\]", 3)
else
return oldFsOpen(unpack(tArgs))
end
end
oldDelete = fs.delete
fs.delete = function(...)
tArgs = {...}
local lockFiles = {
"startup",
"/startup",
"/.@main@./config.cfg",
".@main@./config.cfg",
"/.@main@./passwordSys",
".@main@./passwordSys",
".@main@./version.ver",
"/.@main@./version.ver",
".@main@./Uninstall",
"/.@main@./Uninstall",
"pass",
"/pass",
"update",
"/update",
".@main@./update",
"/.@main@./update",
".@main@./animations/LockTF",
"/.@main@./animations/LockTF",
".@main@./animations/Uninstall",
"/.@main@./animations/Uninstall",
".@main@./animations/download",
"/.@main@./animations/download",
"/.@main@.",
".@main@."
}
if tArgs[1] == lockFiles[1] or tArgs[1] == lockFiles[2] or tArgs[1] == lockFiles[3] or tArgs[1] == lockFiles[4] or tArgs[1] == lockFiles[5] or tArgs[1] == lockFiles[6] or tArgs[1] == lockFiles[7] or tArgs[1] == lockFiles[8] or tArgs[1] == lockFiles[9] or tArgs[1] == lockFiles[10] or tArgs[1] == lockFiles[11] or tArgs[1] == lockFiles[12] or tArgs[1] == lockFiles[13] or tArgs[1] == lockFiles[14] or tArgs[1] == lockFiles[15] or tArgs[1] == lockFiles[16] or tArgs[1] == lockFiles[17] or tArgs[1] == lockFiles[18] or tArgs[1] == lockFiles[19] or tArgs[1] == lockFiles[20] or tArgs[1] == lockFiles[21] or tArgs[1] == lockFiles[22] or tArgs[1] == lockFiles[23] or tArgs[1] == lockFiles[24] or tArgs[1] == lockFiles[25] or tArgs[1] == lockFiles[26] or tArgs[1] == lockFiles[27] then
error("Access denied!\[er.num:2:\]", 2)
term.clear()
else
return oldDelete(unpack(tArgs))
end
end
end
function unLock()
oldFsOpen = fs.open
fs.open = function(...)
tArgs = {...}
local lockFiles = {
"startup",
"/startup",
"/.@main@./config.cfg",
".@main@./config.cfg",
"/.@main@./passwordSys",
".@main@./passwordSys",
".@main@./version.ver",
"/.@main@./version.ver",
".@main@./Uninstall",
"/.@main@./Uninstall",
".@main@./update",
"/.@main@./update",
".@main@./animations/LockTF",
"/.@main@./animations/LockTF",
".@main@./animations/Uninstall",
"/.@main@./animations/Uninstall",
".@main@./animations/download",
"/.@main@./animations/download",
"/.@main@.",
".@main@."
}
if tArgs[1] == lockFiles[1] or tArgs[1] == lockFiles[2] or tArgs[1] == lockFiles[3] or tArgs[1] == lockFiles[4] or tArgs[1] == lockFiles[5] or tArgs[1] == lockFiles[6] or tArgs[1] == lockFiles[7] or tArgs[1] == lockFiles[8] or tArgs[1] == lockFiles[9] or tArgs[1] == lockFiles[10] or tArgs[1] == lockFiles[11] or tArgs[1] == lockFiles[12] or tArgs[1] == lockFiles[13] or tArgs[1] == lockFiles[14] or tArgs[1] == lockFiles[15] or tArgs[1] == lockFiles[16] or tArgs[1] == lockFiles[17] or tArgs[1] == lockFiles[18] or tArgs[1] == lockFiles[19] or tArgs[1] == lockFiles[20] or tArgs[1] == lockFiles[21] or tArgs[1] == lockFiles[22] or tArgs[1] == lockFiles[23] or tArgs[1] == lockFiles[24] or tArgs[1] == lockFiles[25] or tArgs[1] == lockFiles[26] or tArgs[1] == lockFiles[27] then
return oldFsOpen(unpack(tArgs))
else
return oldFsOpen(unpack(tArgs))
end
end
oldDelete = fs.delete
fs.delete = function(...)
tArgs = {...}
local lockFiles = {
"startup",
"/startup",
"/.@main@./config.cfg",
".@main@./config.cfg",
"/.@main@./passwordSys",
".@main@./passwordSys",
".@main@./version.ver",
"/.@main@./version.ver",
".@main@./Uninstall",
"/.@main@./Uninstall",
"pass",
"/pass",
"update",
"/update",
".@main@./update",
"/.@main@./update",
".@main@./animations/LockTF",
"/.@main@./animations/LockTF",
".@main@./animations/Uninstall",
"/.@main@./animations/Uninstall",
".@main@./animations/download",
"/.@main@./animations/download",
"/.@main@.",
".@main@."
}
if tArgs[1] == lockFiles[1] or tArgs[1] == lockFiles[2] or tArgs[1] == lockFiles[3] or tArgs[1] == lockFiles[4] or tArgs[1] == lockFiles[5] or tArgs[1] == lockFiles[6] or tArgs[1] == lockFiles[7] or tArgs[1] == lockFiles[8] or tArgs[1] == lockFiles[9] or tArgs[1] == lockFiles[10] or tArgs[1] == lockFiles[11] or tArgs[1] == lockFiles[12] or tArgs[1] == lockFiles[13] or tArgs[1] == lockFiles[14] or tArgs[1] == lockFiles[15] or tArgs[1] == lockFiles[16] or tArgs[1] == lockFiles[17] or tArgs[1] == lockFiles[18] or tArgs[1] == lockFiles[19] or tArgs[1] == lockFiles[20] or tArgs[1] == lockFiles[21] or tArgs[1] == lockFiles[22] or tArgs[1] == lockFiles[23] or tArgs[1] == lockFiles[24] or tArgs[1] == lockFiles[25] or tArgs[1] == lockFiles[26] or tArgs[1] == lockFiles[27] then
return oldDelete(unpack(tArgs))
else
return oldDelete(unpack(tArgs))
end
end
end
tArgsI = {...}
if tArgsI == nil then
error("i need 1 parametre")
else
if tArgsI[1] == "true" then
Lock()
elseif tArgsI[1] == "false" then
unLock()
end
end
i know you should not make the code for me, but can you give a little example on the fs.isLocked? i dont know where to start..
Thanks :)/>