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

Error when using peripheral

Started by Simmons928, 16 May 2014 - 06:29 PM
Simmons928 #1
Posted 16 May 2014 - 08:29 PM
Hello, I just started working with computercraft and I have run in to the fist snag that I have been unable to figure out. The reactor I am using is part of Big Reactors I am hoping to get a little help.

The below code when ran will return the following. The hex number appears to be random because even with the reactor off there is a huge change in that number.
The Reactor Temp is:
Function: <hex number>

Function reactor()
reactor - peripheral.wrap("back")
reactor.setActive (true)
print ("The Reactor Temp Is: ")
print (reactor.getCasingTemperature)
sleep(5)
reactor.setActive (false)
end
reactor()
RoD #2
Posted 16 May 2014 - 09:35 PM
i don't know very much about peripherals but the space between the function itself and the function parameters might throw an error (not sure).
Are you getting any error?
edit: lua is also case sensitive, you may try to change Function to function
Edited on 16 May 2014 - 07:36 PM
Wojbie #3
Posted 16 May 2014 - 09:37 PM

print (reactor.getCasingTemperature)

you are printing the function - you should call it

print (reactor.getCasingTemperature())

Edit - also those spaces between function names and () make me feel wiggly :D/> if it works it works but well :P/>
Edited on 16 May 2014 - 07:39 PM
RoD #4
Posted 16 May 2014 - 09:40 PM

print (reactor.getCasingTemperature)

you are printing the function - you should call it

print (reactor.getCasingTemperature())

Edit - also those spaces between function names and () make me feel wiggly :D/> if it works it works but well :P/>
off topic: yep its kinda strange XD

on topic: If none work just throw your code we will be glad to help.
Simmons928 #5
Posted 16 May 2014 - 10:09 PM

print (reactor.getCasingTemperature)

you are printing the function - you should call it

print (reactor.getCasingTemperature())

Edit - also those spaces between function names and () make me feel wiggly :D/> if it works it works but well :P/>

That did it :D/>!! YAY!!! I had been try to figure this out for a while. xD Thank you very much

Also I had type copied the code over to this the cap's was a typo, my apologizes.