-- Requirements:

-- Rain Detector

-- Daylight sensor

-- Bundled Cable

-- Insulated wire (different colors, minimum is 3)

c = peripheral . wrap ( "left" ) -- This wraps the chatbox, change variable and side to whatever you use.

s = peripheral . wrap ( "right" ) -- This wraps the speaker, change variable and side to whatever you use.

range = 100000

lang = "en"

name = "Jacklin" -- Name/Prefix used for the chat messages, if it doesn't work check your config!

-- Config

weatherCommand = ".weather" -- Command to get weather data, requires daylight sensor and rain detector

output1Enable = ".output1 on" -- Command to enable a redstone output. Change the command to whatever you enable.

output1Disable = ".output1 off" -- Command to disable a redstone output.

-- Create more output commands when needed

rainDetector = 1 -- Change number to fit which color insulated wire is connected to the bundled cable. Check http://computercraft.info/wiki/Colors_%28API%29 for the number for each color

dayLightDetector = 2 -- Change number to fit which color insulated wire is connected to the bundled cable

ouput1 = 4 -- Change number to fit which color insulated wire is connected to the bundled cable

while true do

e , player , msg = os . pullEvent ( "chat" )

if msg == weatherCommand then

if redstone . testBundledInput ( "back" , rainDetector ) then -- Change side to wherever the bundled cable with the rain detector is located. Note that this expects a positive output when it's raining.

c . say ( "It's raining, how depressing :(" , range , false , name )

s . speak ( "It's raining, how depressing :(" , range , lang )

elseif redstone . testBundledInput ( "back" , dayLightDetector ) then

c . say ( "The sun is shining :)!" , range , false , name )

d . speak ( "The sun is shining :)!" , range , lang )

else

c . say ( "The skies are clear!" , range , false , name )

d . speak ( "The skies are clear!" , range , lang )

end

elseif msg = output1Enable then

redstone . setBundledOutput ( "back" , colors . combine ( redstone . getBundledOutput ( "back" ) , output1 ) )

c . say ( "Output 1 Enabled!" , range , false , name ) -- Change message to whatever

d . speak ( "Output 1 Enabled!" , range , false , name )

elseif msg = output1Disabled then

redstone . setBundledOutput ( "back" , colors . subtract ( redstone . getBundledOutput ( "back" ) , output1 ) )

c . say ( "Output 1 Disabled!" , range , false , name ) -- Change message to whatever

d . speak ( "Output 1 Disabled!" , range , false , name )

end