Posted 06 August 2018 - 04:06 PM
It seams that math.floor() has stopped woking. I'm currently working on a controller for a nuclear reactor from extreme reactors and i need to get a percentage of the stored energy so i tried math.floor() but that always outputs 0.
How i get the two inputs is as follows:
r = peripheral.wrap("bottom")
cap = r.getEnergyCapacity()
strd = r.getEnergyStored()
Then i tried math.floor(strd / cap) and even added tostring() before printing but it allways outputs a 0.
Note: when i print the cap/strd they allways return their intended values so i guess I just don't know how to use math.floor()
How i get the two inputs is as follows:
r = peripheral.wrap("bottom")
cap = r.getEnergyCapacity()
strd = r.getEnergyStored()
Then i tried math.floor(strd / cap) and even added tostring() before printing but it allways outputs a 0.
Note: when i print the cap/strd they allways return their intended values so i guess I just don't know how to use math.floor()