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

Weather Detector?

Started by Alice, 30 July 2013 - 12:03 AM
Alice #1
Posted 30 July 2013 - 02:03 AM
I'm going to be making an interface called Plastic. It'll be off the theory of Glass. Anyone know how to detect weather, which would be useful to put into Plastic?
theoriginalbit #2
Posted 30 July 2013 - 02:12 AM
Plastic exists… Think of a new name…

Also just like the existing Plastic program the only way you will be able to do weather is with OpenCCSensors.
GopherAtl #3
Posted 30 July 2013 - 02:17 AM
not entirely true! a pair of computers with rednet modems paces just the right distance apart and pinging each other at some regular (but not too spammy-fast) intervals can tell if it's raining or not by whether they can reach each other or not.

2 computers 17 blocks apart at ground level should lose contact during a storm, when ground level rednet range is reduced to only 16.

Not that I recommend this approach, per say, just saying, it is workable.
theoriginalbit #4
Posted 30 July 2013 - 02:19 AM
2 computers 17 blocks apart at ground level should lose contact during a storm, when ground level rednet range is reduced to only 16.
Problem is that is server specific… Unlike OCS which is always correct no matter the placement (assuming the server has it installed)…
GopherAtl #5
Posted 30 July 2013 - 02:23 AM
I question your logic that something that could change based on a config setting is more server-specific than whether a completely separate add-on mod is installed or not, but it hardly matters since, as I said, I don't actually recommend this approach in any event.
jesusthekiller #6
Posted 30 July 2013 - 06:10 AM
os.time() and light sensor :)/>

Won't work during night tho…
ZagKalidor #7
Posted 30 July 2013 - 10:58 AM
Silly question but,

Where does ocs get their data from, that they put in tables?
GopherAtl #8
Posted 30 July 2013 - 11:01 AM
Java. Internal minecraft calls. peripherals are full mods, in no way constrained the way CC lua programs are constrained. More specifically, probably world.getRainStrength(), world.isRaining(), and world.isThundering()
ZagKalidor #9
Posted 30 July 2013 - 01:14 PM
So, he would have to do a mod to get those calls?
Bubba #10
Posted 30 July 2013 - 01:50 PM
So, he would have to do a mod to get those calls?

Indeed.

Also, I think that a combination of jesusthekiller's and GopherAtl solutions would be the best way to go about this. 1) Because it would be pretty neat to do that without any necessary peripherals and 2) Because why rely on something when it's not completely necessary? Sure on some servers it would be necessary, but then again on most it wouldn't.
theoriginalbit #11
Posted 30 July 2013 - 01:51 PM
So, he would have to do a mod to get those calls?
OpenCCSensors IS the mod. That then queries Minecraft for the weather information (or whatever it is programmed to scan)…

And since OP is wanting to create a Lua program he can just use OCS to get the information. No need to create his own mod.
ZagKalidor #12
Posted 30 July 2013 - 03:33 PM
And since OP is wanting to create a Lua program he can just use OCS to get the information. No need to create his own mod.

That was not the intention, it was just a question. Just for my personal understanding. Im not as deep in those things than the most of you, especialy not in java.
Alice #13
Posted 30 July 2013 - 09:39 PM
I like the light detector, the pinging idea, and everyone else's help. I am not getting OCS :P/>. Now to attempt integration with the real world as a side. And I will be renaming them/it to Transluscent Viewing Device Integrated with Minecraft World Data since Plastic is taken. Can someone think of an acronym (Sorry for the off-topic moment)?
ZagKalidor #14
Posted 31 July 2013 - 02:39 AM
Weather.com :)/>