This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
kk258966's profile picture

power display coding question

Started by kk258966, 16 January 2015 - 06:08 AM
kk258966 #1
Posted 16 January 2015 - 07:08 AM
iv seen direwolf20 posted a big reactor a few days ago
https://www.youtube.com/watch?v=l7ZwSFVYITU
im using an older version of big reactor so i couldn't use the code
but i wanted to use the power display

I know nothing about coding LUA
spent some time trying to change the code to what i want
but didn't work
wonder if anyone can help me and tell me what i need to do
this is the code direwolf20 wrote

http://pastebin.com/XBbMUYNn
http://pastebin.com/XBbMUYNn

and this is what i tried to do
http://pastebin.com/ua6dpZRb
safetyscissors #2
Posted 16 January 2015 - 05:12 PM
Hi, it would help us to know how its not working. If there is specific errors or what action isnt working right.
Just looking briefly, assuming everything works, except the numbers dont update, I'd guess the problem is here.

   tempEnergy = p.getEnergyStored()

   sleep(0.1)
   energy = (p.getEnergyStored()-tempEnergy)/2
Just wondering if its expected to change a lot in .1 seconds. Or would return near zero values?