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

Weather Station

Started by DJCorndawg, 03 June 2013 - 10:39 PM
DJCorndawg #1
Posted 04 June 2013 - 12:39 AM
First of all, let me say that I am new to CC. Have been messing with it the past few days, and find it VERY interesting. Don't have much experience in coding besides messing with my Arduino every now and then. Anyway I am needing to make :
1)Monitor that shows local (not minecraft) time
2)Monitor that shows current world conditions
- Current Time of day (morning, afternoon, evening) [from light level?]
- Current Temp [possible?]
- Current Weather (raining, cloudy, clear, etc)

I've searched for tut's making a weather station with openccsensors + CC, but didn't come up with much. I did find this code, but gave me errors. I want seperate code for the "digital clock" and "weather board". Tried to mess with parts of the code to make my own, but to no avail. Any help would be GREATLY appriciated. Look forward to learning some new things! :)/>

PS
Code I found - http://pastebin.com/F7bVB42e
KaoS #2
Posted 04 June 2013 - 02:17 AM
Could you send us the error you are getting on that code? It will help us find the issue
DJCorndawg #3
Posted 06 June 2013 - 03:48 PM
This is what I get with sensor on left, monitor on right of cpu…

startup:9: attempt to index ? (a nil value)
KaoS #4
Posted 06 June 2013 - 03:56 PM
on line 8 you have the wrong path, use ocs/apis/sensors

at least I think that's the right path…
DJCorndawg #5
Posted 06 June 2013 - 04:05 PM
Fixed that, but same error.
KaoS #6
Posted 06 June 2013 - 04:45 PM
oh I didn't look as far as I should. the api is actually sensor (not plural) so ocs/apis/sensor and as far as I can see it doesn't have a getController, getSensors or getProbes command etc. Are you thinking of the old CC sensors? in this one you wrap the sensor and then use the commands in there
DJCorndawg #7
Posted 06 June 2013 - 04:55 PM
Fixed sensors to sensor, same error. And not sure about old CC sensors, just started using this mod recently, so have been trying to understand everything.
Lyqyd #8
Posted 06 June 2013 - 05:34 PM
Yeah, the code you found isn't for OpenCCSensors, it's for a different mod entirely. The old ccSensors mod is no longer updated or supported. Try poking around the OpenCCSensors documentation and basically throw out most of that code you found since none of the sensor stuff in it will apply to OCS at all.
DJCorndawg #9
Posted 06 June 2013 - 06:40 PM
Ok thanks for the info! Does anyone have a basic time & weather script I could play with and modify?