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

Skynet database, Missile Defence System. LOAD, Launch on Detection.

Started by Andrew2060, 08 February 2014 - 08:43 AM
Andrew2060 #1
Posted 08 February 2014 - 09:43 AM
hi all,

ive completed my nuclear/missile arsenal for my island, the island is 10k in radius. the island is owned by my faction called skynet, because its my faction and not many have bothered to play around with computercraft i have seen a ally of mine use the computers to manage his/her missile defensive system.

what i have setup is a database that manages missiles, emailing, member info for all faction members. auth page that requests username and password to open up the database according to your rank you access that information.

since i have many enemies with different coordiantes and launch bases. i have setup bases around the minecraft server that locate and kill flying missiles, what is inefficient is that they only kill missiles in the 100 block radius.

what we cant do is get coordinates from the radar of the location the missile is sent from or the origin.
i have come up with a program that runs on startup that first prompts for username and password, than opens up the directory. within the directory for missiles i have the whole setup ready.

all i need to find is a way to get a modem to transfer a command to another comuter which will execute the command to release a redstone signal and activate the missile launch.

this project is quite huge and is something that isnt out there, i havent come across a database for organizing information nor a way to edit the same database with another computer. my friend has done it.

my plans are

1. secure a network (done)
2. create military part of network (done)
3. create a broadcast system that can work for the icbm defense and offensive needs.
4. create a database system that organizes the members info (done)
5. create a broadcast system for my recruiter[ranks] to open their computers input the new members name pass, user, etc.
6. create a broadcast system to email other users (partially done)

what i simply need is.
1. a way to get origin of incoming missiles and input that into icbm launchers than fire them.
2. a way to allow recruiters to edit the program to input new members username and password.
3. a way to email other users across the island.

for all of this we are using the /mail command and the /msg command, if we have to transfer documents since we have no networking capabilties we use flans airplanes to transfer printed code and documents to facilities across the island. we have a subway system which is quite inefficient when it comes to moving files and people because those people might tamper the files.

airplanes are the best current method of file transport.

and for missile defence our anti ballistics shoot missiles down and trigger an emp burst to take em out shortly after if two or more missiles are detected. if more than 5 to 10 missiles are detected the forcefield is charged when the pulse is received from a radar dish 1000 blocks from the island, it charges up the forcefield which takes 5 minutes so that it can fully defend the island.




again all i need is a way to locate the origin of incoming missiles, sending of commands to another computer that than executes the command for example,

send from pc 1: launch missiles
pc 2: send pc 1: select silo
pc 1: send pc 2: silo 2
pc 2: Launching missiles,
pc 2: send pc 1: launched missiles.
pc 1: Missile launch success.

if you like it give it a vote up.
Edited on 12 February 2014 - 04:49 AM
surferpup #2
Posted 10 February 2014 - 01:15 PM
Here is the code I posted for you following our IRC chat yesterday:


Here is the final version. I duplicated your world setup and edited your code to get it to work.
  • Yes, I have tested it thoroughly. It works.
  • Please make changes to the computer ids at start of each program.
  • I placed in error checking so bad messages would be ignored.
  • I added some screen formatting for you (again it is better, but not what I like)
  • I loop your Master Computer.
  • To exit the Master Computer loop, type in quit
This code is written in your style, although a bit improved (local variables are used, a little more organization, some error checking included). Please look over the changes and try to understand each feature – it will make you a better programmer. :)/>

Good Luck on your defense.

Code for Master Computer


------master computer----------
local launchpc = 3 -- put in ID of main Launch PC
--type in "quit" to exit
repeat
	term.clear()
	term.setCursorPos(1,2)
	term.write("(Type quit to exit)")
	term.setCursorPos(1,1)
	term.write("Enter ID of Missile to Launch: ")
	local id = read()
	id = id or ""
	if (tonumber(id)) then
		rednet.open("right")
		rednet.send(launchpc,id)
	end
until id=="quit"
term.clear()
print("Done.")

Code for Main Launch Computer


------main launch computer -------
local mainpc = 5 -- change this to your master computer ID
rednet.open("right") --if your modem is not on the right, change this
local function main()
	term.clear()
	term.setCursorPos(1,1)
	print([[--Master Launch computer--
	--Select Launch computer--
	silo 1 =27
	silo 2 =24
	silo 3 =17
	silo 4 =28
	silo 5 =26
	silo 6 =19
	Enter one of these ids to fire:]])
	while true do
		-- clear message line
		term.setCursorPos(1,13)
		term.clearLine()
		-- move cursor to just below "Enter one of these ids to fire"
		term.setCursorPos(1,9)
		term.clearLine()
		term.write("Enter computer ID: ")

		local id = read() -- this is your input line

		if tonumber(id) then
			rednet.send(tonumber(id),"fire!") -- this is the line that sends the command
		else
			-- user did not enter a number or just pressed return
			term.setCursorPos(1,11) -- move cursor
			term.write("Please enter a number.")
			term.setCursorPos(19,9) -- move cursor back
		end
	end
end

local function repeater()
  while true do
	 local sender,msg = rednet.receive()

	 -- display message at column 1, row 13
	 term.setCursorPos(1,13)
	 term.clearLine()
	 term.setBackgroundColor(colors.white)
	 term.setTextColor(colors.red)

	-- handle message, if not from master computer, ignore it
	 if sender == mainpc then
		term.write("Recieved Message from MCP:"..tostring(msg))
		if tonumber(msg) then
		  rednet.send(tonumber(msg),"fire!")
		else
		  term.write(" (Bad Message)")
		end
	 else
		term.write("Recieved Message from "..tostring(sender)..": Ignored.")
	 end

	 -- put cursor back
	 term.setBackgroundColor(colors.black)
	 term.setTextColor(colors.white)
	 term.setCursorPos(19,9) -- will place it right after "Enter computerID: "
  end
end

parallel.waitForAll(main,repeater)  -- this does all the work


Code for Silo Launch Computers



-----------------launch computers hooked up to silos---------
local launchPC = 3 -- Change to Main Launch Computer ID
rednet.open("right") --again, change if not right
term.clear()
print("Listening...")
while true do
	local id, msg = rednet.receive()
	print ("Received message from "..tostring(id)..":"..tostring(msg))
	if(msg == "fire!" and tonumber(id) == launchPC) then
		  icbm.launch()  
	end
end
Edited on 10 February 2014 - 12:17 PM
awsmazinggenius #3
Posted 10 February 2014 - 02:21 PM
For something like a missile system, you should have one computer verify it's identity to the other before sending the message using cryptography so you don't accidentally fire them ;)/>
surferpup #4
Posted 10 February 2014 - 03:05 PM
For something like a missile system, you should have one computer verify it's identity to the other before sending the message using cryptography so you don't accidentally fire them ;)/>

I agree, but this member is no where near to that level of coding. I told him in IRC that this was a poor design full of holes. But this is what he wants. And I am not about ready to write up a tutorial on improving a missile control system – I will leave that to you :P/>
awsmazinggenius #5
Posted 10 February 2014 - 08:01 PM
I might do a ComputerCraft wireless cryptography tutorial someday if I am interested enough.
surferpup #6
Posted 10 February 2014 - 09:52 PM
That would be a neat tutorial. I am curious if rednet handshaking is fast enough to encrypt the message with the key and minecraft timestamp, send it, receive it (noting current minecraft timestamp at receiving side) and then decrypt. If the two timestamps don't align, then it couldn't be decrypted. I believe a minecraft minute is .8 seconds long.
theoriginalbit #7
Posted 10 February 2014 - 09:57 PM
I am curious if rednet handshaking is fast enough to encrypt the message
ummm handshaking has nothing to do with encryption and everything to do with establishing a connection between two nodes, sure the connection is commonly encrypted, but a handshake can also be on unsecured connections too.
surferpup #8
Posted 10 February 2014 - 10:07 PM
ummm handshaking has nothing to do with encryption and everything to do with establishing a connection between two nodes, sure the connection is commonly encrypted, but a handshake can also be on unsecured connections too.

Perhaps handshaking was the incorrect term. These are the steps that would have to occur if we were to use a timestamp in the encryption scheme:
  1. The master would provide the slave with a randomized encryption key. The slave would use this key as part of the encryption process when sending all messages.
  2. The slave would receive input from the user in the form of a password.
  3. The slave would get the current minecraft timestamp and use it, combined with the encryption key to encrypt the user input.
  4. The slave would send the encrypted message to the master.
  5. Upon receiving a message from the slave, the master would mark the current time.
  6. The master would then use the current time along with the encryption key to decrypt the message.
I am wondering if between steps 3 and 5 the timestamp would change making decryption unlikely. Of course, one could always accommodate this by rounding down to the nearest even minecraft minute. There would probably not be a full 1.6 second delay between encryption and receipt of the message. That, for use of a better term, was what I was referring to as the handshake. Perhaps I should have said "encrypt-decrypt process" or "message encryption, transmission and receipt process." Choose your own lingo. For future reference, I am going to call the whole thing "the Bob effect."
Edited on 10 February 2014 - 09:08 PM
Andrew2060 #9
Posted 11 February 2014 - 05:49 AM
need help got errored in silo computer bios337:startup:11: 'end' expected (to close 'while' at line 6)

answered my own question, nvm had to put two ends 1 to close for the icbm launch and 1 to close the program while"
Andrew2060 #10
Posted 11 February 2014 - 05:57 AM
well on missile fire it got erored, says [ received message from 32:fire! startup;10; attempt to index (nil value)

it seems that before i edited the script for each launch computer that follows yours one of them seemed to fire of on command, one that was not changed to these settings, could the old one work?
Andrew2060 #11
Posted 11 February 2014 - 06:10 AM
nvm changing the code seemed to help, created my newer version out of mine and the one you gave thanks :)/> it did help me to understand plus u forgot to wrap the icbm

another issue, this time its related to the main launch pc, independantly it fires missiles when id is entered into manually, dependantly on master pc it does not fire missile but produces a white line and exits the program.

i fixed most of the issues with silo pcs and i copied master pc launch code into it by adding through copy paste. it brings up the id to fire and asks for id of silo pc. upon entering silo pc id, master launch pc fails and silo pcs are still activated but not launching
mibac138 #12
Posted 11 February 2014 - 06:54 AM
Nice idea :)/>
TechMasterGeneral #13
Posted 11 February 2014 - 07:03 AM
Perhaps my CCMC could be of use to you. I already have the base down and am almost completely finished with the multiple launcher support. I have a lot to work on so i'm getting stuff out slowly, but i have the basics of what i believe you want done.
link | (in sig)
\ /
Andrew2060 #14
Posted 11 February 2014 - 07:43 AM
let me tell you this, i am very handy with red stone and can make almost any contraption, my island is artificial made to look natural, i have used many principals to make it secure and effective. my membership for the faction has increased by another hundred in the past week, this server can handle upto 1200 players and because of my factions ethnicity being rather… complicated i have a few enemies that are trying to get rid of me.

two weeks ago i came across a database network i liked, my friend is an ally near my island and made it to protect himself of nuclear bomb blasts. and nuclear warfare taking place. i manipulated my own networking system although i cant get the principles right but it is currently used for my missile systems and i am testing it before i give it control over my nuclear arsenal to be well not to brag but 8200 Nuclear/mass destruction missiles active, 10000 in storage for safe keeping and 2500 other missiles active. yes yes i know it is quite destructive but still, i have to protect my nation.

now my idea is that we get a few people to work on a program that consists of a database type network, not the internet but a wireless relayed network that controls membership information such as (names, homes history of members), missile networking, defense anti ballistic missile system running that uses a table inserted by a radar to control anti ballistic missiles.

i have made a simple way to launch missiles from 1 computer but i cant get another computer to tell that computer to fire the missiles.

here is what i have done,

i created the fundamental idea to control missile silos by a single basic computer.
the silos operate with a peripheral.wrap("back") so each missile system is hooked up to a listening system that will fire it when receiving the message.
the main launch computer or master launch pc fires missiles, when the id of the silo computer is inserted and entered.

now i have more then 10k silos each hooked up to a silo pc, not all are connected and many are disabled from launching for safeguards against nuclear detonation within the island.

the master launch pc is in the pentagon, yes we have a building not as large as the original structure but still it controls the national military.
in the event of wartime we do not always use our islands missile systems as we have bases all around the world on stand by with employees to fire for us.
submarines and long range bombers are also used to drop explosives or use missiles to destroy enemy facilities.

My issue is the enemy is beginning to corrupt members in these stations therefore if i make mostly the basic defense and offensive system automatic there should be no need for staff to fire nuclear missiles or any type of missile. my only issue is to connect all computers under one network which i will fix later.
currently i need to make a simple system as described above and covered by surferpup

his concept helps but the issue lies in the main launch pc. silos code i rewrote to better it, not sure if it has to be the one surferpup provided to prevent error.

here is the basics of what i need.

Master computer > Master Launch PC > SILO Launch PC
id: 30 id: 32 different ids

No plus positive + points for the idea? LOL ;)/>
mibac138 #15
Posted 11 February 2014 - 07:45 AM
How long u were writing it? :blink:/>
Andrew2060 #16
Posted 11 February 2014 - 08:06 AM
the coded script? it took me two weeks to make the database script, mostly print stuff. easy.
3 days to make the master launch code, 1 day for the silo code,
i made other programs aswell such as data stealing floppys that copy the data of a pc then plug in a virus that cant be terminated.
useful to steal enemy information then kill the pc since breaking it wont do much because of factions world protect

if anyone can help me fix my issue with the automated launch control
again my main pc told the main launch pc to fire missile from silo 28, main launch pc acknowledges message but did not forward it to the launch pc. to fix this i had two ideas one was to make this tree type network currently in progress, the second one was to well add the ids of all master launch pcs so one launch pc from anywhere can fire any missile, note this server has the wireless range to 10 k blocks
Andrew2060 #17
Posted 11 February 2014 - 08:12 AM
ugh i get errored with the damn master launch pc. i dont think you tested well enough surferpup, i need to fix this before i can trust my nuclear arsenal to it
mibac138 #18
Posted 11 February 2014 - 08:15 AM
Spoiler
the coded script? it took me two weeks to make the database script, mostly print stuff. easy.
3 days to make the master launch code, 1 day for the silo code,
i made other programs aswell such as data stealing floppys that copy the data of a pc then plug in a virus that cant be terminated.
useful to steal enemy information then kill the pc since breaking it wont do much because of factions world protect

if anyone can help me fix my issue with the automated launch control
again my main pc told the main launch pc to fire missile from silo 28, main launch pc acknowledges message but did not forward it to the launch pc. to fix this i had two ideas one was to make this tree type network currently in progress, the second one was to well add the ids of all master launch pcs so one launch pc from anywhere can fire any missile, note this server has the wireless range to 10 k blocks

How long u were posting this post

Spoiler
let me tell you this, i am very handy with red stone and can make almost any contraption, my island is artificial made to look natural, i have used many principals to make it secure and effective. my membership for the faction has increased by another hundred in the past week, this server can handle upto 1200 players and because of my factions ethnicity being rather… complicated i have a few enemies that are trying to get rid of me.

two weeks ago i came across a database network i liked, my friend is an ally near my island and made it to protect himself of nuclear bomb blasts. and nuclear warfare taking place. i manipulated my own networking system although i cant get the principles right but it is currently used for my missile systems and i am testing it before i give it control over my nuclear arsenal to be well not to brag but 8200 Nuclear/mass destruction missiles active, 10000 in storage for safe keeping and 2500 other missiles active. yes yes i know it is quite destructive but still, i have to protect my nation.

now my idea is that we get a few people to work on a program that consists of a database type network, not the internet but a wireless relayed network that controls membership information such as (names, homes history of members), missile networking, defense anti ballistic missile system running that uses a table inserted by a radar to control anti ballistic missiles.

i have made a simple way to launch missiles from 1 computer but i cant get another computer to tell that computer to fire the missiles.

here is what i have done,

i created the fundamental idea to control missile silos by a single basic computer.
the silos operate with a peripheral.wrap("back") so each missile system is hooked up to a listening system that will fire it when receiving the message.
the main launch computer or master launch pc fires missiles, when the id of the silo computer is inserted and entered.

now i have more then 10k silos each hooked up to a silo pc, not all are connected and many are disabled from launching for safeguards against nuclear detonation within the island.

the master launch pc is in the pentagon, yes we have a building not as large as the original structure but still it controls the national military.
in the event of wartime we do not always use our islands missile systems as we have bases all around the world on stand by with employees to fire for us.
submarines and long range bombers are also used to drop explosives or use missiles to destroy enemy facilities.

My issue is the enemy is beginning to corrupt members in these stations therefore if i make mostly the basic defense and offensive system automatic there should be no need for staff to fire nuclear missiles or any type of missile. my only issue is to connect all computers under one network which i will fix later.
currently i need to make a simple system as described above and covered by surferpup

his concept helps but the issue lies in the main launch pc. silos code i rewrote to better it, not sure if it has to be the one surferpup provided to prevent error.

here is the basics of what i need.

Master computer > Master Launch PC > SILO Launch PC
id: 30 id: 32 different ids

No plus positive + points for the idea? LOL ;)/>
Edited on 11 February 2014 - 07:16 AM
Andrew2060 #19
Posted 11 February 2014 - 08:22 AM
? took me approx 5 min to type it
Andrew2060 #20
Posted 11 February 2014 - 08:42 AM
back to the question, surferpup i have recoded it, your silo pc code script had one flaw, the fact you forgot to add the peripheral wrapping to it. the second part worrys me apparently the main launch pc gets the signal from master pc but does not tell the silo pc, it simply exits the program and makes a white line across the screen of the pc
Andrew2060 #21
Posted 11 February 2014 - 08:53 AM
Here is the code I posted for you following our IRC chat yesterday:


Here is the final version. I duplicated your world setup and edited your code to get it to work.
  • Yes, I have tested it thoroughly. It works.
  • Please make changes to the computer ids at start of each program.
  • I placed in error checking so bad messages would be ignored.
  • I added some screen formatting for you (again it is better, but not what I like)
  • I loop your Master Computer.
  • To exit the Master Computer loop, type in quit
This code is written in your style, although a bit improved (local variables are used, a little more organization, some error checking included). Please look over the changes and try to understand each feature – it will make you a better programmer. :)/>

Good Luck on your defense.

Code for Master Computer


------master computer----------
local launchpc = 3 -- put in ID of main Launch PC
--type in "quit" to exit
repeat
	term.clear()
	term.setCursorPos(1,2)
	term.write("(Type quit to exit)")
	term.setCursorPos(1,1)
	term.write("Enter ID of Missile to Launch: ")
	local id = read()
	id = id or ""
	if (tonumber(id)) then
		rednet.open("right")
		rednet.send(launchpc,id)
	end
until id=="quit"
term.clear()
print("Done.")

Code for Main Launch Computer


------main launch computer -------
local mainpc = 5 -- change this to your master computer ID
rednet.open("right") --if your modem is not on the right, change this
local function main()
	term.clear()
	term.setCursorPos(1,1)
	print([[--Master Launch computer--
	--Select Launch computer--
	silo 1 =27
	silo 2 =24
	silo 3 =17
	silo 4 =28
	silo 5 =26
	silo 6 =19
	Enter one of these ids to fire:]])
	while true do
		-- clear message line
		term.setCursorPos(1,13)
		term.clearLine()
		-- move cursor to just below "Enter one of these ids to fire"
		term.setCursorPos(1,9)
		term.clearLine()
		term.write("Enter computer ID: ")

		local id = read() -- this is your input line

		if tonumber(id) then
			rednet.send(tonumber(id),"fire!") -- this is the line that sends the command
		else
			-- user did not enter a number or just pressed return
			term.setCursorPos(1,11) -- move cursor
			term.write("Please enter a number.")
			term.setCursorPos(19,9) -- move cursor back
		end
	end
end

local function repeater()
  while true do
	 local sender,msg = rednet.receive()

	 -- display message at column 1, row 13
	 term.setCursorPos(1,13)
	 term.clearLine()
	 term.setBackgroundColor(colors.white)
	 term.setTextColor(colors.red)

	-- handle message, if not from master computer, ignore it
	 if sender == mainpc then
		term.write("Recieved Message from MCP:"..tostring(msg))
		if tonumber(msg) then
		  rednet.send(tonumber(msg),"fire!")
		else
		  term.write(" (Bad Message)")
		end
	 else
		term.write("Recieved Message from "..tostring(sender)..": Ignored.")
	 end

	 -- put cursor back
	 term.setBackgroundColor(colors.black)
	 term.setTextColor(colors.white)
	 term.setCursorPos(19,9) -- will place it right after "Enter computerID: "
  end
end

parallel.waitForAll(main,repeater)  -- this does all the work


Code for Silo Launch Computers



-----------------launch computers hooked up to silos---------
local launchPC = 3 -- Change to Main Launch Computer ID
rednet.open("right") --again, change if not right
term.clear()
print("Listening...")
while true do
	local id, msg = rednet.receive()
	print ("Received message from "..tostring(id)..":"..tostring(msg))
	if(msg == "fire!" and tonumber(id) == launchPC) then
		  icbm.launch()  
	end
end

you made a mistake in the silo computer and did not peripheral wrap it.

the other issue is in the main launch pc i cant decipher because my knowledge does not go to parallels or repeater functions. i cant identify the problem but what happens is that the computer receives the info but does not send it to the silo. it makes a line turn white and below it is written please enter id then it brings up usual shell and exits program. no error msg from pc at all
surferpup #22
Posted 11 February 2014 - 01:04 PM
you made a mistake in the silo computer and did not peripheral wrap it.

the other issue is in the main launch pc i cant decipher because my knowledge does not go to parallels or repeater functions. i cant identify the problem but what happens is that the computer receives the info but does not send it to the silo. it makes a line turn white and below it is written please enter id then it brings up usual shell and exits program. no error msg from pc at all

You had no reference in your original code to wrapping the icbm, and since I don't use them, I did not either. I assumed it was an API. Glad you fixed that.

You are in a bit over your head coding. I need you to post your code exactly the way you have it in right now. You simply reposted my code. My code works fine, by the way. I do not have icbm's, but it does not matter from a logic standpoint. To get my code to work for you, you need to :
  1. In the Master Computer program, change the value for launchpc to the computer ID of your Main Launch Computer.
  2. In the Main Launch Computer, change the value for mainpc to the computerID of the Master Computer.
  3. In each Launch Computer Hooked up to Silos, change the value for launchPC (notice the capitals) to the computerID for the Main Launch Computer
  4. In each Launch Computer Hooked Up to Silos, immediately after setting the value for launchPC, insert a line

local icbm=peripheral.wrap(side) -- replace side with "top" or "left" or whatever side the icbm peripheral is on

If this does not work for you, please post your code as you have typed it in.
Edited on 11 February 2014 - 12:06 PM
TechMasterGeneral #23
Posted 11 February 2014 - 03:25 PM
let me tell you this, i am very handy with red stone and can make almost any contraption, my island is artificial made to look natural, i have used many principals to make it secure and effective. my membership for the faction has increased by another hundred in the past week, this server can handle upto 1200 players and because of my factions ethnicity being rather… complicated i have a few enemies that are trying to get rid of me.

two weeks ago i came across a database network i liked, my friend is an ally near my island and made it to protect himself of nuclear bomb blasts. and nuclear warfare taking place. i manipulated my own networking system although i cant get the principles right but it is currently used for my missile systems and i am testing it before i give it control over my nuclear arsenal to be well not to brag but 8200 Nuclear/mass destruction missiles active, 10000 in storage for safe keeping and 2500 other missiles active. yes yes i know it is quite destructive but still, i have to protect my nation.

now my idea is that we get a few people to work on a program that consists of a database type network, not the internet but a wireless relayed network that controls membership information such as (names, homes history of members), missile networking, defense anti ballistic missile system running that uses a table inserted by a radar to control anti ballistic missiles.

i have made a simple way to launch missiles from 1 computer but i cant get another computer to tell that computer to fire the missiles.

here is what i have done,

i created the fundamental idea to control missile silos by a single basic computer.
the silos operate with a peripheral.wrap("back") so each missile system is hooked up to a listening system that will fire it when receiving the message.
the main launch computer or master launch pc fires missiles, when the id of the silo computer is inserted and entered.

now i have more then 10k silos each hooked up to a silo pc, not all are connected and many are disabled from launching for safeguards against nuclear detonation within the island.

the master launch pc is in the pentagon, yes we have a building not as large as the original structure but still it controls the national military.
in the event of wartime we do not always use our islands missile systems as we have bases all around the world on stand by with employees to fire for us.
submarines and long range bombers are also used to drop explosives or use missiles to destroy enemy facilities.

My issue is the enemy is beginning to corrupt members in these stations therefore if i make mostly the basic defense and offensive system automatic there should be no need for staff to fire nuclear missiles or any type of missile. my only issue is to connect all computers under one network which i will fix later.
currently i need to make a simple system as described above and covered by surferpup

his concept helps but the issue lies in the main launch pc. silos code i rewrote to better it, not sure if it has to be the one surferpup provided to prevent error.

here is the basics of what i need.

Master computer > Master Launch PC > SILO Launch PC
id: 30 id: 32 different ids

No plus positive + points for the idea? LOL ;)/>

I'm not exactly sure what you need… if you can PM me the server address i would like to try and get a look at what you want then i can do my best to code something for you.
surferpup #24
Posted 11 February 2014 - 05:39 PM
I'm not exactly sure what you need… if you can PM me the server address i would like to try and get a look at what you want then i can do my best to code something for you.

Having worked extensively with this user, I can tell you what he needs:
  1. He has three "systems": A Master Computer, a Main Launch Controller, and a bunch of Silo Launch Computers, each attached directly to a silo.
  2. The Master Computer can tell the Main Launch Controller over a rednet message to launch a specific silo. A silo is identified by the Computer ID of the Silo Launch Computer it is attached to.
  3. The Main Launch Controller will accept a message from the Master Computer via rednet, or from a user input of a silo ID.
  4. The Main Launch Controller is the only component that can send a message to the Silo Launch Computers. The message is sent to a specific ComputerID, and the message is "Fire!"
  5. If a Silo Launch Computer receives a rednet the message "Fire!" from the Main Launch Controller, it will launch an ICBM using immibus' peripherals
That's all he is trying to do.

The only reason the parallel API is used is so that the Main Launch Controller can listen for a message from the Master Computer and accept user input via read() at the same time.

He is having problems using pastebin because evidently it is blocked where he is.

I posted all of the code on his pastebin workaround site, as well as here.

I think he is re-typing the code and introducing errors.

I also think he is a beginning coder, and he failed to modify the IDs of the various components as is required by the code.

The code I edited and turned out for him works in the following scenario (my test setup):
  1. Drop 4 computers spaced at least one block apart. Attach a wireless modem to each on the right side.
  2. Label one Master, one Launch and the other 2 Silo1 and Silo2
  3. Place the Master Computer Code into the Master Computer as startup
  4. Place the Main Launch Controller Code into the Main Launch Computer as startup
  5. Place the Silo Launch code into each of the silo computers as startup
  6. On top of each silo computer, place a redstone lamp.
  7. Note the Computer IDs of each, and set the values for the various computer ids in the programs (launcpc in Master, mainpc in the main launch computer, and launchPC in each of the silo computers.
  8. The inputs require a silo computer ID. Make sure you know them.
  9. Replace the icbm.launch() code in the Main Launch Controller with the following code (this will toggle the redstone lamps)

rs.setOutput("top",not rs.getOutput("top"))

Restart all computers and this will work. Go over to the Master and type in the id of one of the silos and press return. It should light that silos redstone lamp. Go over to the Main Launch Controller and type in the id of the same silo. It will turn off that lamp.

If you type in the id of a computer that does not exist, it will do nothing (I think you may see a message still on the Main Launch Controller if you typed it in from the Master Computer). It is a very simple program which meets the identified needs of this beginning member.

I did not want to code way over this member's head, but at the same time, I did want him to see a few additional concepts (like manipulating cursor position and simple error checking).
Edited on 11 February 2014 - 04:44 PM
TechMasterGeneral #25
Posted 12 February 2014 - 09:43 AM
I think I see what he wants… What you did surferpup would work… but correct me if i'm wrong… looks like it could be easily manipulated from other malicious computers… anyways….
i'm sorry to hear about that… can u try github or bitbucket for putting code up there? worst case scenario you can just put it in spoilers and code brackets here
Andrew2060 #26
Posted 12 February 2014 - 09:48 AM
http://tny.cz/9d6f375f
TechMasterGeneral #27
Posted 12 February 2014 - 09:48 AM
I'm not exactly sure what you need… if you can PM me the server address i would like to try and get a look at what you want then i can do my best to code something for you.

Having worked extensively with this user, I can tell you what he needs:
  1. He has three "systems": A Master Computer, a Main Launch Controller, and a bunch of Silo Launch Computers, each attached directly to a silo.
  2. The Master Computer can tell the Main Launch Controller over a rednet message to launch a specific silo. A silo is identified by the Computer ID of the Silo Launch Computer it is attached to.
  3. The Main Launch Controller will accept a message from the Master Computer via rednet, or from a user input of a silo ID.
  4. The Main Launch Controller is the only component that can send a message to the Silo Launch Computers. The message is sent to a specific ComputerID, and the message is "Fire!"
  5. If a Silo Launch Computer receives a rednet the message "Fire!" from the Main Launch Controller, it will launch an ICBM using immibus' peripherals
That's all he is trying to do.

The only reason the parallel API is used is so that the Main Launch Controller can listen for a message from the Master Computer and accept user input via read() at the same time.

He is having problems using pastebin because evidently it is blocked where he is.

I posted all of the code on his pastebin workaround site, as well as here.

I think he is re-typing the code and introducing errors.

I also think he is a beginning coder, and he failed to modify the IDs of the various components as is required by the code.

The code I edited and turned out for him works in the following scenario (my test setup):
  1. Drop 4 computers spaced at least one block apart. Attach a wireless modem to each on the right side.
  2. Label one Master, one Launch and the other 2 Silo1 and Silo2
  3. Place the Master Computer Code into the Master Computer as startup
  4. Place the Main Launch Controller Code into the Main Launch Computer as startup
  5. Place the Silo Launch code into each of the silo computers as startup
  6. On top of each silo computer, place a redstone lamp.
  7. Note the Computer IDs of each, and set the values for the various computer ids in the programs (launcpc in Master, mainpc in the main launch computer, and launchPC in each of the silo computers.
  8. The inputs require a silo computer ID. Make sure you know them.
  9. Replace the icbm.launch() code in the Main Launch Controller with the following code (this will toggle the redstone lamps)

rs.setOutput("top",not rs.getOutput("top"))

Restart all computers and this will work. Go over to the Master and type in the id of one of the silos and press return. It should light that silos redstone lamp. Go over to the Main Launch Controller and type in the id of the same silo. It will turn off that lamp.

If you type in the id of a computer that does not exist, it will do nothing (I think you may see a message still on the Main Launch Controller if you typed it in from the Master Computer). It is a very simple program which meets the identified needs of this beginning member.

I did not want to code way over this member's head, but at the same time, I did want him to see a few additional concepts (like manipulating cursor position and simple error checking).

Why use immibis' peripherals… just wrap the launcher… (btw.. i can't really test much of this because i can't get missiles or wires to show up… stupid UE)
Andrew2060 #28
Posted 12 February 2014 - 09:50 AM
new post

rerouted my ip address twice through two VPNS… if this goes down i think i underestimated my country, well it is a nuclear power soo yeah.

anyway. i have put the code in brackets and in spoilers check out my post under GENERAL forums section
TechMasterGeneral #29
Posted 12 February 2014 - 09:50 AM

Note:
In the US all the links you've sent are available… so i that is what the problem is…
P.S.
I sent you a link to my bitbucket so you can try my code and see if it works for you
Andrew2060 #30
Posted 12 February 2014 - 09:51 AM
btw under master computer —> if input = astroreact

right under there the id of the pc is wrong, i changed my world and changed the ids in other two codes forgot this one, it does not cause the error as when they were all linked it still caused the same issue

that bitbucket is annoying and confusing, full of different things that mean nothing to me. Now it wants me to download something to view the files, so i go there and then guess what 404 error

need surferpups help
TechMasterGeneral #31
Posted 12 February 2014 - 12:13 PM
btw under master computer —> if input = astroreact

right under there the id of the pc is wrong, i changed my world and changed the ids in other two codes forgot this one, it does not cause the error as when they were all linked it still caused the same issue

that bitbucket is annoying and confusing, full of different things that mean nothing to me. Now it wants me to download something to view the files, so i go there and then guess what 404 error

need surferpups help

The files are right here… you just have to click on one and then use download at the top of the source code view

https://bitbucket.org/REXMC/ccb/src/61ef01c6e7d95a1914b3b6244c9548412a058be0/InDev?at=develop

btw under master computer —> if input = astroreact

right under there the id of the pc is wrong, i changed my world and changed the ids in other two codes forgot this one, it does not cause the error as when they were all linked it still caused the same issue

that bitbucket is annoying and confusing, full of different things that mean nothing to me. Now it wants me to download something to view the files, so i go there and then guess what 404 error

need surferpups help

The files are right here… you just have to click on one and then use download at the top of the source code view

https://bitbucket.or...nDev?at=develop

They are still full of bugs but you can use it as a concept… i'm putting up the working versions to official release soon
TechMasterGeneral #32
Posted 12 February 2014 - 03:01 PM
btw under master computer —> if input = astroreact

right under there the id of the pc is wrong, i changed my world and changed the ids in other two codes forgot this one, it does not cause the error as when they were all linked it still caused the same issue

that bitbucket is annoying and confusing, full of different things that mean nothing to me. Now it wants me to download something to view the files, so i go there and then guess what 404 error

need surferpups help

The files are right here… you just have to click on one and then use download at the top of the source code view

https://bitbucket.or...nDev?at=develop

btw under master computer —> if input = astroreact

right under there the id of the pc is wrong, i changed my world and changed the ids in other two codes forgot this one, it does not cause the error as when they were all linked it still caused the same issue

that bitbucket is annoying and confusing, full of different things that mean nothing to me. Now it wants me to download something to view the files, so i go there and then guess what 404 error

need surferpups help

The files are right here… you just have to click on one and then use download at the top of the source code view

https://bitbucket.or...nDev?at=develop

They are still full of bugs but you can use it as a concept… i'm putting up the working versions to official release soon
I've actually got the working versions up… i'll add the ability to change the password without editing the src code…
surferpup #33
Posted 12 February 2014 - 03:41 PM

I have tried out the code you have written without modifications other than what I note below. . It works for me on the "astroreact" mode – which is the only mode we have discussed.

Are you using advanced computers? I used color.

As for what occurs on the screens:

Main Launch Cntorller after receiving message from Master PC



Silo Computer (I tested it three times – hence three messages)



Again, your code works for me. I have nothing left to offer as far as programming goes.

I think I see what he wants… What you did surferpup would work… but correct me if i'm wrong… looks like it could be easily manipulated from other malicious computers… anyways….

It is incredibly easy to manipulate, although there is some minimal message checking. I avoided adding additional security because he is already having problems on this current, stripped down version.

Just to be clear, though, I tried his code under the setup I described and it worked. The only thing I modified were the computer id's and the icbm variable in the silo computers. I added the first two lines of code to substitute in for the icbm.launch() function, making it instead a redstone toggle:


icbm ={}
icbm.launch= function () rs.setOutput("top",not rs.getOutput("top")) end

The current code he pasted last night worked fine for all "silos" I created.

Given that I can get his current code to perform exactly as specified, I have little to offer here…
Edited on 12 February 2014 - 02:51 PM
surferpup #34
Posted 12 February 2014 - 03:46 PM
]

Why use immibis' peripherals… just wrap the launcher… (btw.. i can't really test much of this because i can't get missiles or wires to show up… stupid UE)


I bypassed immibis' by just testing with a redstone lamp. I can't speak to why he is doing what he is doing.
TechMasterGeneral #35
Posted 12 February 2014 - 03:57 PM
ok… i see…

do you remember who had the progress bar api?
surferpup #36
Posted 12 February 2014 - 04:21 PM
No I do not. Easy enough, though.
awsmazinggenius #37
Posted 12 February 2014 - 06:54 PM
I think that was TheOriginalBIT who made that.
theoriginalbit #38
Posted 12 February 2014 - 07:00 PM
yeah 'twas me, ages ago. actually I can now say years ago :P/>
awsmazinggenius #39
Posted 12 February 2014 - 11:49 PM
It's fairly simple to make your own loading bars anyway :)/>
theoriginalbit #40
Posted 12 February 2014 - 11:54 PM
a lot of people do struggle though sadly. either making a fake loading bar, or not being able to perform the calculations for correct rendering.
Andrew2060 #41
Posted 13 February 2014 - 06:12 AM
surferpup i tried the code, the only result i get is a white line ill upload screenshots

also, luacrawler how to install?
TechMasterGeneral #42
Posted 13 February 2014 - 08:10 AM
I was just wondering… i wasn't sure how do make one other than using the textutils.slowprint() but anyways… it was more of a question out of laziness…
awsmazinggenius #43
Posted 13 February 2014 - 09:24 AM
I was just wondering… i wasn't sure how do make one other than using the textutils.slowprint() but anyways… it was more of a question out of laziness…
Poke through the code of BIT's API.
TechMasterGeneral #44
Posted 13 February 2014 - 09:32 AM
I was just wondering… i wasn't sure how do make one other than using the textutils.slowprint() but anyways… it was more of a question out of laziness…
Poke through the code of BIT's API.
Yah… i've been doing that… i think i'm just going to add it as a dependancy so it downloads with ac-get
surferpup #45
Posted 13 February 2014 - 12:18 PM
surferpup i tried the code, the only result i get is a white line ill upload screenshots

I am assuming that your code upload is in fact the code you are using. That being said, my screenshots were of that code. Are you getting any of the text shown in my screenshots? And when you mention the white line, are you still getting the "–Master Launch computer–" information above the white line?



The message in red text on white background indicates that the Main Launch Computer (this screen) has received a message from the Master Computer. The message was "7" which indicates that the Master Computer wants the Main Launch Computer to send a message to Silo Computer with ID of 7 to "fire!" I have silo computers with IDs of 7,4, 8,9,and 10. You have silo computers of 27,24,17,28,26 and 19. This all works fine.

I told you I am using advanced computers. Are you? You could change the reference to colors.red to colors.white in the Main Launch Computer Code. That is the only color that I am using.

What version of computercraft are you using? How about Mineccraft – are you using a mod pack like dire wolf or FeedTheBeast or what?


Like I told you, I have taken the code you posted (http://tny.cz/9d6f375f), modified it slightly by changing computer IDs and substituting out the icbm calls, and it works perfectly for me.
Edited on 13 February 2014 - 11:41 AM
Andrew2060 #46
Posted 15 February 2014 - 09:22 AM
huh. its a custom modpack i designed. Using latest 1.5.4 forge universal, + latest industrial type mods, in total 92 mods. Runs smooth with the technic launcher, i disconnected it from server and cracked it. It doesnt update the packs and runs my custom tekkit main pack.
surferpup #47
Posted 15 February 2014 - 02:05 PM
Ok. But just to be clear, the code runs as I previously described. Your issue was with the programming and the code. You say that it "only shows a white line." Have you checked the things I told you to check?
Andrew2060 #48
Posted 16 February 2014 - 12:48 AM
yeah, i designed the base again. this time a clean world for testing. im still working on it ill get back to you when i know more.

upload the code your using, i might have some errors, now the error lies in the master launch pc where it ignores the signal by not showing indicators of it receiving everything i used the code from that site i uploaded it to.
surferpup #49
Posted 17 February 2014 - 05:17 PM
yeah, i designed the base again. this time a clean world for testing. im still working on it ill get back to you when i know more.

upload the code your using, i might have some errors, now the error lies in the master launch pc where it ignores the signal by not showing indicators of it receiving everything i used the code from that site i uploaded it to.

At this point I am completely confused about the state of your project and what you want me to help you with. I have already told you the changes I made to your code, and I am not sure what your problem is. Do you want me to re-post the exact code that I am using? I have used the exact code you posted with only modifications to the computer IDs and a substitute icbm.launch function – which I have already documented for you. My code works.

What is it that you need?
Edited on 17 February 2014 - 04:19 PM
Andrew2060 #50
Posted 14 March 2014 - 05:58 PM
oh i used my own thats why…