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

Modern Control, Computers/wireless/database/missiles/ic2/ICBM

Started by Andrew2060, 12 February 2014 - 06:52 AM
Andrew2060 #1
Posted 12 February 2014 - 07:52 AM
hello guys,

i have gone over many, and by that i mean many tutorials, ideas and posts over modern technology linked with computers.
i have many great ideas and all but what i lack is that experience in coding. I am a new coder but am getting better by day.
my ideas consist of, ICBM, Database linking, Defense Systems, Nuclear reactor monitoring + more.

currently i am working on the first three ideas mentioned above, a few pros are helping me accomplish the coding i need. what i have done now is to create a online icbm system, and a automated defense system using icbms working on the radar monitoring though.

im just letting you all know that when i get most of these coded ill upload it up for you all to use in your servers or survival worlds.

well let me keep this short, i play on a server that is modified to run on a technic launcher except you must install a new modpack that me and my friend made ill spare the details. the server runs factions and icbm so you can imagine the fun of it, high memory, good connection and hosting keeps nuclear weapons from crashing the server. Let me give it to you straight.
i have a large island ranging near 10k blocks, i have 6500+ Nuclear weapons and silos. my enemies are at large redoing their survival tactics since the server is in a great depression and economy has pretty much died, shops no longer sell the resources required so people have to be independent to mine their own stuff. My faction is called Skynet we have more than 200+ members and because of a prediction from the owner of the server, we stockpiled resources and therefore are the leading faction.

a little over a month ago we experienced a terrifying act, Flans Planes mod is also enabled and a new pack i dont know the name of it allowed a napalm bombing over my island, as leader i declared our nation DefCon 1 and put up a LOAD (launch on detection order) because everything is manual for offensive missiles i have come to computercraft so that it manages my everyday systems on its own.

my ideas will help my faction and will help you all hopefully, i am working on my ideas and will upload them all soon.

Missile Offense is the first one to be developed and will be released soon.


here is what i have:

1. setup 1 icbm silo (launch panel + launch pad + Support Frame)
2. place a advanced computer or regular one. this is your master computer. place it in your house or wherever. place modem on right.
3. go 64 blocks MAX to your icbm and place another pc a bit far of it, this is the launch control pc. place modem on its right side.
4 go in front of the launch panel of your silo and place a advanced computer ( this is your silo computer or rednet listener.)
5. create 3 folders in your world/computers directory.
6. create 3 plaintext files (empty) and save them to each folder.

place this in the first startup file in folder 1 in computers directory of your world in minecraft. it is my version of the database lines 224 till 242 are the useful parts for the system rest is my stuff to make it look nice. and will have purposes for my faction later.
*note its a large file*


Spoiler——————MASTER COMPUTER SCRIPT————tested it, it works fine.
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1, 1)
username = {"usernameHere", "user2", "user3"}
password = {"PasswordHere", "pass2", "pass3"}
write("Username: ")
user = read()
write("Password: ")
pass = read('*')
for i=1, #username do
if user == username and pass == password then
access = true
end
end
if access == true then
print("Logging in…")
sleep(1)
print("Welcome "..user)
print("Skynet Mainframe")
sleep(2)
print("——————")
print("Loading Mainframe.")
print("——————")
sleep(2)
print("——————")
print("Welcome to Skynet")
print("——————")
sleep(2)
print("——————")
print("OS: Skynet")
print("Id: (0)")
print("Connection: SECURE")
print("——————")
sleep(2)
print("————————-")
print("Authorized Personel only")
print("Skynet.Mainframe")
print("skynet V.1.0.3")
print("developed by AuraTech")
print("————————-")
sleep(3)print("——–Menu v1.0.0——–")
print("SKYNET SYSTEMS ONLINE")
print("28%")
sleep(1)
print("34%")
sleep(1)
print("50%")
sleep(1)
print("86%")
sleep(1)
print("100%")
sleep(2)
print("PROGRAM LOADED")
sleep(3)
print("Welcome to Skynet Missile systems")
sleep(3)
print("—————-")
print("loading..")
print("—————-")
sleep(3)
print("Missile silos occupied.")
sleep(2)
print("——–Missile Bay Status——–")
print("Status: 100% = Online")
print("Silos: Occupied")
print("Range:Maximum Capability-5250M+")
print("Module:I.C.B.M")
print("defensive systems: ON")
print("offensive systems: OFF")
print("R.L.O.A.D systems: OFF")
print("L.O.A.D systems: ON")
sleep(2)
print("—————-")
print("loading..")
print("—————-")
sleep(6)

print("——–Menu v2.0.0——–")
sleep(1)

print("[1]Authorize All Missiles")
print("[2]Test System")
print("[3]Anti-Ballistic Missile Launch")
print("[4]Lock Users")
print("[5]Power On")
print("[6]Launch Missile")
input = read("*")
if input == "1" then
print("Starting..")
sleep("3")
print("%56")
sleep(2)
print("%100")
sleep(1)
print("All Missiles Authorized Successful!")
end
if input == "2" then
print("System test initiated")
sleep(2)
print("loading program")
sleep(2)
print("Program loaded")
sleep(2)
print("Debugging")
sleep(2)
print("%25")
sleep(2)
print("%57")
sleep(2)
print("%89")
sleep(2)
print("%100")
sleep(3)
print("No Problems were present")
sleep(1)
print("All systems fully operational")
sleep(1)
print("System Status:Good")
sleep(1)
print("System Test Done")
end
if input == "3" then
print("Anti-Ballistic Missile Launch Initiated")
sleep(3)
print("Stage 1")
print("Fuel Transfer Started")
sleep(3)
print("Stage 2")
print("Initiated Core")
sleep(3)
print("Stage 3")
print("Missile Launch Successful!")

sleep(1)
print("logging out..")
end
if input == "4" then
print("Locking Users..")
print("Admin Overwrite")
sleep(2)
print("program loading")
sleep(2)
print("%2")
sleep(2)
print("%13")
sleep(2)
print("%22")
sleep(2)
print("%36")
sleep(2)
print("%48")
sleep(2)
print("%52")
sleep(2)
print("%67")
sleep(2)
print("%73")
sleep(2)
print("%82")
sleep(2)
print("%94")
sleep(1)
print("%96")
sleep(1)
print("%98")
sleep(1)
print("%99")
sleep(1)
print("%100")
sleep(2)
print("Program Loaded")
sleep(2)
print("system overwrite complete")
print("User's Status: locked")
print("Software Update v1.6.2")
sleep(2)
end
if input == "5" then
print("Power Status: On")
print("Level:547kw ")
print("Connecting to terminal…")
sleep(2)
print("Staus: Connected")
sleep(2)
print("Power Switch: *BLOCKED BY ADMIN*")
end
if input == "6" then
print("Missile Launching")
print("Status:Good")
print("Rockets READY")
print("SystemLinked")
print("Connection Status:Good")
sleep(2)
print("Please Enter Launch Key")
input = read("*")
end
if input == "astroreact" then


local launchpc = 37 – 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.")

print("*20 second until auto log out*")
sleep(2)
print("Access Code overwritten")
sleep(2)
print("Access: granted")
sleep(2)
print("Connections: Shutting off")
print("loading..")
sleep(15)
print("System Logged Out")
end
else
print("Incorrect username and password combination")
sleep(2)
os.reboot()
end


Put the next files in your folder 2 startup text via copy paste. —main launch computer—

Spoilerlocal mainpc = 30 – change this to your master computer ID should be (1)
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

PUT the next files in the third folders plain text, "startup" this is the silo pc code. can enter it in manually because its short,
open pc type edit startup then type each line in after each line press enter and type the next. when your done hit control then press S.
so it saves, click control again then click e and now type reboot. should work fine or youve done something wrong. itll say listening.

Spoiler—————–launch computers hooked up to silos———
icbm = peripheral.wrap("back")
local launchPC = 37 – change to what your local launch pc is should be id 2. – Change to Main Launch Computer ID (2)
rednet.open("top") –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 id == launchPC) then
icbm.launch()
end
end


Note there will be an update. the systems work fine when typing id 3 into the main launch computer. master pc cant do it yet. so dont use the master pc or the pc with id 1.

im working on fixing that issue currently.

just dont bother with the main computer that u first placed that is id 1. it is ineffective right now. ALSO DO NOT PLACE MORE PCS.

if you like this give it a vote up. and ill be sure to get back to anyone with issues.
id like to thank SurferPup, KillaVanilla and Michiyo + Alekso56 for the help with the coding. took me 3 days to get it all done.

also make SURE you TYPED it in CORRECTLY before criticizing, also power the damn missile panel. note place the modems ontop of the launch computer that is id 3, by shift clicking on its top. do the same with the other pcs except put it on their right sides via shift and right click.

Dont trust it with Nukes if you are on a server, trust me i went into nuclear war yesterday, thank god only 1100 silos were linked. and it was restored to the last world save, if it is hacked dont blame me…
Edited on 12 February 2014 - 07:22 AM
gollark8 #2
Posted 12 February 2014 - 12:54 PM
Nuclear reactor monitors are easy,I wrote a simple program to stop my reactor from going over 7000 heat,and broadcast the heat level to a control system.