BMI Calculator

For technical issues & scripting. Dump it all here!
Post Reply
Kyrana
Posts: 578
Joined: Tue Dec 08, 2009 3:01 am

BMI Calculator

Post by Kyrana »

Name: BMI Calculater
Client:zMuD
Desc: This will calculate your BMI for you and desplay it when you press stat after your height and weight.
Script:

Code: Select all

#CLASS {BMI}
#VAR feet {0}
#VAR inches {0}
#VAR newfeet {0}
#VAR weight {0}
#VAR totalinches {0}
#VAR bmi {0}
#TRIGGER {height is %1 feet, %2 inches} {
  #MATH feet @feet+%1
  #math inches @inches+%2
  #math newfeet (12*@feet)
  #math totalinches @newfeet+@inches
  }
#TRIGGER {weight %3 pounds} {
  #MATH weight @weight+%3
  #math bmi (@weight*703)/(@totalinches*@totalinches)
  }
#TRIGGER {You are affected by:} {
  #MATH feet {0}
  #math inches {0}
  #math newfeet {0}
  #math weight {0}
  #math totalinches {0}
}
#TRIGGER {Your height is (%d) feet, (%d) inches, weight (%d) pounds} {#SUB {Your height is %1 feet, %2 inches, weight %3 pounds, BMI @bmi}
}
#CLASS 0
Example:
Your height is 5 feet, 1 inches, weight 154 pounds, BMI 29, weight carried 2.5 lbs, worn: 28.5 lbs.

Comments: This is a really usefull script while statting for a nice basher :). Also, this doesn't calculate decimal points, if your bmi is 35.8 it will say 35.
Post Reply