Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not term.isColor() then
- print("Advanced computer required")
- end
- local sides = peripheral.getNames()
- local sensors = {}
- for _, side in pairs(sides) do
- if peripheral.getType(side) == "warpdriveEnvironmentalSensor" then
- print("Wrapping "..side)
- table.insert(sensors, peripheral.wrap(side))
- end
- end
- local sensorsConnected = true
- if #sensors == 0 then
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- print("No environmental sensor found!")
- sensorsConnected = false
- end
- if sensorsConnected then
- local isRunning = true
- repeat
- for key, sensor in pairs(sensors) do
- local isSuccessWeather, currentWeather, secondLeft = sensor.getWeather()
- local isSuccessTime, day, hourDay, minuteDay, secondWorld = sensor.getWorldTime()
- local isSuccessTemperature, biomeTemperatureCategory, temperaturVal = sensor.getTemperature()
- local isSuccessHumidity, humidity, biomeRainfall = sensor.getHumidity()
- local isSuccessBiome, biomeName, biomeTag1, biomeTag2 = sensor.getBiome()
- local isSuccessAtmosphere, isBreathable, airConcentration = sensor.getAtmosphere()
- term.clear()
- term.setCursorPos(1, 1)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- print("World Time")
- print(" - Days: "..day)
- print(" - Time: "..hourDay..":"..minuteDay)
- print("Biome")
- print(" - Name: "..biomeName)
- if(biomeTag1 ~= nil) then
- print(" - Tag 1: "..biomeTag1)
- end
- if(biomeTag2 ~= nil) then
- print(" - Tag 2: "..biomeTag2)
- end
- print("Atmosphere")
- if(isBreathable) then
- print(" - Breathable: Yes")
- else
- print(" - Breathable: No")
- end
- print(" - Air Concentration: "..airConcentration)
- print("Weather")
- print(" - Current: "..currentWeather)
- print(" - Next Change in: "..secondLeft)
- print(" - Humidity: "..humidity)
- print(" - Rainfall: "..biomeRainfall)
- print(" - Temperatur: "..math.floor((temperaturVal*100)).."°c")
- print(" - Temp. Category: "..biomeTemperatureCategory)
- end
- os.sleep(1)
- until not isRunning
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement