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

Icbm program that will fire missiles as soon as the program opens

Started by pig101z, 18 May 2013 - 03:37 PM
pig101z #1
Posted 18 May 2013 - 05:37 PM
i am completely stuck on this if you can make a program that will do this please help thanks in advanced
W00dyR #2
Posted 18 May 2013 - 06:43 PM
If you want a program to launch as soon as the computer starts name the file "startup" or, in the file "startup" you add the following:


missileProgram = blabla -- change blabla to whatever your program is called
shell.run(missileProgram)

If you mean anything else by saying "as soon as the program opens" please post ;)/>
pig101z #3
Posted 18 May 2013 - 09:33 PM
what I need to do is as soon as I start up the computer and type in the name of the program I need it to send a redstone signal to a side and then sleep for 5 seconds and then shut it off
W00dyR #4
Posted 18 May 2013 - 09:42 PM
what I need to do is as soon as I start up the computer and type in the name of the program I need it to send a redstone signal to a side and then sleep for 5 seconds and then shut it off


rs.setOutput("left", true) -- change left to any other side
sleep(5)
os.shutdown()

That script literally does that, but what is the point of the sleep in here? :)/>
pig101z #5
Posted 19 May 2013 - 10:48 AM
I figured it out this is my code and it fires my missiles

redstone.setOutput("back",true) --- change to any side you want
sleep(5)
redstone.setOutput("back",false) -- change to any side you want
theoriginalbit #6
Posted 19 May 2013 - 11:02 AM
On topic: A redstone pulse of 0.1 is all that is needed to cause the missile to fire, unless there is some other reason you have a sleep of 5 seconds? Also the program Redpulse I believe would also suffice for this trivial task, iirc "redpulse back 1 0.1" should pulse the redstone on the back once, for a length of 0.1 seconds (its been a while since I've played minecraft, and thus used the program, so the command order may have changed)

Off topic: Just an FYI the Ask a Pro section is not here for us to give you code or make you programs, we are not code monkeys (these kinds of requests should be made in General :P/>). This section is for advice or help with problems in the program you're making.
When you are making your program and encounter an error, it is suggested that you attempt to fix the error yourself, including but not limited to, Googling in an attempt to better understand the error (if you're not getting any good results, make sure to look at my Searching Google More Efficiently for Help & Code), then if you continue to have problems you can come here for assistance. The reason this is a suggested tactic is that it is proven that people get a greater satisfaction out of fixing their problems themselves, there is more pride in the work, and there is less likely a chance that you will make the same mistake again.
pig101z #7
Posted 19 May 2013 - 01:08 PM
uh what do you think I was asking for I have been stuck for days and figured out by myself finnaly so eat it
theoriginalbit #8
Posted 19 May 2013 - 01:19 PM
uh what do you think I was asking for I have been stuck for days and figured out by myself finnaly so eat it
None of that…. Be nice…

While you may have been stuck for days, all I see in the OP is you asking for us to make you a program (see quote below), I see no link, or code tags containing your past (failed) efforts at attempting to create this program so that we could render assistance and guide you in the right direction to fixing your program.

if you can make a program
pig101z #9
Posted 19 May 2013 - 05:58 PM
because I do not remember what all the programs were but I figured it out on my own
D3matt #10
Posted 20 May 2013 - 01:25 AM
Ignore him, this is like his 4th thread on the subject in the past week or two, he always has a terrible attitude.

pig101z, some people just don't have the mental facilities to program. If after all this time of people helping you, you still don't get even the basics, either you're going about understanding it wrong, or you just aren't meant to write programs. And read this! http://www.computercraft.info/forums2/index.php?/topic/12861-searching-google-more-efficiently-for-help-code/
pig101z #11
Posted 21 May 2013 - 03:31 PM
guess who is back you cant get rid of me by banning ha ha ha I have a friend on here that will do as I say mwhahahaha
pig101z #12
Posted 21 May 2013 - 03:32 PM
that is if I was banned if I was I do not know why
pig101z #13
Posted 21 May 2013 - 03:34 PM
my old account was pig101z
Cranium #14
Posted 21 May 2013 - 04:05 PM
This has gotten out of hand. The appropriate actions have been taken.