Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-08-2011, 02:53 PM
PowerProNL PowerProNL is offline
Retired Zone Manager
PowerProNL's Avatar
Join Date: Feb 2008
Location: Holland
Posts: 266
PowerProNL can only hope to improve
Send a message via AIM to PowerProNL
Easy BMI Calculator with Feet/Pounds converter

Ok, I have decided to make my own BMI Converter.

The BMI Converter looks how fat u are. If your BMI is higher then 30 then you are way too fat if it's 24 you are healthy.

I tested it and it works very well!

Installation:
1. Create a weapon (name doesn't matter).
2. Copy and paste this script.
3. Give your self the weapon.
4. Fire the weapon (select the weapon and press D).
5. Have fun .

Feel free to use it anywere, share it doesn't matter. I did this for you .

PHP Code:
/*
This is made by PowerProNL. Feel free to use it, edit it. as long as I get the credits.
Don't edit this and say that you have made it because that is sad.
*/

//#CLIENTSIDE
function OpenBMI() {
  
BMI_Window1.show();
  new 
GuiWindowCtrl("BMI_Window1") {
    
profile = GuiBlueWindowProfile;
    
clientrelative = true;
    
clientextent = "386,112";

    
canmaximize = false;
    
canminimize = true;
    
canmove = true;
    
canresize = false;
    
closequery = false;
    
destroyonhide = false;
    
text = "BMI Calculator";
    
x = 364;
    
y = 372;

    new 
GuiButtonCtrl("BMI_Button1") {
      
profile = GuiBlueButtonProfile;
      
height = 25;
      
text = "Calculate BMI";
      
width = 229;
      
y = 87;
    }
    new 
GuiButtonCtrl("BMI_Button2") {
      
profile = GuiBlueButtonProfile;
      
height = 57;
      
text = "Feets to M ";
      
width = 161;
      
x = 227;
    }
    new 
GuiScrollCtrl("BMI_MultiLine1_Scroll") {
      
profile = GuiBlueScrollProfile;
      
height = 87;
      
hscrollbar = "dynamic";
      
vscrollbar = "dynamic";
      
width = 227;

      new 
GuiMLTextCtrl("BMI_MultiLine1") {
        
profile = GuiBlueMLTextProfile;
        
height = 16;
        
horizsizing = "width";
        
width = 202;
      }
    }
    new 
GuiTextEditCtrl("BMI_TextEdit1") {
      
profile = GuiBlueTextEditProfile;
      
height = 20;
      
width = 136;
      
x = 89;
      
text = "ex: 1.66";
      
y = 8;
    }
    new 
GuiTextEditCtrl("BMI_TextEdit2") {
      
profile = GuiBlueTextEditProfile;
      
height = 20;
      
width = 137;
      
x = 89;
      
text = "ex: 61";
      
y = 42;
    }
    new 
GuiTextCtrl("BMI_Text1") {
      
profile = GuiBlueTextProfile;
      
height = 20;
      
text = "Your length in m";
      
width = 84;
      
x = 3;
      
y = 7;
    }
    new 
GuiButtonCtrl("BMI_Button4") {
      
profile = GuiBlueButtonProfile;
      
height = 55;
      
text = "Pound to KG";
      
width = 159;
      
x = 227;
      
y = 57;
    }
    new 
GuiTextCtrl("BMI_Text2") {
      
profile = GuiBlueTextProfile;
      
height = 20;
      
text = "Your weight in kg";
      
width = 85;
      
x = 2;
      
y = 40;
    }
    new 
GuiTextCtrl("BMI_Text3") {
      
profile = GuiBlueTextProfile;
      
height = 20;
      
width = 8;
      
x = 2;
      
y = 64;
      
text = "BMI:";
    }
  }
}

function 
BMI_Button1.onAction() {
  
this.cm = BMI_TextEdit1.gettext();
  
this.kg = BMI_TextEdit2.gettext();
  
this.cm1 = this.cm * this.cm;
  
this.bmi = this.kg / this.cm1;
  if (
this.bmi < 18) {
    
BMI_Text3.text = "BMI: "@int(this.bmi)@" = You have a too light weight.";
  }
  if (
this.bmi > 18 && this.bmi < 25) {
    
BMI_Text3.text = "BMI: "@int(this.bmi)@" = You have a perfect weight.";
  }
  if (
this.bmi > 25 && this.bmi < 30) {
    
BMI_Text3.text = "BMI: "@int(this.bmi)@" = You are fat.";
  }
  if (
this.bmi > 30 && this.bmi < 35) {
    
BMI_Text3.text = "BMI: "@int(this.bmi)@" = You have Obesitas.";
  }
  if (
this.bmi > 35) {
    
BMI_Text3.text = "BMI: "@int(this.bmi)@" = You have Morbide Obesitas.";
  }
}

function 
BMI_Button2.onAction() {
  
this.cm = BMI_TextEdit1.gettext();
  
this.cmm = this.cm * 0.3048;
  
BMI_TextEdit1.text = this.cmm;
}

function 
BMI_Button4.onAction() {
  
this.kg = BMI_TextEdit2.gettext();
  
this.kgg = this.kg / 2.2;
  
BMI_TextEdit2.text = int(this.kgg);
}
function 
onWeaponFired() {
  if (!
BMI_Window1.visible) {
    
OpenBMI();
  } else {
    
BMI_Window1.destroy();
  }
} 

Url to video (little preview): http://www.youtube.com/watch?v=g3vcalwc_b4
__________________
Graal Mail: [email protected]
McPowerProNL, I'm loving it
Reply With Quote
  #2  
Old 01-08-2011, 06:00 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
poor video, hard see anything !
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #3  
Old 01-08-2011, 06:12 PM
maximus_asinus maximus_asinus is offline
RIP DarkCloud_PK
Join Date: Oct 2001
Location: Canada
Posts: 3,751
maximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond reputemaximus_asinus has a reputation beyond repute
interesting but since BMI is completely flawed as a measurement, I'll just say good job on the script.
__________________
Save Classic!
Reply With Quote
  #4  
Old 01-08-2011, 07:11 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Quote:
Originally Posted by maximus_asinus View Post
interesting but since BMI is completely flawed as a measurement, I'll just say good job on the script.
this.
__________________
Reply With Quote
  #5  
Old 01-08-2011, 07:20 PM
PowerProNL PowerProNL is offline
Retired Zone Manager
PowerProNL's Avatar
Join Date: Feb 2008
Location: Holland
Posts: 266
PowerProNL can only hope to improve
Send a message via AIM to PowerProNL
Thanks , It's my first time to put a script in the code gallery
__________________
Graal Mail: [email protected]
McPowerProNL, I'm loving it
Reply With Quote
  #6  
Old 01-08-2011, 07:22 PM
PowerProNL PowerProNL is offline
Retired Zone Manager
PowerProNL's Avatar
Join Date: Feb 2008
Location: Holland
Posts: 266
PowerProNL can only hope to improve
Send a message via AIM to PowerProNL
Quote:
Originally Posted by Deas_Voice View Post
poor video, hard see anything !
I know :O, I used alt+6 (screen recorder of Graal) and I saw video, and I was too lazy to make another video because I was sleepy. But yea, you can see the gui
__________________
Graal Mail: [email protected]
McPowerProNL, I'm loving it
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.