What are you searching for?

[OC + Weather2 Remaster addon] Weather, Computers and Broadcast

[OC + Weather2 Remaster addon] Weather, Computers and Broadcast

An addon that adds compatibility between Weather2 Remastered and OpenComputers.

download 3 Downloads · favorite 0 Followers · Updated 1 week ago
Forge Technology 1.12.2

Versions

inventory_2
[Weather2 Remaster addon] Weather, Computers and Broadcast 1.0

1.0 · 1 week ago · 14.33 KB

Release download
Forge 1.12.2

About

This Mod adds a single functional block that acts as an OpenComputers peripheral. When connected to OpenComputers computers and programmed by the player, this peripheral allows players to access real-time climate and weather data provided by the Weather 2 Remastered mod. The exposed data can be used to monitor current weather conditions and to automate in-game systems based on climate information, enabling deeper integration between OpenComputers logic and dynamic weather systems.

METHODS:

F: GetWindAngle() – returns the wind direction around the block

F: GetWindSpeed() – returns the wind speed around the block (must be multiplied by 9.65 to obtain a value in MPH)

B: IsRainig() – returns whether it is raining at the block

B: IsAStorm() – returns whether there is a storm within a 712-block radius

F: GetHumidity() – returns the humidity around the block on a 0–1 scale

F: GetPressure() – returns the atmospheric pressure around the block in kPa

F: GetFarenheitTemperature() – returns the temperature around the block in °F

F: GetCelsiusTemperature() – returns the temperature around the block in °C

T: ClosestStorm() – returns a table containing data of the closest storm within a 712-block radius

S: .type – returns the storm type (TD1, EF1, C1, etc.)

F: .dist – returns the distance from the block to the storm (in blocks)

F: .angle – returns the direction angle of the storm

F: .speed – returns the movement speed of the storm

S: .name – returns the storm name (TROPICAL DEPRESSION IAN, etc.)

B: .danger – returns whether the storm is violent (increased size and health)(WIP)

B: .isDying – returns whether the storm is dissipating

I: .stage – returns the storm stage (higher stages mean stronger storms)

F: .Wspeed – returns the wind speed inside the storm (must be multiplied by 9.65 to obtain MPH)

I: .size – returns the storm size in blocks

EXAMPLE:

-- Lua example code to test the peripheral

local component = require("component")
local term = require("term")

if not component.isAvailable("WindAdapter") then
  error("Component 'WindAdapter' not found")
end

local radar = component.WindAdapter

local function boolToText(v)
  if v then return "YES" else return "NO" end
end

while true do
  -- Basic readings
  local angle = radar.GetWindAngle()
  local speed = radar.GetWindSpeed() * 9.65

  local humidity = radar.GetHumidity() * 100
  local pressure = radar.GetPressure()
  local dew = radar.GetDewpoint()

  local tempC = radar.GetCelsiusTemperature()
  local tempF = radar.GetFarenheitTemperature()

  local isRaining = radar.IsRainig()
  local isStorm = radar.IsAStorm()

  -- Clear screen before printing
  term.clear()
  term.setCursor(1,1)

  print("=== METEOROLOGICAL RADAR ===\n")

  print("Wind:")
  print("  Angle:      " .. string.format("%.2f", angle))
  print("  Speed:      " .. string.format("%.2f", speed))
  print("")

  print("Atmosphere:")
  print("  Temperature: " .. string.format("%.2f", tempC) .. " °C / " .. string.format("%.2f", tempF) .. " °F")
  print("  Humidity:    " .. string.format("%.2f", humidity) .. " %")
  print("  Pressure:    " .. string.format("%.2f", pressure))
  print("  Dew point:   " .. string.format("%.2f", dew))
  print("")

  print("Conditions:")
  print("  Raining: " .. boolToText(isRaining))
  print("  Storm detected: " .. boolToText(isStorm))
  print("")

  -- Storm processing
  if isStorm then
    local data = { radar.ClosestStorm() }

    local storm = {}
    for i = 1, #data, 2 do
      storm[data[i]] = data[i+1]
    end

    -- Filter: ignore storms named "Cloud"
    if storm.name == "Cloud" or storm.name == "" then
      print("No active storms detected.")
    else
      print(">>> CLOSEST STORM <<<")
      print("  Type:      " .. tostring(storm.type))
      print("  Name:      " .. tostring(storm.name))
      print("  Distance:  " .. string.format("%.2f", storm.dist / 1000))
      print("  Angle:     " .. string.format("%.2f", storm.angle))
      print("  Speed:     " .. string.format("%.2f", storm.speed))
      print("  Wind:      " .. string.format("%.2f", storm.Wspeed * 9.65))
      print("  Size:      " .. tostring(storm.size))
      print("  Dangerous: " .. boolToText(storm.danger))
      print("  Dying:     " .. boolToText(storm.isDying))
      print("  Stage:     " .. tostring(storm.stage))
    end
  else
    print("No active storms detected.")
  end

  os.sleep(0.1)
end
open_in_new View on Modrinth
Categories
Compatibility
Client: Required Server: Required
gavel MIT

Conversation

What are your thoughts?

Related projects

Adventure Equipment Game mechanics
Nature's Compass
Nature's Compass

by Chaosyr

Allows you to locate biomes anywhere in the world.

download 16.7M
favorite 2,133
Technology Utility
Euphoria Patches
Euphoria Patches

by SpacEagle17

Euphoria Patches is an add-on for Complementary Shaders, extending it with more optional features and settings.

download 13.2M
favorite 2,059
Game mechanics Technology Utility
Quark
Quark

by Vazkii

A Quark is a very small thing. This mod is a collection of small things...

download 12.6M
favorite 1,418
Decoration Technology Utility
Create
Create

by simibubi

Aesthetic Technology that empowers the Player

download 11.9M
favorite 4,940
lock Cookie consent

SkinMC uses cookies to provide functionality and features.