Regarding mod packs: Please don't bother asking me/Cloudy/anyone for permission! You have our permission. It's MIT. If you're using it for a mod pack, I'd love to know about it, but only purely out of personal interest. You're in no way required to tell us!
>>> Click here to download current version (1.7.5) for Minecraft 1.7.10 <<<
Here are links to select older versions: 1.6.4.5
OpenCCSensors is an open source add-on mod for ComputerCraft which gives your computers the ability to retrieve information about the area around them.
Some of you may remember CCSensors, which unfortunately didn't work well for multiplayer. We've taken that concept, simplified and rewritten it from the ground up for Minecraft 1.4.6 / 1.4.7 / 1.5.1.
Further information
A wiki page with full details, example code and recipes can be found here: http://www.computerc...e=OpenCCSensors
Changelog
28 Dec 2014: Released 1.7.3, forgot to update changelog previously. Many bug fixes, update to MC 1.7.10/CC 1.65.
6th Dec 2013: Released 1.6.4.0, fixed dropped item sensor.
23rd May 2013: Released 1.5.1.0, fixed sign sensor, increased support for CC 1.53
18th May 2013: Released 0.1.5i, changed the behaviour of the sonic sensor
16th May 2013: Released 0.1.5h, fixed a compatibility issue with ars magica
15th May 2013: Released 0.1.5g, slight bug fix to sonic sensor
11th May 2013: Added Crop Sensor Card, added proximity sensor block, random bug fixes
23rd April 2013: Released 0.1.5e. IC2 fixes, other random fixes.
7th April 2013: Removed the mod-specific sensor cards. The functionality of these will be merged into other cards.
Applied energistics is supported by the inventory sensor
Industrialcraft 2 is supported by the power and machine sensor
Universal Electricity is supported by the power sensor card
Tooltips have been added into the inventory sensor card
Buildcraft not currently supported, Thaumcraft not currently supported.
17rd March 2013: Released 0.1.4c. Fixed an issue with console output. Added moon phase/angle info to the world sensor card (apparently helpful for bees)
3rd March 2013: Released 0.1.4b. Applied Energistics sensor added, renderID removed from the config, added "IsChild" to the proximity sensor, fixed issues with the Sonic Sensor.
10th Feb 2013: Released 0.1.4. Sonic sensor added, Inventory sensor can now read bee information, Issues related to Gauge lag improved, improved the information coming from buildcraft sensor. Factorisation barrel support.
23rd Jan 2013: Released 0.1.3. Support for Iron Tanks, Fixed issues related to buildcraft, Minecraft sensor improved, Proximity sensor now has pitch/yaw. Improved stability.
Example code
-- load the API
os.loadAPI("ocs/apis/sensor")
-- wrap the sensor
prox = sensor.wrap("left")
-- get the targets
local targets = prox.getTargets()
-- loop through them
for name, basicDetails in pairs(targets) do
-- print their name
print("Found entity: "..name)
-- get more details about them
local moreDetails = prox.getTargetDetails(name)
-- print their health
print("Health: "..moreDetails.Health)
print("------")
end
Media
The best way to show off what can be done using this mod is with videos:
[media]http://www.youtube.com/watch?v=i8Bv7uKkIOM[/media]
[media]http://www.youtube.com/watch?v=U4VABYwzb_k[/media]
Authors
Cloudhunter, Mikeemoo, Orwell1984, Lyqyd, Nietsnie and others who've commited along the way (and if you're a modder, please get involved!)
http://www.github.co...r/OpenCCSensors
IRC: irc.esper.net #OpenCCSensors
Controls for sensorview program:
Spoiler
Left/right arrow: select sensor sideUp/down arrow: select sensor target
Page up/down: scroll detailed view (if these do not work and you have NEI installed, make sure to close the NEI interface and try again)
S: save current detailed information
Q: quit
G: toggle graphing (requires monitor; advanced monitor suggested)
N: graph next numeric value (from detailed view list)
P: graph previous numeric value
Graph API documentation:
Spoiler
The graph API exposes one method:
graph.new(target, updateFunction, valueText, gradientTable, min, max, sharedBounds)
--target: a redirect table to output to, e.g. peripheral.wrap("top") for output to a monitor on top of the computer
--updateFunction: a function that fetches new values. e.g.
function update()
local tab = sensor.call("right", "getTargetDetails", "-2,0,-1")
return tab.Stored
end
--valueText: a string to display as the label for the value.
--gradientTable: a table of colors to be used as the gradient, from lowest to highest, e.g.
{colors.red, colors.orange, colors.yellow, colors.lime, colors.green} (default)
--min: the minimum value of the graph (defaults to 0)
--max: the maximum value of the graph (defaults to 1)
--sharedBounds: used with multi-trace graphs. If true, all traces share the same bounds (defaults to false)
To use the multi-trace feature of the graphing API, provide an integer-indexed table of update functions and value texts as the input parameters rather than a single function and string, respectively. You can also provide a table of gradient tables, a table of minimums, and a table of maximums. Each trace will use its own update function, value text, and gradient table. If sharedBounds is passed as true, they will each use their own minimum and maximum as well.
Putting it all together:
--our output target
mon = peripheral.wrap("top")
--our update function
function update()
local tab = sensor.call("right", "getTargetDetails", "-2,0,-1")
return tab.Stored
end
--our graph declaration. We use nil as the gradientTable parameter, so it will use the default red-green gradient.
graphInstance = graph.new(mon, update, "EU Storage", nil, 0, 600000)
while true do
--update the graph
graphInstance:draw()
sleep(0.5)
end