Nadeem
2009-05-31 20:58:43
Hi,
This is I guess just for fun. I just recently started taking interest in physics and stuff, so I first wanted to apply Einstein's famous equation (E = mc^2) but guess RS just wasn't as real :P This took me a good 4 hours almost to figure out and use the correct numbers/formulas + a hint from RuneHQ's calc, to calculate energy restoration in RuneScape. Its been pretty damn accurate for me so far, testing on 2 accounts, 1 with agil close to 80ish and the other at 1. Please let me know how well it works for you :) ~ Thanks!
[HOW TO USE:]
[THE FUNCTION:]
~NS
This is I guess just for fun. I just recently started taking interest in physics and stuff, so I first wanted to apply Einstein's famous equation (E = mc^2) but guess RS just wasn't as real :P This took me a good 4 hours almost to figure out and use the correct numbers/formulas + a hint from RuneHQ's calc, to calculate energy restoration in RuneScape. Its been pretty damn accurate for me so far, testing on 2 accounts, 1 with agil close to 80ish and the other at 1. Please let me know how well it works for you :) ~ Thanks!
[HOW TO USE:]
var
E: Extended;
{ Returns seconds left to reach 100% energy. Since ALevel is defined 0, it will check your agility level for you. }
E := EnergyCalc(1, 0);
Writeln(FloatToStr(E));
{ Returns second it takes you to regenerate 1%. With your entered ALevel equaling 32 }
E := EnergyCalc(2, 32);
Writeln(FloatToStr(E));
{ Returns seconds it takes for you to regenerate 100% Energy, from 0%. Since ALevel is defined 0, it will check your agility level for you. }
E := EnergyCalc(3, 0);
Writeln(FloatToStr(E));
[THE FUNCTION:]
{×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
× Function : EnergyCalc: Extended; | v1.2
× Author : Nadeem
× Desc. : Checks and returns a complex calculation of runescape's
Energy information.
- TypeID -
1: Returns seconds left to reach 100% energy.
2: Returns second it takes you to regenerate 1%.
3: Returns seconds it takes for you to regenerate 100%
Energy, from 0%.
×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××}
function EnergyCalc(TypeID, ALevel: Integer): Extended;
var
G: string;
A: Integer;
E, M, C: Extended;
begin
if (ALevel <= 0) then
A := GetSkillInfo('Agility', True)
else
A := ALevel;
C := 3.0 * Pow(10, -4);
E := Pow(A, 2) * C + (0319 * Pow(10, -3) - 0.19) * A + 7.75;
M := (6000 div E) div 100;
case TypeID of
1 : E := M * (100 - GetMMLevels('run', G));
2 : E := M;
3 : E := M * 100;
else
E := -1.0;
end;
Result := Abs(E);
end;
~NS