Posted 16 September 2012 - 02:52 AM
Hey all,
Hoping to find the answer to my question here, felt like I've been Googling for a solution for a good part of the day.
Anyhow, I've been playing on a tekkit server with some family members and started experimenting with ComputerCraft (part of the tekkit mod).
I love it, built a great system that outputs some information to a monitor regarding my MFEs and energy consumption.
I'd love to do the same for my combustion engines but it's got my head scratching…
I have 6 combustion engines going under my base, i'd love to display their statuses on a large monitor where I spend a lot of time crafting and such.
This way I can keep an eye on whats going on.
I have 6 combustion engines, a single sensor hooked to a sensor controller with a computer and large monitor.
I was able to display any information of the MFE to the monitor with ease using almost the same code as below, but the Combustion Engines don't want to display.
I'm getting a "attempt to index?" error on line 19.
Here is my code so far:
My gut tells me my error is with the "..data.engine.energy)" part, perhaps the syntax is incorrect?
What I'm going for is something like:
Engine #1 - Energy: (number here)
Engine #1 - Heat: 30000 / 100000 - Status: Blue
Engine #2 - Energy:….
and so on.
Thanks in advance for your help.
Phillips126
Hoping to find the answer to my question here, felt like I've been Googling for a solution for a good part of the day.
Anyhow, I've been playing on a tekkit server with some family members and started experimenting with ComputerCraft (part of the tekkit mod).
I love it, built a great system that outputs some information to a monitor regarding my MFEs and energy consumption.
I'd love to do the same for my combustion engines but it's got my head scratching…
I have 6 combustion engines going under my base, i'd love to display their statuses on a large monitor where I spend a lot of time crafting and such.
This way I can keep an eye on whats going on.
I have 6 combustion engines, a single sensor hooked to a sensor controller with a computer and large monitor.
I was able to display any information of the MFE to the monitor with ease using almost the same code as below, but the Combustion Engines don't want to display.
I'm getting a "attempt to index?" error on line 19.
Here is my code so far:
while true do
sleep(1)
mon = peripheral.wrap("right")
mon.clear()
mon.setTextScale(1)
ctrl = sensors.getController()
data = sensors.getSensors(ctrl)
genSensor = data[1]
data = sensors.getSensorInfo(ctrl,genSensor)
sensors.setSensorRange(ctrl,genSensor,"10")
data = sensors.getProbes(ctrl,genSensor)
combustionengineProbe = data[2]
data = sensors.getAvailableTargetsforProbe(ctrl,genSensor,combustionengineProbe)
mon.setCursorPos(1,1) mon.write("Engine #1 Energy: " ..data.engine.energy)
mon.setCursorPos(1,2) mon.write("Engine #1 Heat: " ..data.engine.heat.." / 100000 - Status: "..data.engine.energystage)
end
My gut tells me my error is with the "..data.engine.energy)" part, perhaps the syntax is incorrect?
What I'm going for is something like:
Engine #1 - Energy: (number here)
Engine #1 - Heat: 30000 / 100000 - Status: Blue
Engine #2 - Energy:….
and so on.
Thanks in advance for your help.
Phillips126