bmi/bmr calc

By asakura on Aug 26, 2008

okay well it calculates your bmi and tells your if your healthy or what (text taken from nhs bmi calculator) :p and your bmr what calories you should eat a day, and dunno i was bored so i thought it hasnt been done so i know =\

menu * {
  .BMR:dialog -m BMR BMR
}
dialog BMR {
  title "BMR calculator"
  size -1 -1 125 130
  text "weight in Kg" 1, 5 7 60 20
  text "Age" 2, 43 32 18 20 
  text "height in Cm" 3, 5 57 60 20
  edit "" 4, 70 5 50 20
  edit "" 5, 70 30 50 20
  edit "" 6, 70 55 50 20
  text "BMR" 7, 40 80 20 20
  edit "" 8, 70 80 50 20, read autohs
  button "Calc" 9, 60 105 50 20
  button "Clear" 10, 5 105 50 20
}
menu * {
  .BMI:dialog -m calb calb
}
dialog calb {
  title "BMI calculator"
  size -1 -1 125 105
  text "weight in Lbs" 1, 3 7 62 20
  text "height in in" 2, 10 32 55 20 
  edit "" 4, 70 5 50 20
  edit "" 5, 70 30 50 20
  edit "" 6, 70 55 50 20, read autohs
  button "Calc" 7, 60 80 50 20
  button "Clear" 8, 5 80 50 20
  text "BMI" 9, 45 55 20 20
}
dialog bmis {
  title "BMI"
  size -1 -1 250 180
  text "" 2, 80 5 150 20
  text "" 1, 5 35 240 140
}
on *:DIALOG:bmis:init:*:{
  did -ra bmis 2 your bmi is %bmie
  if (%bmie isnum 18.4-24.9) { did -ra bmis 1 If your BMI is between 18.5 and 24.9 you're an ideal weight for your height. To maintain this, make sure you eat a healthy, well-balanced diet and keep active with regular exercise. This will lower your chances of developing heart disease, diabetes and other health problems. } 
  if (%bmie isnum 1-18.3) { did -ra bmis 1 If your BMI is less than 18.4 you are underweight for your height. Are you eating enough calories every day? People who are underweight may be at risk from health problems, including loss of bone density, malnutrition and irregular periods (women). }
  if (%bmie isnum 25-29.9) { did -ra bmis 1 If your BMI is between 25 and 29.9 you're over the ideal weight for your height. Make sure you eat a healthy, well-balanced diet and don't eat more calories than you need to. If you're trying to lose weight, get more exercise and avoid snacking and 'crash' diets. If you carry your weight around your stomach, you're 'apple-shaped', rather than 'pear-shaped'. This means you're at more risk of health problems, so you really need to get your weight down. }
  if (%bmie isnum 30-39.9) { did -ra bmis 1 If your BMI is between 30 and 39.9 you're obese. This means you're well over the ideal weight for your height. This could cause serious health problems and affect your life expectancy. Are you eating more than the recommended amount of calories per day? Are you getting enough exercise? Once you gain the confidence to start exercising regularly you'll notice a huge difference. }
  if (%bmie isnum 40-400) { did -ra bmis 1 If your BMI is over 40 you're very obese. This means you're seriously over the ideal weight for your height. Are you eating too much food that is high in fat and sugar? In order to lose this extra weight you need to make positive changes to your lifestyle and stick to them. Losing weight will help prevent severe health problems such as heart disease and diabetes, and extend your life expectancy. }
}
on *:DIALOG:BMR:sclick:*:{
  if ($did = 10) { did -r bmr 4-8 }
  if ($did = 9) && ($did(4,5,6) isnum) { var %bmr $calc(66 + (13.7 * $did(4)) + (5 * $did(6)) - (6.8 * $did(5))) | did -ra bmr 8 %bmr }
}
on *:DIALOG:calb:sclick:*:{
  if ($did = 8) { did -r calb 4-6 }
  if ($did = 7) && ($did(4,5) isnum) { var %bmi $calc($did(4) / ($did(5) * $did(5)) * 703) | set %bmie $round(%bmi,2) | did -ra calb 6 %bmie | dialog -m bmis bmis }
}

Comments

Sign in to comment.
sercan386   -  Dec 28, 2010

hehe i made a script like this too :O

 Respond  
asakura   -  Aug 26, 2008

if it posts a new 1 like b4 not my fault! :P and cheerz

 Respond  
guest598594   -  Aug 26, 2008

Missing a closing bracket. Unique idea though.

Edit: oh and

  if ($did = 10) { did -r bmr 4 | did -r bmr 5 | did -r bmr 6 | did -r bmr 7 | did -r bmr 8 }

You can do that all in one thing:

  if ($did == 10) did -r bmr 4-8

Same with

  if ($did = 8) { did -r calb 4 | did -r calb 5 | did -r calb 6 }
 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.