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

[QUESTION] How Do I Disable Edit?

Started by danners68, 08 September 2012 - 10:08 AM
danners68 #1
Posted 08 September 2012 - 12:08 PM
so this has been asked before, but the answers dont seem to apply to what i want/can do…


i'm a complete novice at coding and have a basic door pass code i will post this code later for review and what have you as its my first door lock code….

the problem i face is people can easily edit a new program and use it to bypass my door open command,

the fix ive seen before wanted to remove the edit process from the mod entirly…..i just want to remove it from my single isolated machine,
my setup runs startup and 2 other programs, startup is a single simple line: print("What Would You like to Do")
it has my Open command which includes passcode for entry(ill post later, as im pressed for time right now) and a close command, a simple confirmation, warning that the door is closing, and a closed door, if possible id like to be able to tell this command to shut down but thats not a priority(i use shell.run(shutdown) but it asks for an "argument" which i dont understand being novice)

i want to limit this machine to these 3 programs only, i believe i have disabled CTRL+T on them all, and have tried to delete edit + lua from the cpu interface, but the programs remain,


any and all help will be appreciated,

Danners 68

-PS: just to clarify, this is on a server I don't own
danners68 #2
Posted 08 September 2012 - 12:10 PM
also this is on Craft os1.3
danners68 #3
Posted 08 September 2012 - 02:07 PM
MASSIVE EDIT!!! my fix was relatively simple:

using edit edit just save a simple message counteracts the edit program,

ill post my code shortly
Zoinky #4
Posted 08 September 2012 - 02:42 PM
Anyone could just type "delete edit"…
Lettuce #5
Posted 08 September 2012 - 03:02 PM
Try naming the door lock program "startup" the computer will run that as soon as it boots, and edit cannot be used.
ccsoxos #6
Posted 08 September 2012 - 09:04 PM
people can just terminat the program
sjele #7
Posted 08 September 2012 - 09:07 PM
people can just terminat the program


os.pullEvent = os.pullEventRaw

That prevents ctrl t
WildCard65 #8
Posted 08 September 2012 - 10:38 PM
or just change bios.lua and add this to line 1 or 2: local blockt = false

then below the os.pullevent function add this: function BlockTerm(val) blockt = val end

then in the os.pullevent function under if event == "terminate" then add this: if blockt then return end
NIN3 #9
Posted 08 September 2012 - 10:49 PM
I always use pcall() when I need to protect a line from termination.


trains,pass=pcall(read)
if trains == false then
print("no termination fo you!!")
os.shutdown()
end

I use that instead of just read. catches Control T.
danners68 #10
Posted 09 September 2012 - 12:25 PM
thank you all for your responces, i will have to try some of them when the server returns

there have been a few edits to my setup since this was posted/solved,

I have Edit disabled delete and cd so now you cant change directory to disk, as standard i put in the pull event raw to disable ctrl+T

is there away i can make boot priority (startup) the computer and not disk so that you cant tell the disk startup to use cd disk,

i was going to post my code today but the server seems to have gone down due to host issues