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

Missile System

Started by Jester, 10 April 2014 - 07:52 PM
Jester #1
Posted 10 April 2014 - 09:52 PM
I want to make a Missile System on computercraft.

There is a MASTERCOMPUTER and several SiloComputers.
The MasterComputer is the only computer that can access the Silocomputers but the silocomputers Can't launch manually; only through the Mastercomputer.
When the Mastercomputer receives the "Usagecode" to use the Mastercomputer, it will log in.
Then the MasterComputer asks to launch "Key Y" or to abort launch "key N"
Then the Mastercomputer aks what Silocomputer to use because there are several Silocomputers
After Silocomputer has been selected Activates the Selected Silocomputer.
The MasterComputer asks the User what the Coordinates are XYZ
When USer inserts XYZ manually the MasterComputer sends it to the Selected Silocomputer.
The MasterComputer asks the Launch Code if wrong REBOOT to Step 1
If LaunchCode is true MasterComputer asks if user wants to proceed '' Y OR N ''
When Y is selected Silocomputer waits 30 seconds until launch and a Alarm goes off by the MasterComputer .
But after the Launch Code has been activated the User can Abort this with an Abortcode.
When countingdown the MasterComputer displays the countdown time.
After Missile Has been Launched The Compiter Reboots.

When cntr+T , cntrl+S or Cntr+R has been used the computer ignores it and proceeds the program.


Thanks For your Help. :D/>



steps
———
1. Greets User Press A key to continue.
2. Enter UsageCode ( Code = Firstcode11 )
3. Asks To Launch "key Y" or Abort Launch "key N"
4. If "Y" then Computer asks what Silocomputer to use because there are several SiloComputers. If "N" Computer Reboots
5. After Silocomputer has been selected, this computer will be activated.
6. then the silocomputer asks the mastercomputer the coordinates.
7. User inserts XYZ coordinates, Mastercomputer sends the Coordinates to silocomputer
8. Mastercomputer Asks user the Launchcode. (Code = xxx )
9. When LaunchCode is confirmed. Asks the User if he wants to proceed the launch "Y or N"
10. When "Y" is selected Silocomputer waits 30 seconds until launch,
Like this the User can abort with An ABORTCODE ( Code = Abortcode11 )
While waiting in the room where the Mastercomputer stands an alarm goes off for 30 seconds.
11. there is also a countdown screen with the remaining time.
12. After Launching or aborting the Computer Reboots to "Step 1".
Edited on 09 January 2015 - 08:52 PM
Lyqyd #2
Posted 10 April 2014 - 10:11 PM
We don't generally code things by request in Ask a Pro, but if you have problems coding it, we can help you figure out why your code isn't working.

Also, there is nothing your program can do about Ctrl-R or Ctrl-S. Those will always reboot/shut down the computer, regardless of anything your program does.
Jester #3
Posted 10 April 2014 - 10:19 PM
so if Ctrl-R or Ctrl-S is used the computer reboots instanly without letting the computer use another programs

Now the only problem i have is when you enter a specific number to use how do you use it in another command (example: xyz have been inserted ) is this with
Local … == … Or with another one
Bomb Bloke #4
Posted 10 April 2014 - 11:16 PM
That's one way, yes.

Eg:

local myVariable = read()

if myVariable == "y" then
  print("Doing stuff")
else
  print("Not doing stuff")
end
guesswhat123212 #5
Posted 11 April 2014 - 03:35 AM
http://www.computerc...ki/Os.pullEvent this will help with key pressed events but it will lock up the system while waiting for the key press

as for stopping ctrl+r or s,

os.pullEvent = os.pullEventRaw should stop that, if not try reading

http://www.computerc...ki/Os.pullEvent
Edited on 11 April 2014 - 01:36 AM
Jester #6
Posted 25 May 2014 - 01:54 PM
Well where can i place this request, so someone can make it ?
KingofGamesYami #7
Posted 09 January 2015 - 11:24 PM
You can put the request in General, but don't expect a fast response.
HPWebcamAble #8
Posted 07 April 2015 - 07:41 PM
as for stopping ctrl+r or s,

os.pullEvent = os.pullEventRaw should stop that

That will stop ctrl+t, not ctrl+r or ctrl+s

Like lyqyd said, you can't prevent those, but when the computer starts, it runs the file named 'startup' if it exists, so you can have your program use that to detect if it was restarted.