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

OpenCCsensors Nuclear control

Started by Elgskred, 27 December 2013 - 12:36 PM
Elgskred #1
Posted 27 December 2013 - 01:36 PM
I just set up a nuclear reactor, and started tinkering with the sensor.

I'm using FTB Unleashed 1.1.7 with ComputerCraft 1.53 and OpenCCSensors 1.5.2.0

First off. When I use the sensorview program, every relevant data shows up, but I can't seem to pull out any of numbers using get.targets/get.targetDetails.

My code:

os.loadAPI("ocs/apis/sensor")
sens = sensor.wrap("right")
table = sens.getTargetDetails(6,1,0)
  for k, vi in pairs(table) do
  print(k)
  end

This returns:

maxn
foreachi
concat
remove
insert
foreach
sort
getn

I also tried to call on the parameters used in sensorview by using table.Heat/table.MaxHeat etc. but these return a single blank line.

Another odd thing, when I first set up the reactor I connected to it via OpenPeripherals, but I can only get the getStackInSlot()function to work, the others return attempt to call nil(And yes, I have quardruplechecked the code).

Any help would be greatly appreciated :)/>
Lyqyd #2
Posted 27 December 2013 - 02:39 PM
Don't call variables table. I'm not sure why it isn't overwriting the table library, but you really don't want to overwrite the table library.

Also, the coordinates need to be a string:


local details = sens.getTargetDetails("6,1,0")
Elgskred #3
Posted 27 December 2013 - 02:55 PM
Aha! I figured it was just me derping. Thanks for pointing that out Lyqyd.