Jump to content




Thermal Expansion - Bigs Reactor


  • You cannot reply to this topic
1 reply to this topic

#1 LordSoft

  • New Members
  • 1 posts

Posted 29 March 2015 - 10:48 AM

Hi

I use ComputerCraft to enable or disable my Reactor when my energy is full but there is always a problem.

The Error :reactor:9: attempt to perform arithmetic__div on nil and nil
The Program: http://pastebin.com/npnHPn02

waiting for a answer,
LordSoft

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 29 March 2015 - 10:20 PM

Quite simply, on the ninth line you're trying to divide an undefined value by an undefined value. The Lua interpreter therefore goes "huh?" and errors at you.

  level = cellOneEnergyStored/CellOneMaxEnergy*100

"cellOneEnergyStored" is never referenced anywhere else in the script. You probably meant to use something along the lines of cellOne.getEnergyStored(), or whatever the function is...

"CellOneMaxEnergy" is likely supposed to refer to "cellOneMaxEnergy", which you defined on line 5. Capitalisation matters, and so the two different labels are not the same.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users