This is the 2nd help topic I've posted today, sorry.
Anyways, I'm having a LOT of trouble with CCSensors. I don't understand the API at all, I'm trying to get the information for a condenser's current emc etc and what item it is making. Is this possible? If so can someone please explain how I could go about this?
CCSensors D:
Started by Sane, Dec 19 2012 04:46 PM
10 replies to this topic
#1
Posted 19 December 2012 - 04:46 PM
#2
Posted 19 December 2012 - 05:56 PM
well it is not really possible to work with the equivalent exchange module using CCsensors because it is a IC2 an other mods peripheral 
but I really can't help you with CCsensors I don't know much about it myself.
oh and hit the up bottom on the lower right corner of this comment
but I really can't help you with CCsensors I don't know much about it myself.
oh and hit the up bottom on the lower right corner of this comment
#3
Posted 19 December 2012 - 06:13 PM
If your using tekkit/technic, there is a EE Sensor Module (I assume its there if you don't use tekkit too) That can get you the current EMC Here is my code for it
As for the checking items thing, do the same process and use a Inventory Sensor Module instead..
PS. Put this at the top of your code
----------------------getEMCInformation----------------------------------- ctrl = sensors.getController() -- set the Sensor Controler's data data = sensors.getSensors(ctrl) -- Find and access the Sensor Controler, bring up all avaiable sensors. EMC = data[3] -- The EE Sensor Module is thrid on the list, pick it, make note of it. data = sensors.getProbes(ctrl,EMC) -- Bring up a list of avalable options (TargetInfo, Collector, Furnace ect.) EMCProbe = data[2] -- Pick #5 Because we are using a condesor data = sensors.getAvailableTargetsforProbe(ctrl,EMC,EMCProbe) -- Get available blocks EMCPos = data[1] -- Select the first condensor seen data = sensors.getSensorReadingAsDict(ctrl,EMC,EMCPos,EMCProbe) -- GET THE DATA!! ---------------------printEMC-------------------------- print(data.displayEnergy) -- Print the current reading to the screenIm fairly new at this so this is probably not the correct way to do it, but it works...
As for the checking items thing, do the same process and use a Inventory Sensor Module instead..
PS. Put this at the top of your code
function printDict(data) for i,v in pairs(data) do print(tostring(i).." - "..tostring(v)) end endand then use printDict(data) whenever your not sure what data[x] your supposed to pick, its helped me lots!
#4
Posted 20 December 2012 - 09:04 AM
Zamithal, on 19 December 2012 - 06:13 PM, said:
If your using tekkit/technic, there is a EE Sensor Module (I assume its there if you don't use tekkit too) That can get you the current EMC Here is my code for it
As for the checking items thing, do the same process and use a Inventory Sensor Module instead..
PS. Put this at the top of your code
----------------------getEMCInformation----------------------------------- ctrl = sensors.getController() -- set the Sensor Controler's data data = sensors.getSensors(ctrl) -- Find and access the Sensor Controler, bring up all avaiable sensors. EMC = data[3] -- The EE Sensor Module is thrid on the list, pick it, make note of it. data = sensors.getProbes(ctrl,EMC) -- Bring up a list of avalable options (TargetInfo, Collector, Furnace ect.) EMCProbe = data[2] -- Pick #5 Because we are using a condesor data = sensors.getAvailableTargetsforProbe(ctrl,EMC,EMCProbe) -- Get available blocks EMCPos = data[1] -- Select the first condensor seen data = sensors.getSensorReadingAsDict(ctrl,EMC,EMCPos,EMCProbe) -- GET THE DATA!! ---------------------printEMC-------------------------- print(data.displayEnergy) -- Print the current reading to the screenIm fairly new at this so this is probably not the correct way to do it, but it works...
As for the checking items thing, do the same process and use a Inventory Sensor Module instead..
PS. Put this at the top of your code
function printDict(data) for i,v in pairs(data) do print(tostring(i).." - "..tostring(v)) end endand then use printDict(data) whenever your not sure what data[x] your supposed to pick, its helped me lots!
Alright, thanks and cheers.
#6
Posted 20 December 2012 - 09:28 AM
sorry i thought i helped
but i did clear somethings in a way for him/her
but i did clear somethings in a way for him/her
#7
Posted 20 December 2012 - 11:13 AM
cmurtheepic, on 20 December 2012 - 09:28 AM, said:
sorry i thought i helped
but i did clear somethings in a way for him/her
but i did clear somethings in a way for him/her
You didn't help, and you didn't clear anything up. You were completely wrong. Don't try to help if you don't know anything about the solution.
#8
Posted 20 December 2012 - 12:51 PM
Topic update, what does he mean the ee sensor module is third on the list. Third on what list? I'm trying to do this with inventory module right now and I don't understand what he means.
ctrl = sensors.getController() -- set the Sensor Controler's data data = sensors.getSensors(ctrl) -- Find and access the Sensor Controler, bring up all avaiable sensors. EMC = data[3] -- The EE Sensor Module is thrid on the list, pick it, make note of it. data = sensors.getProbes(ctrl,EMC) -- Bring up a list of avalable options (TargetInfo, Collector, Furnace ect.) EMCProbe = data[2] -- Pick #5 Because we are using a condesor data = sensors.getAvailableTargetsforProbe(ctrl,EMC,EMCProbe) -- Get available blocks EMCPos = data[1] -- Select the first condensor seen data = sensors.getSensorReadingAsDict(ctrl,EMC,EMCPos,EMCProbe) -- GET THE DATA!! print(data.displayEnergy) -- Print the current reading to the screen
#9
Posted 20 December 2012 - 01:05 PM
It means that whoever wrote that code had at least three sensors attached to their sensor controller, and their EE sensor was the third one.
#10
Posted 20 December 2012 - 02:12 PM
Another topic update, whenever I use this code it doesn't print anything:
ctrl = sensors.getController() -- set the Sensor Controler's data data = sensors.getSensors(ctrl) SENSOR = data[1] data = sensors.getProbes(ctrl,SENSOR) SENSProbe = data[2] data = sensors.getAvailableTargetsforProbe(ctrl,SENSOR,SENSProbe) SENSPos = data[1] data = sensors.getSensorReadingAsDict(ctrl,SENSOR,SENSPos,SENSProbe) print(data.TotalItems)
#11
Posted 20 December 2012 - 09:54 PM
Copy pasting that into my game, it prints fine, the only thing different in mine is I create the printDict function first, you sure its not printing anything?
function printDict(data) for i,v in pairs(data) do print(tostring(i).." - "..tostring(v)) end end ctrl = sensors.getController() -- set the Sensor Controler's data data = sensors.getSensors(ctrl) SENSOR = data[1] data = sensors.getProbes(ctrl,SENSOR) SENSProbe = data[2] data = sensors.getAvailableTargetsforProbe(ctrl,SENSOR,SENSProbe) SENSPos = data[1] data = sensors.getSensorReadingAsDict(ctrl,SENSOR,SENSPos,SENSProbe) print(data.TotalItems)Thats my code that I just tested, prints 0 items for an empty chest.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











