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

AntiEdit Program

Started by DarkEspeon, 11 May 2013 - 12:12 PM
DarkEspeon #1
Posted 11 May 2013 - 02:12 PM
Hey guys, Nicse4 here and I made a little program in CC1.5 while working on a secret project that I will be releasing shortly, but what it is is a program that can stop you from editing a program, but still has the same syntax as before so it is edit <path>. This will stop you from editing startup as is, but you can add any program to the list you want to protect, so you could protect say a file with passwords from just being edited and have all the accounts on your computer hacked, or if you don't want your friend to break all your code by messing around on your computer. No pictures to show because It is super simple, nothing really necesary to see, just wanted to post this here for anyone who wants this, or just doesn't know how to make one. So here is the code guys, and thanks for reading!

Can and will put this on pastebin if you guys request it.

Spoiler
local args = {...}
if(args[1] == "startup") then
term.clear()
term.setCursorPos(1, 1)
term.write("You are not allowed to edit the startup file on")
x, y = term.getCursorPos()
term.setCursorPos(1, y+1)
term.write("this computer. Thank you")
term.setCursorPos(1, y+2)
else
shell.run("edit", args[1])
end
tom2018 #2
Posted 11 May 2013 - 02:18 PM
rom/programs/edit startup
Problem solved, and most people would type ls first and see it; but it is a good attempt.
Shnupbups #3
Posted 11 May 2013 - 11:36 PM
This could be useful for a custom BIOS in which this is replacing edit, however I frankly can't be bothered to mess around with the BIOS each time I update CC because I'm lazy.