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

Is this possible

Started by willwalker1313, 21 November 2012 - 11:08 AM
willwalker1313 #1
Posted 21 November 2012 - 12:08 PM
i have 4 computers with wireless modems and disc drives. I want to be able to put in the 4 discs in the drive to unlock another computer via wireless modem.Once unlocked it will allow access to missile control to fire missiles via wireless modems.If a disc is removed the main computer will lock. every thing is done by wireless modems.
dissy #2
Posted 21 November 2012 - 02:32 PM
Yea that should be possible.
You could have the 4 computers simply watch for any disk to be inserted, or a specific disk. It could even be specific enough so disk 1 has to go to computer 1, disk 2 to computer 2, etc. Or even just a set of 4 disks where it doesn't matter which 4.

You can have those 4 computers watch for the events "disk" and "disk_eject".
On the "disk" event, you can check the disk label and/or check for a specific filename to exist on it to make sure it's a valid disk.
Then have them send lock or unlock rednet messages to the main computer.

The main computer will watch for rednet messages and keep track of the other 4. Each time it gets a lock/unlock rednet message, have it do a check to see if all 4 have sent unlock, and only then set a variable to true. Any lock messages would mean at least 1 of the 4 is not unlocked so it would reset that variable to false.

When someone tries to get to the menu, make it check that variable to see if it's true or not. If not it should show some access denied message or something, and if true show the real menu.

I'd also make it so any locked rednet message triggers a reboot or something, so if they are currently in the real menu and someone else removes a disk on one of the other 4, it would basically boot them out of the missle menu.

Sounds like an awesome idea for an adventure map!
willwalker1313 #3
Posted 21 November 2012 - 03:43 PM
thanks for the info now to study all the commands of LUA so i can make the program. Once i get it set up i am going to make a server with the map i am working on.You can check it out on planet minecraft. the map is called Missile base for ICBM (WIP). you need ICBM mod and computercraft for it to have the features.