Posted 29 March 2015 - 05:31 PM
Hello all! I'm a real newbie when it comes to computercraft, but my question is (I think) a pretty general LUA question. I've deployed Dragonlord's RF Control Center in my base successfully. Here are links to the release thread and the pastebin of the code:
Thread: http://www.computerc...607#entry178607
Pastebin: http://pastebin.com/TfeHE7Wy
Basically, the program monitors your capacitors and reactors, lists all of your power banks, and the amount of energy stored in each one. I put this on a computer, and it connects and displays all the information that it's supposed to. However, the max energy that it will attribute to any one capacitor is 25000000 RF.
My capacitor bank has a capacity of 294,175,000,000, so the number of significant digits on display isn't enough to be meaningful.
I have some very limited experience with code (VB, HTML, CSS) so I tried to figure this out myself, but I don't seem to be able to, though I would like to learn.
First, the number 25000000 seemed like an odd place to cut off - I would think if I maxed out the variable it would be 99999999 - so I searched the code for that number to see if a maximum was defined anywhere. No dice.
The string the program prints on screen is "Max Energy Storage: 25000000 RF" so I searched for the string "Max Energy Storage". There I found this:
totalCapacity is a dimensioned variable up above in the code, but I don't understand the dots before and after the variable in the print string. Do they define anything?
I'm sure this is a really easy question and I'm just not getting it because I'm unfamiliar with LUA syntax. If anyone can help a newbie learn something, it would be very much appreciated.
Thank you in advance!
Thread: http://www.computerc...607#entry178607
Pastebin: http://pastebin.com/TfeHE7Wy
Basically, the program monitors your capacitors and reactors, lists all of your power banks, and the amount of energy stored in each one. I put this on a computer, and it connects and displays all the information that it's supposed to. However, the max energy that it will attribute to any one capacitor is 25000000 RF.
My capacitor bank has a capacity of 294,175,000,000, so the number of significant digits on display isn't enough to be meaningful.
I have some very limited experience with code (VB, HTML, CSS) so I tried to figure this out myself, but I don't seem to be able to, though I would like to learn.
First, the number 25000000 seemed like an odd place to cut off - I would think if I maxed out the variable it would be 99999999 - so I searched the code for that number to see if a maximum was defined anywhere. No dice.
The string the program prints on screen is "Max Energy Storage: 25000000 RF" so I searched for the string "Max Energy Storage". There I found this:
print(padRight("Max Energy Storage: "..totalCapacity.." RF"))
totalCapacity is a dimensioned variable up above in the code, but I don't understand the dots before and after the variable in the print string. Do they define anything?
I'm sure this is a really easy question and I'm just not getting it because I'm unfamiliar with LUA syntax. If anyone can help a newbie learn something, it would be very much appreciated.
Thank you in advance!