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

Hey, I just met CC, and this is Crazy, but here's a light source, so light detection maybe?

Started by Bossman201, 06 June 2012 - 11:12 PM
Bossman201 #1
Posted 07 June 2012 - 01:12 AM
Basically just thought light detection would be kind of a cool thing. Could be like a modem and place-able on computers. It could/would have it's own API or just become part of the os:

**.getLightLevel()
os.getLightLevel()

I don't know, just thought of it. Can't think of any practical applications but currently the only way to check light levels in-game (even with mods, that I know of) is using the debug info by pressing F3.

Suggestions? Ideas? More functions for the API (currently one function isn't enough to make a separate API which is why I suggested to make it part of the os)? Leave them all in the comments.
MysticT #2
Posted 07 June 2012 - 01:28 AM
This could be made in a peripheral, but if you use RP there's already light sensors, they are a little limited but it's enough for me. I have 4 light sensors (there's only 4 "levels" in RP sensors) connected to a computer through a bundled cable (each sensor has a different color cable connected to the bundle) and the computer has a program that waits for "redstone" events (when the sensors change) and then check the light level. I also made it take requests from rednet so any computer can know the light level. I use that to turn the lights on or off on my building.

Edit: I just remembered that the ccSensors peripheral has this ability, you can use that.
Pinkishu #3
Posted 07 June 2012 - 01:48 AM
This could be made in a peripheral, but if you use RP there's already light sensors, they are a little limited but it's enough for me. I have 4 light sensors (there's only 4 "levels" in RP sensors) connected to a computer through a bundled cable (each sensor has a different color cable connected to the bundle) and the computer has a program that waits for "redstone" events (when the sensors change) and then check the light level. I also made it take requests from rednet so any computer can know the light level. I use that to turn the lights on or off on my building.

Edit: I just remembered that the ccSensors peripheral has this ability, you can use that.

Sadly ccSensors still seems a bit buggy ^^ but yeah - although I'd still like to see more peripheral functionality being integrated into the core mod as peripherals
Dirkus7 #4
Posted 07 June 2012 - 10:21 PM
It could/would have it's own API or just become part of the os:

**.getLightLevel()
os.getLightLevel()
I think this should be for turtles only, so turtle.getLightLevel()
xuma202 #5
Posted 08 June 2012 - 01:07 PM
It could/would have it's own API or just become part of the os:

**.getLightLevel()
os.getLightLevel()
I think this should be for turtles only, so turtle.getLightLevel()

Also something that will go possible when there are Peripherals for turtles :)/>/>
BigSHinyToys #6
Posted 08 June 2012 - 04:26 PM
I too was thinking of this +1

using light a turtle could detect if it is underground or even its position from the light source with triangulation. we could use torches as beacons for turtles to follow. e.g. stay only in this light would direct a turtle through a lit tunnel and not into un lit caves near it.