Posted 24 September 2015 - 03:35 AM
Hello, I'm having problems with this script I've made, long story short, I have 24 reactors, Id's ranging from 8 to 43, all connected to the same network, and I have a Draconic Evolution Energy Core, and a Monitor attached as well.
Problem: The script act as if no reactors are connected, it doesn't grab any info from them, or interact with them in any way; I suspect its because the way I add the reactors to an array, and even loop through ones that aren't connected.
Screenshot of monitor of issue:
http://i.imgur.com/hU3b311.png
Script (Don't hate, I've thrown this together with duct tape, LUA is by far not even close to a main language I use)
http://pastebin.com/9S60sUu5
The way I populate the array, and what I believe to be the problem, starts on line 34.
EDIT: I fixed this problem while the post was being verified by moderators. My problem was I wasn't checking if the reactors were null when adding them to the array. My script after fixing this problem: http://pastebin.com/Z3AAzbdB
Problem: The script act as if no reactors are connected, it doesn't grab any info from them, or interact with them in any way; I suspect its because the way I add the reactors to an array, and even loop through ones that aren't connected.
Screenshot of monitor of issue:
http://i.imgur.com/hU3b311.png
Script (Don't hate, I've thrown this together with duct tape, LUA is by far not even close to a main language I use)
http://pastebin.com/9S60sUu5
The way I populate the array, and what I believe to be the problem, starts on line 34.
EDIT: I fixed this problem while the post was being verified by moderators. My problem was I wasn't checking if the reactors were null when adding them to the array. My script after fixing this problem: http://pastebin.com/Z3AAzbdB
Edited on 24 September 2015 - 02:52 AM