62 posts
Location
Lost
Posted 29 November 2015 - 10:04 PM
Well since i came here with my IC2 Nuclear Control PA system Idea this site has been very helpful but now I am looking for another program to piggyback onto the Nuclear Control PA system to shut off the redstone signal to the reactor if it reaches critical, The mods i am using are the updated Nuclear control mod, the updated Peripherals++ mod, an updated versions of Project red and Computercraft
My idea:
=======
If my IC2 Experimental 5X5 Nuclear Reactor reaches 8000 degrees the remote thermal monitor shuts off the redstone signal but i want to make it more safer so basically what I want to achieve is this:
> Reactor reaches 8000o
> Nuclear Control Remote Thermal Monitoring unit Detects the temperature
> Nuclear Control remote Thermal Monitoring unit sends signal to Computercraft PA System
> PA system announces the critical condition of the reactor and activates a "Force Field System" around the reactor (Using tinkers workshop drawbridge blocks and Vanilla Minecraft blue stained glass)
> Computer system shuts off redstone signal to reactor and locks the area down
> Player uses the master password to access the reactor core wearing a Hazmat suit
> Player replaces the damaged components
> The Computercraft reactor monitor system detects the reactor is once again stable
> The new program reactivates the reactor and still monitors it and once again should it reach critical it starts the control process again
now is this even possible? know that Computercraft has an API that reads Project red cable API's as this is a core component in my Remote thermal monitoring system that shuts off the reactor anyway but i just want to be more fancy with my base and it gives me a chance to showcase Computercraft and how versatile it is and it is fast becoming one of my favourite mods
Edited on 29 November 2015 - 09:05 PM
2427 posts
Location
UK
Posted 29 November 2015 - 10:14 PM
looking at the
wiki is always a good resource when you need to know how it use an API
62 posts
Location
Lost
Posted 29 November 2015 - 10:27 PM
Thanks for the reply Lupus but my programming knowledge is less than basic; the only reason why the nuclear control programme works is thanks to the experienced programmers here on this site, I have zero experience in LUA and I am a bit too old to retain knowledge that I gain I wouldn't know where to start with using an API so if you can make any suggestions where to start with this programme idea i mean all i know is this
speaker=peripheral.wrap right
while true do
this is my limit to what i know on LUA and i can't seem to find a free course on LUA programming since it is a rareity now
1080 posts
Location
In the Matrix
Posted 29 November 2015 - 11:14 PM
Well to start, it's Lua not LUA. However, the AaP section isn't for us to really make the program. If you try for something, and mess up, we can fix it, or even give ideas on how to optimize it. But we certainly won't write it for you. (At least, those who AREN'T bored or view it as a challenge :P/>).
Give us a more step by step of what the program needs to look out for, and we can help with those. As for how it detects the temperature, how it sends the signal to the PA system, how it would detect the reactor being stable again, I have no idea.
7083 posts
Location
Tasmania (AU)
Posted 29 November 2015 - 11:42 PM
As for how it detects the temperature, how it sends the signal to the PA system, how it would detect the reactor being stable again, I have no idea.
This is the tricky bit - ComputerCraft has no specific support for IC2 built into it. IC2 might offer some mechanism for for communication between the two mods, or (more likely) OpenPeripherals will, but there aren't a lot of coders around who are familiar with how specific cross-mod compatibility works.
So Vesper, start out by plonking some IC2 reactor-type blocks next to some ComputerCraft systems, then executing
peripheral.getNames() in the Lua console. Get anything?
Edited on 29 November 2015 - 10:42 PM
2427 posts
Location
UK
Posted 30 November 2015 - 10:45 AM
A fullback would be to do everything via redstone, but then you have to connect the correct colours to the right blocks.
62 posts
Location
Lost
Posted 30 November 2015 - 11:36 AM
Guys please don't misunderstand me here, I didn't come to ask someone to make the programme for me I would like to do that myself but since i lack the knowledge in the Lua programming language it is pretty tough for me to even try this all i really need is tips on the Lua syntax and the API's of Computercraft
62 posts
Location
Lost
Posted 30 November 2015 - 11:45 AM
As for how it detects the temperature, how it sends the signal to the PA system, how it would detect the reactor being stable again, I have no idea.
This is the tricky bit - ComputerCraft has no specific support for IC2 built into it. IC2 might offer some mechanism for for communication between the two mods, or (more likely) OpenPeripherals will, but there aren't a lot of coders around who are familiar with how specific cross-mod compatibility works.
So Vesper, start out by plonking some IC2 reactor-type blocks next to some ComputerCraft systems, then executing
peripheral.getNames() in the Lua console. Get anything?
when i do that i get
function: 270d7a2d
7083 posts
Location
Tasmania (AU)
Posted 30 November 2015 - 12:09 PM
You'll need to put the brackets after it. If you get a similar result, with "table" instead of "function", then try:
for a,b in pairs(peripheral.getNames()) do print(b) end
Edited on 30 November 2015 - 12:51 PM
62 posts
Location
Lost
Posted 30 November 2015 - 01:22 PM
regarding the way the reactor stability is detected, it would be done by the Remote thermal monitor at the low end of the heat spectrum connected to a Computer that would output a rednet signal to the computer in the network that is linked to the reactor making it output a redstone signal to the reactor's redstone port
at least that is my theory
I AM clueless regarding Lua after all so i have no idea if that would work or not :P/>
Edited on 30 November 2015 - 12:54 PM
2427 posts
Location
UK
Posted 30 November 2015 - 02:17 PM