Chat Command Unit Conversion

Description

Use a chat command !convert to convert between various units of measurement. This works with platforms Twitch, YouTube, and Trovo.

Import Code

chatCommandUnitConversion.sb (4.5 KB)
chatCommandUnitConversion_v0.2.3-1.sb (8.5 KB)

With the v0.2.3 update, I added platform support for Twitch, YouTube, and Trovo.

Steps after import and usage

As a security measure, imported commands are disabled by default. Enable the !convert command under the Commands tab.

  • !convert 5km - will return 5 kilometers is 3.11 miles
  • Code should work whether or not there’s a space between the number and unit.
  • See description above for list of units and use their abbreviations

Usage

Use commands to do unit conversions in chat. Units supported (use the abbreviation in command):

  • Temperature
    • Celsius (c) ↔ Fahrenheit (f)
  • Length
    • Inches (in) ↔ Centimeters (cm)
    • Feet (ft) ↔ Meters (m)
  • Distance
    • Miles (mi) ↔ Kilometers (km)
  • Volume
    • Fluid Ounces (floz) ↔ Milliliters (ml)
  • Weight
    • Pounds (lbs) ↔ Kilograms (km)
2 Likes

Updated the import code for v0.2.0+

1 Like

Added a new import code for Streamer.bot v0.2.3+ and now it supports Twitch, YouTube, and Trovo.

2 Likes