Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script to monitor weather and other environment details in various locations throughout world
- -- planning to setup multiple systems to report into this and display throughout bases or public squares
- -- something akin to a weather station, may change this setup to be minimal (1 detector, connected to one computer, w/ ender modem, maybe in a doplar like casing for looks)
- -- Version History
- -- version 0.1 3-24-25
- -- starting with monitoring of local environment info and displaying on a monitor
- -- at this stage all will be connected via networking cables
- -- would like to add other systems to this can can connect via ender or wireless modems
- ---------------------------------------------
- local detector = peripheral.wrap("environmentDetector_0")
- local mon = peripheral.wrap("advanced_monitor_0")
- mon.clear()
- -- collect local info, this will be important so that each station can send their local info to eachother
- local function getLocalInfo()
- local raining = detector.isRaining()
- end
- -- display local info, this may get changed into a separate script to display in bases / towns ( really anywhere you want to )
- function displayLocalInfo()
- mon.setTextScale(1)
- mon.setCursorPos(1,2)
- mon.write("Weather Station")
- if detector.isSunny() == true then
- mon.setCursorPos(1,3)
- mon.write("Outside:")
- mon.setCursorPos(1,4)
- -- mon.clearLine()
- mon.write("Sunny ")
- else if detector.isRaining() == true then
- mon.setCursorPos(1,3)
- mon.write("Outside:")
- mon.setCursorPos(1,4)
- -- mon.clearLine()
- mon.write("Raining ")
- else if detector.isThunder() == true then
- mon.setCursorPos(1,3)
- mon.write("Outside:")
- mon.setCursorPos(1,4)
- -- mon.clearLine()
- mon.write("Thunder Storm")
- end
- end
- end
- end
- while true do
- getLocalInfo()
- displayLocalInfo()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement