Posted 17 December 2016 - 08:38 PM
Hello. I'm fairly new to Lua and coding in general so please be gentle with me. I try to organize my code somewhat, but I know only basic methods and am sure my programs are hard on the eyes for even intermediate programmers. I'll do whatever I can to ease you're helping of me :)/> .
I'm playing a SSP 1.7.10 modpack, with CC 1.75 added, and have created multiple computers to read fluid tank and battery fill percentages, then send info (via wireless rednet) to machine controllers (another computer) in order to regulate their on/off.This part of it seems to be fine for the most part. I occasionally find a nil check that I didn't know about, fix it and keep moving on.
However the next thing I added was a computer with monitors to display graphs of these tanks/batteries. Again all via wireless modems. Anyways it will run fine for hours and hours, then occasionally it will begin crashing every time click the computer. Since this computer needs no input from the user, I just try to avoid touching it :P/>; I know what a great solution to a problem.
Next step I added a controller computer (Controller Display) using touchscreen monitors to over-ride the automated on/off of these machines, and display their state. Again, works fine for the majority of the time, but occasionally will begin to crash consistently when I try and access it.
Both crashes involved 'Ticking memory connection'. Both occur when either accessing the computer while it's running, or breaking the computer or ctrl-T the computer when it appears stuck. I'm guessing it involves my shotty use of rednet.receive, or my lack of breaks/nil checks.
Anyways any advice as to why these crashes are occuring, and how to better avoid them would be greatly appreciated.
Controller display:
http://pastebin.com/TfGXfL0k
The code is probably a mess, I've tried to simply it by using a lot of functions, so that it's easier to follow (which it may not be).
Pictures (older, but they at least show the concept):
http://imgur.com/a/U6OBQ
Crash report:
http://pastebin.com/Vea7h6Pb
(I have plenty of these so if more are needed let me know)
In general I have a lot of questions on how to better the code, like how to sync rednet messages properly, instead of waiting 10s for one message, 10s for another etc, which seems impractical when needing to receive many inputs. Anyways again thank you in advance for ANY help. This has been plaguing me for months, and now that I have this system controlling my nuclear reactors I can't stand to live with it being inconsistent anymore.
I'm playing a SSP 1.7.10 modpack, with CC 1.75 added, and have created multiple computers to read fluid tank and battery fill percentages, then send info (via wireless rednet) to machine controllers (another computer) in order to regulate their on/off.This part of it seems to be fine for the most part. I occasionally find a nil check that I didn't know about, fix it and keep moving on.
However the next thing I added was a computer with monitors to display graphs of these tanks/batteries. Again all via wireless modems. Anyways it will run fine for hours and hours, then occasionally it will begin crashing every time click the computer. Since this computer needs no input from the user, I just try to avoid touching it :P/>; I know what a great solution to a problem.
Next step I added a controller computer (Controller Display) using touchscreen monitors to over-ride the automated on/off of these machines, and display their state. Again, works fine for the majority of the time, but occasionally will begin to crash consistently when I try and access it.
Both crashes involved 'Ticking memory connection'. Both occur when either accessing the computer while it's running, or breaking the computer or ctrl-T the computer when it appears stuck. I'm guessing it involves my shotty use of rednet.receive, or my lack of breaks/nil checks.
Anyways any advice as to why these crashes are occuring, and how to better avoid them would be greatly appreciated.
Controller display:
http://pastebin.com/TfGXfL0k
The code is probably a mess, I've tried to simply it by using a lot of functions, so that it's easier to follow (which it may not be).
Pictures (older, but they at least show the concept):
http://imgur.com/a/U6OBQ
Crash report:
http://pastebin.com/Vea7h6Pb
(I have plenty of these so if more are needed let me know)
In general I have a lot of questions on how to better the code, like how to sync rednet messages properly, instead of waiting 10s for one message, 10s for another etc, which seems impractical when needing to receive many inputs. Anyways again thank you in advance for ANY help. This has been plaguing me for months, and now that I have this system controlling my nuclear reactors I can't stand to live with it being inconsistent anymore.