Body Mass Index

By sercan386 on Mar 28, 2009

This script calculates your body mass index. That shows if your weight is just fine, too much, or too low. Type !BMI to start. Weight in kilogrammes, length in meters.

on *:text:*:#: {
  if ($1 == !bmi) {
    if (!$3) || ($2 !isnum) || ($3 !isnum) { 
      .notice $nick Syntax: !bmi <weight> <length>
      .notice $nick !BMI calculates your Body-Mass-Index (BMI) to see if you're underweight, overweight, or have a normal weight.
      .notice $nick Please insert your weight in kilograms and your length in metres.
      .halt
    }
    set %bmi $calc($2 / ($3 ^2))
    if (16.5 > [ %bmi ]) {
      .msg # $nick $+ 's BMI is %bmi $+ . He/she is severely underweight.
      halt
    }
    if (18.5 > [ %bmi ]) {
      .msg # $nick $+ 's BMI is %bmi $+ . He/she is underweight.
      halt
    }
    if (25 > [ %bmi ]) {
      .msg # $nick $+ 's BMI is %bmi $+ . He/she has a normal weight.
      halt
    }
    if (30 > [ %bmi ]) {
      .msg # $nick $+ 's BMI is %bmi $+ . He/she is overweight.
      halt
    }
    if (35 > [ %bmi ]) {
      .msg # $nick $+ 's BMI is %bmi $+ . He/she is in obese class 1.
      halt
    }
    if (40 > [ %bmi ]) {
      .msg # $nick $+ 's BMI is %bmi $+ . He/she is obese class 2.
      halt
    }
    if (40 < [ %bmi ]) {
      .msg # $nick $+ 's BMI is %bmi $+ . He/she is in obese class 3.
      halt
    }
  }
}

Comments

Sign in to comment.
k0ji   -  Jul 24, 2009

how to use insert length in centimeter. i live in asia using centimeter.
173 cm = 1.73 m ???

 Respond  
zak123   -  Mar 29, 2009

Yes, he does mean height.

 Respond  
Aucun50   -  Mar 28, 2009

Probably i dumb question but by length do you mean height of the person or?

 Respond  
sercan386   -  Mar 28, 2009

A good addition to Punktured's Death Clock.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.