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

No Disk Drive Allowed!

Started by odd_kid, 05 August 2012 - 05:30 PM
odd_kid #1
Posted 05 August 2012 - 07:30 PM
Im writing code for logging in, and i need to know how to make it so you CANT boot from a floppy when a disk drive is placed.

Ive heard just place obbby around it, but it looks so ugly to me, id rather just program it in.
Zalerinian #2
Posted 05 August 2012 - 07:47 PM
That can't be done on a server, unless you're the server operator. You'll need to modify the shell file inside of the ROM folder, which cannot be edited inside of the game. Another way to stop disks is to simply surround the computer in any material on all sides except for one so that you can use it, but you can't put a disk drive on it.

If you need a disk drive, however, then put it on one of the sides that is inaccessible without breaking a block, preferably protected ones.
Luanub #3
Posted 05 August 2012 - 10:43 PM
If you use a disk drive you'll want to place it on top of the computer. That is the first side in the boot priority. If you dont someone else can still put a drive on top and boot off of the disk.
odd_kid #4
Posted 06 August 2012 - 01:00 AM
Thankyou for the info, sad to know i cant.
Pharap #5
Posted 06 August 2012 - 02:45 AM
If you leave your password program running whenever you are away from the computer, the startup program on the disk won't activate.
Just remember to reboot your pc instead of shutting it down and you're fine
Luanub #6
Posted 06 August 2012 - 05:00 AM
If you leave your password program running whenever you are away from the computer, the startup program on the disk won't activate.
Just remember to reboot your pc instead of shutting it down and you're fine

Disk have a higher boot priority, so if the drop down a disk drive, put in a disk with a startup file on it and ctrl+r bam they're booting off of the disk.
Pharap #7
Posted 06 August 2012 - 05:13 AM
If you leave your password program running whenever you are away from the computer, the startup program on the disk won't activate.
Just remember to reboot your pc instead of shutting it down and you're fine

Disk have a higher boot priority, so if the drop down a disk drive, put in a disk with a startup file on it and ctrl+r bam they're booting off of the disk.

In that case, use the keydown events to grab their key input, test if they are holding the control button and if they press control, make the program send htem a message and then restart.
You might have to then take their keyboard input manually, but at least there's no way out of typing the password.
Noodle #8
Posted 06 August 2012 - 05:36 AM
If you leave your password program running whenever you are away from the computer, the startup program on the disk won't activate.
Just remember to reboot your pc instead of shutting it down and you're fine

Disk have a higher boot priority, so if the drop down a disk drive, put in a disk with a startup file on it and ctrl+r bam they're booting off of the disk.

In that case, use the keydown events to grab their key input, test if they are holding the control button and if they press control, make the program send htem a message and then restart.
You might have to then take their keyboard input manually, but at least there's no way out of typing the password.
Its a delayer.
It makes it so people think they can't shutdown your computer (I had same idea).. It's clever.
Lyqyd #9
Posted 06 August 2012 - 06:46 AM
If you leave your password program running whenever you are away from the computer, the startup program on the disk won't activate.
Just remember to reboot your pc instead of shutting it down and you're fine

Disk have a higher boot priority, so if the drop down a disk drive, put in a disk with a startup file on it and ctrl+r bam they're booting off of the disk.

In that case, use the keydown events to grab their key input, test if they are holding the control button and if they press control, make the program send htem a message and then restart.
You might have to then take their keyboard input manually, but at least there's no way out of typing the password.

You cannot block or avoid Ctrl-R. The computer will reboot if that combination is held down for a certain time, period. Even if you eject the disk as soon as the Control key is pressed, all they have to do is shut it down instead, put the disk in the drive, and then turn the machine on. You can't get around it without making the sides inaccessible or editing the ROM.
Noodle #10
Posted 06 August 2012 - 06:49 AM
You can…
You just need to use lockette signs so the blocks are un-breakable.
It will "delay" it. You can continue to hold it down and for the same amount of time it will shutoff but its a brain trick. If it says you cannot shutdown this computer, it will, but you might let go of the buttons because you're confused or you actually think he created a block.
Pharap #11
Posted 06 August 2012 - 07:16 AM
If you leave your password program running whenever you are away from the computer, the startup program on the disk won't activate.
Just remember to reboot your pc instead of shutting it down and you're fine

Disk have a higher boot priority, so if the drop down a disk drive, put in a disk with a startup file on it and ctrl+r bam they're booting off of the disk.

In that case, use the keydown events to grab their key input, test if they are holding the control button and if they press control, make the program send htem a message and then restart.
You might have to then take their keyboard input manually, but at least there's no way out of typing the password.

You cannot block or avoid Ctrl-R. The computer will reboot if that combination is held down for a certain time, period. Even if you eject the disk as soon as the Control key is pressed, all they have to do is shut it down instead, put the disk in the drive, and then turn the machine on. You can't get around it without making the sides inaccessible or editing the ROM.

If you remap the ctrl-r event to something else and put it in a loop, it should get stuck on that loop and perform that code instead, just like how in real world computers you can override ctrl alt delete by making a program fire an event and process something when the keys are pressed.
Luanub #12
Posted 06 August 2012 - 08:39 AM
But remember ctrl+r is hard coded into CC.. Its part of the underlying java code. I don't think it will matter what you do in Lua. I wouldn't mind playing with code for this if someone has some already. PM me if you dont want to post it here.
Noodle #13
Posted 06 August 2012 - 10:23 AM
If you remap the ctrl-r event to something else and put it in a loop, it should get stuck on that loop and perform that code instead, just like how in real world computers you can override ctrl alt delete by making a program fire an event and process something when the keys are pressed.
Wrong, its hardcoded… It will shutdown no matter what.
Pharap #14
Posted 06 August 2012 - 11:35 AM
If you remap the ctrl-r event to something else and put it in a loop, it should get stuck on that loop and perform that code instead, just like how in real world computers you can override ctrl alt delete by making a program fire an event and process something when the keys are pressed.
Wrong, its hardcoded… It will shutdown no matter what.
I did say should.
Pharap #15
Posted 06 August 2012 - 11:38 AM
But remember ctrl+r is hard coded into CC.. Its part of the underlying java code. I don't think it will matter what you do in Lua. I wouldn't mind playing with code for this if someone has some already. PM me if you dont want to post it here.
Hrm, that is where CraftOS differs from real world operating systems. It would be handy if you could override them. I did read somewhere on the forums here once someone who said a way to do it through editing code files, but then it wouldn't be much use with a server unless you are the one hosting it.
Pharap #16
Posted 06 August 2012 - 11:52 AM
According to one of the virus posts, using:

os.pullEvent = os.pullEventRaw
should block the ctrl commands, but you still need to test for the keydowns to accept typed input.
Noodle #17
Posted 06 August 2012 - 11:54 AM
But remember ctrl+r is hard coded into CC.. Its part of the underlying java code. I don't think it will matter what you do in Lua. I wouldn't mind playing with code for this if someone has some already. PM me if you dont want to post it here.
Hrm, that is where CraftOS differs from real world operating systems. It would be handy if you could override them. I did read somewhere on the forums here once someone who said a way to do it through editing code files, but then it wouldn't be much use with a server unless you are the one hosting it.
1: Don't double post
2: Real World Operating systems have a shutdown button.. On the computer. CTRL + S is like that button.
3: Boot Disks works, but you need to be a server owner.
Pharap #18
Posted 06 August 2012 - 12:02 PM
But remember ctrl+r is hard coded into CC.. Its part of the underlying java code. I don't think it will matter what you do in Lua. I wouldn't mind playing with code for this if someone has some already. PM me if you dont want to post it here.
Hrm, that is where CraftOS differs from real world operating systems. It would be handy if you could override them. I did read somewhere on the forums here once someone who said a way to do it through editing code files, but then it wouldn't be much use with a server unless you are the one hosting it.
1: Don't double post
2: Real World Operating systems have a shutdown button.. On the computer. CTRL + S is like that button.
3: Boot Disks works, but you need to be a server owner.
I know what it's intended for, but then again real computers actually have a power source which the button cuts out.
That last one made little sense.
Noodle #19
Posted 06 August 2012 - 12:05 PM
Yes, but Minecraft doesn't have power sources. Its simulating the power.
Pharap #20
Posted 06 August 2012 - 12:15 PM
Yes, but Minecraft doesn't have power sources. Its simulating the power.
Exactly, hence, the comparison to real computers is a difficult one.
If we are going to use real computer comparisons, both startup scripts should fire, with the computer's coming first.
Luanub #21
Posted 06 August 2012 - 09:42 PM
So this

os.pullEvent = os.pullEventRaw

Will stop the terminate event from happening since it is part of the os.pullEvent. Basically your removing os.pullEvent, and using os.pullEventRaw which does not include the terminate event. It does nothing with the ctrl key.

There are no reboot or shutdown events for that to capture and stop. And since it is hardcoded you can not stop it without removing the boot option from the bios.lua.

Only option you have if you can not edit the bios is to place a disk drive with a startup file on in on top of the computer.
odd_kid #22
Posted 06 August 2012 - 11:43 PM
So tl;dr

Place Lockett signs around the computer so no one can break them.

Problem with that is, you can place a drive on the front and still boot from there. Call me wird but i really dont want a sign on my front.

Cant you rerout the startup to do something else when a boot disk is placed?
Lyqyd #23
Posted 07 August 2012 - 01:16 AM
So tl;dr

Place Lockett signs around the computer so no one can break them.

Problem with that is, you can place a drive on the front and still boot from there. Call me wird but i really dont want a sign on my front.

Cant you rerout the startup to do something else when a boot disk is placed?

Not without editing the startup. However, a disk drive on the top side of the computer will always be booted off of first.
Bobder22 #24
Posted 07 August 2012 - 05:26 AM
Why not have a looping program detect when a disk is placed in any adjacent disk drive, and then just eject it?
Lyqyd #25
Posted 07 August 2012 - 05:31 AM
Because you can put a disk in a drive while the computer is shut down.
Bobder22 #26
Posted 07 August 2012 - 05:32 AM
Ah, true didn't think of that

Although, another idea if you dont want to place a lockette sign on the front of your computer is to place it in the same block but facing to the side of it, so It doesnt cover the computer.
wilcomega #27
Posted 07 August 2012 - 03:19 PM
other sides of the computer have a higher priority for booting. if i remember correctly the left side has the highest just because of the checking order and left side it checks first and then the others i think. so if you just put you password on the left side in a disk drive and hide it you are proberly safe
Lyqyd #28
Posted 08 August 2012 - 01:10 AM
other sides of the computer have a higher priority for booting. if i remember correctly the left side has the highest just because of the checking order and left side it checks first and then the others i think. so if you just put you password on the left side in a disk drive and hide it you are proberly safe

Left? Where are you even getting that from? No, I already said that it's the top that it boots from first.
Cranium #29
Posted 08 August 2012 - 01:34 AM
Do this:
1. Have a sneaky computer behind your good one, always using the peripheral API to turn on the computer you want.
2. Using the parallel API, have a function always checking for a disk, and then ejecting it when inserted.
3. ???
4. PROFIT!!!
Pharap #30
Posted 08 August 2012 - 03:40 AM
Do this:
1. Have a sneaky computer behind your good one, always using the peripheral API to turn on the computer you want.
2. Using the parallel API, have a function always checking for a disk, and then ejecting it when inserted.
3. ???
4. PROFIT!!!
I like this idea. Particularly steps 3 and 4.
wilcomega #31
Posted 08 August 2012 - 01:08 PM
other sides of the computer have a higher priority for booting. if i remember correctly the left side has the highest just because of the checking order and left side it checks first and then the others i think. so if you just put you password on the left side in a disk drive and hide it you are proberly safe

Left? Where are you even getting that from? No, I already said that it's the top that it boots from first.

easy man, i could not fully recall it.
D3matt #32
Posted 09 August 2012 - 06:51 AM
Do this:
1. Have a sneaky computer behind your good one, always using the peripheral API to turn on the computer you want.
2. Using the parallel API, have a function always checking for a disk, and then ejecting it when inserted.
3. ???
4. PROFIT!!!
This is exactly what I was just thinking of. The password computer would auto-eject any disk put next to it. The hidden computer would instant restart the computer if it shuts down, so they won't have time to insert the disk while it's shut down. For added profit, have the password computer check the other one and restart that one when it shuts down, in case they try to get that one.
Pharap #33
Posted 09 August 2012 - 06:53 AM
Failing all the other stuff, hide some tnt nearby so that if someone does manage to get past security, they won't live to tell the tale.
brett122798 #34
Posted 09 August 2012 - 07:53 AM
Failing all the other stuff, hide some tnt nearby so that if someone does manage to get past security, they won't live to tell the tale.
Oh that's just so cruel! But I like it.