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

[FIXED] Big Reactors Energy Production nil value

Started by DeBrates, 19 January 2016 - 10:41 PM
DeBrates #1
Posted 19 January 2016 - 11:41 PM
I'm writing a program for big reactors. I have just started off, and when attempting to get the RF/t produced from the reactor, I am getting an attempt to call nil error.

Error: reactor:21: attempt to call nil

I have defined the variable as:
energyProduction = r.getEnergyProducedLastTick()

The wiki says it returns a float, though as I have read, this should not be an error in lua.
I have tried formatting the code in every way that I sought possible, and still no dice.

Big Reactors API: http://big-reactors.com/#/api.computer

http://pastebin.com/T5NMEtcs

Any help is appreciated.
Edited on 20 January 2016 - 02:42 AM
Bomb Bloke #2
Posted 19 January 2016 - 11:54 PM
Line 21 of your paste reads:

mon.setCursorPosition(1,2)

And indeed, there's no "setCursorPosition()" function - you're after setCursorPos().
DeBrates #3
Posted 20 January 2016 - 12:05 AM
Line 21 of your paste reads:

mon.setCursorPosition(1,2)

And indeed, there's no "setCursorPosition()" function - you're after setCursorPos().
Thank you very much! I read it so many times and never caught it! I guess after a certain period I stopped thinking to look there. It works flawlessly now.