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

Nuclear Control Program

Started by daelie, 28 November 2013 - 02:57 PM
daelie #1
Posted 28 November 2013 - 03:57 PM
Hey,

I've never posted something here before and sorry if this question seems a bit novice, but I'm decently new to using a lot of CC in my world, and using IC2-Exp to control a MOX reactor I am putting together a short program to control if the reactor ticks and overheats to a certain point.

I've done all the small parts of the program separately and they seemed to work completely fine, but putting them together in a loop structure kicks out an error. The pastebin for the program is this: http://pastebin.com/VTiqri3Y

When I run the program it executes fully at least once, because the output all appears on the screen, then it kicks itself out with the error:

72: attempt to call number

I know it refers to getting the heat level the second time, but not sure why it kicked out the error as running that code on it's own works perfectly in repeatedly outputting the heat level to the terminal.

The only question I'm asking is an short explanation of why it executes once and then kicks out and how to fix.
Thanks for reading.
LBPHacker #2
Posted 28 November 2013 - 04:26 PM
On line 18, you override getHeat with a number. Use a different name for the heat value.
daelie #3
Posted 28 November 2013 - 04:43 PM
Thanks for your suggestion.

I tried removing the line getHeat = 0 completely and it still kicks out the same error for the function after executing once.
daelie #4
Posted 28 November 2013 - 04:46 PM
Nevermind, I think I see what you meant now.

I changed the function name to getHeatLevel() instead of getHeat and it started working again perfectly, thanks.