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

[ICBM] [Immibis Peripherals] Base Defense Pack

Started by KillaVanilla, 10 November 2012 - 04:01 PM
KillaVanilla #1
Posted 10 November 2012 - 05:01 PM
Hello all.

About two weeks ago, I decided to try and make a pack focused on physical security, rather than virtual security. I quickly got bored and dropped the project though, but I managed to churn out mostly working code.

In short, this pack has several parts:
  • Access Control (MagCard IDs)
  • Door Access/Locking
  • Silo Monitoring/Control
  • Radar Monitoring
  • Logging
That may not sound like a lot (and it really isn't), but I feel that it should be sufficent for most needs.
There's a more in-depth explanation in the readme file.

Download it from Dropbox!
tjeulink #2
Posted 31 January 2013 - 12:01 AM
wow tnx! exactly what i was looking for, cant wait to try it out so you just rightclick on a touchscreen sends the coördinates to the launcher and display the radar scans on the same screen and stuff, I don't know if this is even possible but withoud that its still pretty awesome! realy thanks!
KillaVanilla #3
Posted 01 February 2013 - 12:51 AM
wow tnx! exactly what i was looking for, cant wait to try it out so you just rightclick on a touchscreen sends the coördinates to the launcher and display the radar scans on the same screen and stuff, I don't know if this is even possible but withoud that its still pretty awesome! realy thanks!
…What? This was made before touchscreens were implemented.
zeroburn #4
Posted 01 February 2013 - 12:53 AM
I am not much of a programmer and I have been trying to get the radar component of this running, the code I am using is as provided and I get the following error on the terminal -

parallell:22: radarMaster:59: vm error: java.lang.NegativeArraySizeException

Anyone have any pointers as to what I have done/not done? All comments appreciated.
KillaVanilla #5
Posted 01 February 2013 - 01:48 AM
I am not much of a programmer and I have been trying to get the radar component of this running, the code I am using is as provided and I get the following error on the terminal -

parallell:22: radarMaster:59: vm error: java.lang.NegativeArraySizeException

Anyone have any pointers as to what I have done/not done? All comments appreciated.
Hm. Yeah, that's a bit of a problem with the printCentered function that I'm using. I'll look into it.
EDIT: Okay, the problem seems to be with the "label" at the top; how large is the screen that you're using (if any)?
EDIT2: I've added a simple fix for this problem; try redownloading.

The problem lies in how the printCentered() function calculates its offset. It subtracts the length of the input string from the total length of the screen, divides by two, and rounds down if necessary. The problem occurs if the length of the string is greater than the length of the screen; for some reason string.rep doesn't like negative numbers, and ends up crashing the entire program somehow. Anyways, it's been fixed. For those who are interested, here's the printCentered() function:

local function printCentered(input)
	local maxX = term.getSize()
	if string.len(input) <= maxX then -- perform some sanity testing on the input ( this is the fix )
	  print(string.rep(" ", math.floor((maxX - string.len(input))/2))..input) -- problem occured here if (maxX - string.len(input)) was negative
	end
end
zeroburn #6
Posted 01 February 2013 - 02:27 AM
Thanks for your fast reply and detailed explanation, I think I followed it - for reference the screen was 2x2.
KillaVanilla #7
Posted 01 February 2013 - 01:11 PM
Thanks for your fast reply and detailed explanation, I think I followed it - for reference the screen was 2x2.
Yeah, that monitor probably wouldn't have been large enough.
I don't think your monitor will be large enough to display the radar statuses; I'll see what I can do.

Okay, a small fix has been uploaded to Dropbox; it now uses smaller messages if the longer ones won't fit.
They should (emphasis on "should") work on a 2x2 monitor; 3x3 and up will probably work.

I'll see if I can apply this fix to the other monitor-centric parts. Done; as it turns out, the only other "monitor-centric" part was for silo control. It's fixed.
tjeulink #8
Posted 06 February 2013 - 04:51 AM
wow tnx! exactly what i was looking for, cant wait to try it out so you just rightclick on a touchscreen sends the coördinates to the launcher and display the radar scans on the same screen and stuff, I don't know if this is even possible but withoud that its still pretty awesome! realy thanks!
…What? This was made before touchscreens were implemented.
so it isn't possible? yea i am not really up to date with what the current release is and stuff but i thought that they are implemented in the latest release?
well i am not so up to date with that stuff, but the idea is still pretty cool ^-^
KillaVanilla #9
Posted 08 February 2013 - 12:19 PM
-snip-
so it isn't possible? yea i am not really up to date with what the current release is and stuff but i thought that they are implemented in the latest release?
well i am not so up to date with that stuff, but the idea is still pretty cool ^-^
First, check the date on the original post:
Posted 09 November 2012

Second, it is possible, but would require a bunch of work and testing and I don't really want to work on this at the moment.
Raptordactyll #10
Posted 22 April 2013 - 03:30 PM
Hi there!

I have been having some trouble working this pack, with 1.4.7. I have a voltz server working with it.

The only thing I am getting is "Install Base Defense API".

I added miscAPI to the global API folder in the server, and the computers show it under the API tab in the game.

Yet it still says to install it.

Any idea?
KillaVanilla #11
Posted 30 April 2013 - 06:52 PM
Hi there!

I have been having some trouble working this pack, with 1.4.7. I have a voltz server working with it.

The only thing I am getting is "Install Base Defense API".

I added miscAPI to the global API folder in the server, and the computers show it under the API tab in the game.

Yet it still says to install it.

Any idea?
The programs only check the root folder for the API; you'll have to install the API there for it to detect it.
teppyboy #12
Posted 23 October 2013 - 10:20 PM
Hi.

Firstly I'm sorry for bring back an old thread. I am completely new to computercraft and stuff. (the only thing I can make a computer locked door) but I was just wondering how to install this pack into my BigDig server.
I have no idea where to put it or how to find it in-game :/

Any help will be appreciated :)/>
KillaVanilla #13
Posted 25 October 2013 - 08:31 PM
Hi.

Firstly I'm sorry for bring back an old thread. I am completely new to computercraft and stuff. (the only thing I can make a computer locked door) but I was just wondering how to install this pack into my BigDig server.
I have no idea where to put it or how to find it in-game :/

Any help will be appreciated :)/>
When you download the zip file, you will find a file named "miscAPI"; this file is meant to be distributed to all of the computers in your network. You will also find a bunch of folders with various names; these folders contain the programs in the pack. The zip file will also contain a readme file; it will tell you how to configure the pack's programs.
Andrew2060 #14
Posted 08 February 2014 - 10:24 AM
how can i install this?
also killavanilla i need your help ive gone through alot of your posts none solve my issue but cover a minority of it.

i am creating a database that monitors missile silos, defense systems, radars, emailing, membership info etc here is what i have so far


os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1, 1)
username = {"Burnin_Aura", "user2", "user3"}
password = {"troll", "pass2", "pass3"}
write("Username: ")
user = read()
write("Password: ")
pass = read('*')
for i=1, #username do
if user == username[i] and pass == password[i] 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("*")
if input == "astroreact" then
rednet.open("top")
rednet.send(12, "redstone.setOutput("back", true)")
end
  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
os.reboot()
else
print("Incorrect username and password combination")
sleep(2)
os.reboot()

anyway that is what i have come up with, but i need help with transfering the command like lets say.
Master computer : sends signal "launch to Main launch computer.
Main launch pc: receives signal and requests if you wish to proceed further.
main launch pc: asks which silo to fire from.
Master computer: relays silo choice "1"
main launch pc: contacts launch pc to fire missile in silo 1
launch pc: approves and fires missile in silo 1.

Master computer : relays "locate missile origin"
main launch computer : contacts radar station computer
main Launch computer : requests the radar station computer to relay back the position of missile origin.
Radar station pc: relays back the position with x y z coordinates to launch computer.
main launch computer : Would you like to fire missile at requested coordinates?
Master computer: Yes
main launch computer: select silo, [1]nuclear, [2]nuclearcluster, [3] emp, [4] conventional, [5] shrapnel
master computer: silo 1.
Main launch computer: enter safety code 1.
master computer : code1.
main launch computer : code confirmed standby.
Main launch computer: relays x y z to launch computer for silo 1.
launch computer: firing nuclear missile from silo 1.
—nuclear missile fired at the origin of incoming missile—-

i have more ideas i need help with but ofc ill wait till this stupid post moderation expires because i joined the website yesterday but had the mod for 1 week.
KillaVanilla #15
Posted 08 February 2014 - 11:41 PM
-snip-

Determining the origin of a missile is impossible from the info that the radar gives you from what I remember.

Everything else can be done with a simple rednet listener.

-- this is the launch pc, btw
-- rednet startup stuff here, e.g:
rednet.open("my-modem-side")
while true do
    local command = rednet.receive()
    local ident,, x, y, z = string.match("(%S+)%s+(%S+)%s+(%S+)%s+(%S+)") -- split the received message by spaces, for example: "launch 15 15 15" would be split into ident="launch", x="15", y="15", z="15
    if ident == "LAUNCH" then
	    peripheral.call("my-silo-side", "setTarget", tonumber(x), tonumber(y), tonumber(z))
	    peripheral.call("my-silo-side", "launch")
    end
end
 

and then for the main launch computer:


-- code here
-- security checks, maybe?
rednet.send(silo-pc-id, "LAUNCH X Y Z") -- yes, the spaces are important
-- more code here
Andrew2060 #16
Posted 09 February 2014 - 01:21 AM
oh thanks but, i have created several computers each hooked up to its own silo. for example
computer 18 is the main launching computer that tells launch computer (19) to fire the missile
what i cant figure out is how to broadcast a command to 19 and make it do rs.output("back",true)
when i do it i get this error showing ')'

so what you're saying is that i put the rednet listener program in each launch computer? to listen to the master launch computer?
and the main launch computer ? what do i put there

see im bad with networking, but i have a database called Skynet. it works to most extents except the missile, email and all wireless systems. so im trying to get the master launch computer to be able to execute a command in the launch computer which will output a redstone signal behind it.

also for your base defence pack how do i install that?
Andrew2060 #17
Posted 09 February 2014 - 01:33 AM
if this system is prone to work or can work, it can save me the thousands of watts for the forcefield that is protecting the damn island, its been nearly a week that its been up, our airforce and airplanes cant get through the field, nor can we fire any missiles while its up

if it works i can disable the forcefield
Andrew2060 #18
Posted 09 February 2014 - 02:04 AM
im hopeless is it possible if you can kindly give me the script and i can simply copy paste it into wherever you indicate,
ill give you my launch computer ids.
silo 1 = 27
silo 2 = 24
silo 3 = 17
silo 4 = 28
silo 5 = 26
silo 6 = 19
they're jumbled because i broke alot of the computers.
main launch computer id is 18
master computer which controls database is 31 but is out of range and is not needed currently.

so what i cant understand is where to put the code and how to configure it, like you gave me two sets of code 1 for launch computer and 1 more for main launch computer. when i copy it and add the code it gives me errors like unexplained symbol in line 1 etc etc.

basically what i need is a simple program that i can install on all launch pcs through the world file and its startup file so they are ready whenever. when main launch says launch the launch pcs will launch.
Andrew2060 #19
Posted 09 February 2014 - 02:27 AM
here is the silos and pic

click link to see

http://imgur.com/lnrM921
Edited on 09 February 2014 - 01:44 AM
surferpup #20
Posted 10 February 2014 - 01:19 PM
This is answered in the question you started – please go to your question.
aloy99 #21
Posted 08 June 2014 - 03:42 AM
I have used the radarmaster code in a computer, which has a 2x3 monitor connected to the left with networking cable and modems. However, when I execute the code, I get "Invalid redirect target" at line 26. This occurs even if I place the computer right next to the monitor.

I have used the radarmaster code in a computer, which has a 2x3 monitor connected to the left with networking cable and modems. However, when I execute the code, I get "Invalid redirect target" at line 26. This occurs even if I place the computer right next to the monitor.

After manually wrapping the monitor, I get the errors "Attempted to index nil value ?" on lines
"for line in radarListHandle:lines() do"
and
"for i,v in ipairs(inTable)do"

EDIT: I do not have Immibis Peripherals, is this a must for the Radar Station program? It seems that the computer refuses to recognize the Radar Station as a peripheral at all, even in Lua. Is there no longer ComputerCraft support in 1.6.4 ICBM?
Edited on 08 June 2014 - 02:12 AM