Jump to content




ICBM Mod Help


14 replies to this topic

#1 Andrew2060

  • Members
  • 109 posts
  • LocationLos Angeles, California

Posted 20 July 2016 - 07:20 AM

Hi.

I am trying to create a massive network of slave (silo computers) and a master (launch computer).
The problem is I'd like to know what missile type is in each silo, and list them on my master PC.
I would also like to display if the missile is armed or not on the screen (local custom variable on slave).

--> [Silo] [ID] [MissileType] [Armed/Unarmed]

I can't find a way to implement this and spent a long time trying to transport it via table, but it didnt work out.


Master: (The functions that control the finding, listing and firing of silo data.)

Spoiler

Slave: (Entire Code)
http://pastebin.com/exm7HRhr'


Would appreciate some help :)

Edited by Andrew2060, 20 July 2016 - 07:21 AM.


#2 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 20 July 2016 - 11:05 AM

First: [code] [./code] tags

What have you managed to get working so far?

You could add a function on the master which takes a silo id and then messages the slave to query the current missile type. You may want to put the responses in a table.

You could do the same for arm status.

Edited by Lupus590, 20 July 2016 - 11:07 AM.


#3 Andrew2060

  • Members
  • 109 posts
  • LocationLos Angeles, California

Posted 21 July 2016 - 12:25 PM

I dont know, all my implementations wont work, there are lots of bad possibilities.

This is what I was going to do:

(Client Side):

local armed = true
local masterId
local warhead = peripheral.call("icbm", "getMissile")
local status = {warhead, armed}

if event = rednet.message and msg = "giveStatus" then
rednet.send(masterID, status)


but i dont know how to get it done server side?
Could you share the coded version of your idea?

I mean my idea was to simply make a table like : local silos = {silo#, id, warhead, armed}
and transfer it from the client to the server, via rednet message of tables.

Can i please just see how someone else has done it, ive spent hours trying to figure it out.

#4 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 21 July 2016 - 04:44 PM

As I don't have the mod there will be some psudo-code mostly where the program interacts with the peripheral.
The code I'm giving uses a version of the rednet API which was added with CC 1.6 If you have an older version of ComputerCraft installed then my example will not run. It should also be noted that I haven't tested this code and that I haven't used the protocol part of rednet very much, even when running the correct version of CC it may not work.

Master/Server/Controller
Slave/Silo

Edited by Lupus590, 21 July 2016 - 04:47 PM.


#5 Andrew2060

  • Members
  • 109 posts
  • LocationLos Angeles, California

Posted 22 July 2016 - 02:09 PM

Well the only issues I had while implementing your code were:
1. Icbm Peripheral only provides these methods (getTarget) (setTarget) (fire) (getFrequency) (getMissile).
--have to use ie peripheral.call("back", "getTarget")
2. Armed Status is a custom toggle I put in, so that as a precaution I can disarm the computer controlling the silo (slave).
3. Implementing the armed status toggle in the client, so that it can change local armStatus to local armStatus = (newState).
Thanks for the help, it gave me an idea but im still working on it.
My basic general idea was to make it so that
After logging in to the masterPC, it would print like a log, for all that are in range:
print("Welcome "..username)
print("===============================")
[Silo#] [Pc ID] [Missile Type] [Arm Status]
[Silo#1] [Pc ID] [Nuclear] [Armed]
[Silo#2] [Pc ID] [Nuclear] [Armed]
[Silo#3] [Pc ID] [Nuclear] [Disarmed]
print("==========================")
print(" [Options] ")
1. Arm Silos.
2. Disarm Silos.
3. Arm Selected Silo.
4. Disarm Selected Silo.
5. Set Target For Selected Silo.
6. Set Target For All Silos.
7. Fire Selected Silo.
8. Fire All Silos.
*Basic code*
*The Entire Idea*
I just want to know how i can get it to do these critical functions:
1. Log the missiles in the format I want without being in a locked loop that i cannot type an option in.
--For example, in my code it detects as many slaves in range, and then lets me fire them if i want to.
2. Be able to arm the missile or disarm it.
3. Be able to set the missiles targets.
4. Fire the missile or missiles.
I basically just need to print the data, but the additonal part of setting arm status and setting coordinates without firing is helpful.
(I play on a server and I dont want to be blown up, I like to code things that help people survive)
(At the same time i dont trust people in my faction either).
Pack: http://www.technicpa...ion.689897/help
ServerIP : Already in the multiplayer tab once you load it up.
Would be appreciated if someone took the time to come down and show me a few pointers with rednet slave/masters.

Edited by Andrew2060, 22 July 2016 - 02:40 PM.


#6 Andrew2060

  • Members
  • 109 posts
  • LocationLos Angeles, California

Posted 22 July 2016 - 02:40 PM

Also my skype = burnin.aura

can we chat there?

I really would like to learn the rednet api and table functions more.

#7 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 22 July 2016 - 03:05 PM

View PostAndrew2060, on 22 July 2016 - 02:40 PM, said:

I really would like to learn the rednet api and table functions more.

http://computercraft...i/Category:APIs

#8 Andrew2060

  • Members
  • 109 posts
  • LocationLos Angeles, California

Posted 22 July 2016 - 06:58 PM

I was hoping for interactive lessons but oh well,

Could you try and work with my system?

#9 Andrew2060

  • Members
  • 109 posts
  • LocationLos Angeles, California

Posted 22 July 2016 - 08:19 PM

Current Code:
Master: http://pastebin.com/HgurSf2F
Slave: http://pastebin.com/exm7HRhr


Tl:dr: To all:

My Goal: (Create a interactive list of functions/logging):
[Silo#] [SiloId] [MissileType] [CurrentCoordinates] [Armed/Disarmed]

ICBM Provides:
getMissile()
getTarget()
setTarget()
launch()

Arm status would be custom.

Anyone else know how to accomplish this in one large table?
Just the logging of that data, and a function to disarm/arm.

Edited by Andrew2060, 22 July 2016 - 08:28 PM.


#10 Andrew2060

  • Members
  • 109 posts
  • LocationLos Angeles, California

Posted 23 July 2016 - 01:03 PM

Here is what I got so far now.
http://pastebin.com/5d2FV0CF
http://pastebin.com/bVaBVfME

Edited by Andrew2060, 23 July 2016 - 01:30 PM.


#11 PossieTV

  • Members
  • 62 posts

Posted 23 July 2016 - 06:39 PM

What version of ICBM are you using? Cause I didn't know that the 1.7.10 ICBM even had support for CC

#12 Andrew2060

  • Members
  • 109 posts
  • LocationLos Angeles, California

Posted 24 July 2016 - 06:03 AM

It's not ICBM.

It's DefenseTech which is the 1.7.10 version of the 1.6.4 ICBM.
The actual ICBM mod is still in alpha phase because the mod author is a dick about it.
(Adding missiles that drop cake, yet hasn't even put in textures on the missiles at all)

DefenseTech is by Mekanism creator Aiden.

#13 PossieTV

  • Members
  • 62 posts

Posted 24 July 2016 - 08:50 PM

Ohhhh, that's good to know cause the 1.6.4 ICBM is so much better than the 1.7.10.

#14 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 25 July 2016 - 07:57 PM

View PostAndrew2060, on 23 July 2016 - 01:03 PM, said:


looks ok so far, anything in particular you need help with?

#15 Andrew2060

  • Members
  • 109 posts
  • LocationLos Angeles, California

Posted 25 July 2016 - 10:27 PM

View PostLupus590, on 25 July 2016 - 07:57 PM, said:

View PostAndrew2060, on 23 July 2016 - 01:03 PM, said:


looks ok so far, anything in particular you need help with?

Yeah,

I can't get it to print what I want.. Thats the bare minimum I would Like to see.
I mean if i can't toggle individual parts of a silo, i would appreciate it if someone could guide me to an easier path.
Such as printing the data of those individual parts in a single string.

[Sio#] [Id] [Missile] [Armed/Unarmed] [Current Target]

client:
local missile = peripheral.call("back", "getMissile")
local target = peripheral.call("back", "getTarget")
local armed = status
local status = -- true/false -- toggleable
local id = os.getComputerId()





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users