Need help from someone smarter than me.
SOLVED
Sry. Of course as so as I post this I figure it out. LOL
Th code I used:
Code:
def:=XP-StartXP;
TimeRan:=(d+(e*60)+(f*3600));
XPPerHr:=(def*3600)/timeran;
I made this XP per hr script using scar. I made it because Sometimes when I legit I'd like to know what xp/hr I'm getting. I could not find one via Goggle that dose the same task. I made every thing but for the life of me I can't seem to get my math right. I can't find the right formula to calculate the "TimeRan", the xp gained so far "def", and putting the rest together to get the xp/hr every second. This stuff used to come to me naturally. I guess I've killed to many brain cells or just to far out of practice. I need some help with the math please! Ive been trying for 2 days!! Much appreciated. Feel Free to use this script how every you all like.
P.S. You must have the xp bar open, near the minimap, and in fixed mode.
And I know there is probably a better way using reflection and stuff but I'm so outdated I wouldn't know where to begin.
The part I need help with, located in the main part of script(At the bottom):
Code:
TimeRan:=d+(e*60)+(f*3600);
XPPerHr:=(def/TimeRan/60)*60;
//XPPerHr:=def*(60/TimeRan);
The whole script:
Code:
program XP_Per_Hour;
var x,y,c,d,e,f,min,Def,XP,hr,TimeRan,XPPerhr,StartXP,Zero,One,Two,
Three,Four,Five,Six,Seven,Eight,Nine,XPPic:integer;
procedure LoadBitmaps;
begin
Zero := BitmapFromString(6, 10, 'beNpjYICA/2DAwIDg4mcgK8bUT' +
'rwIMXahawcAqyI7xQ==');
One := BitmapFromString(5, 10, 'beNr7/58BDP7/hzIgbDgXwkCWpR' +
'H3PzIAAOdXL9E=');
Two := BitmapFromString(6, 10, 'beNr7/5+BgeE/DDCAAZyBxsYjiC' +
'ZCRS6y86AAAOa8Ncs=');
Three:= BitmapFromString(5, 10, 'beNpjYACC/zAAYTPAADIbFxdZ' +
'L0HFyFxMixBGAQBGIzXL');
Four := BitmapFromString(6, 10, 'beNpjYPj//z8DKqBQhFQGGiBsB' +
'QAvZjXL');
Five := BitmapFromString(5, 10, 'beNpjYPiPARiQACYXUw2mM' +
'qwaMc1Bk0UYDgDLuTjI');
Six := BitmapFromString(6, 10, 'beNpjYICA/2DAwIDgIjOQpdAUoI' +
'kgm4PGxtSFZimmMjQnQbkALaA7xQ==');
Seven:= BitmapFromString(5, 10, 'beNpjYPiPChiQADKXnlIMAD0s' +
'Kdc=');
Eight:= BitmapFromString(6, 10, 'beNpjYICA/2DAwIDgIjOQpfAr' +
'hgM0KUxdxIhgmgziAAAe2US8');
Nine := BitmapFromString(6, 10, 'beNpjYACC/0gAwmVAAnBx/CJoG' +
'uFsNMMxdeHi4lQAAHyJO8U=');
XPPic:= BitmapFromString(15, 11, 'beNpjYPj//z8DDMDZ/2GA' +
'ARXgUowpiyyCVRemepIU49KOVRdWk7F6kKAziA8N+ijGZQJ2AAByo' +
'XSM');
end;
Procedure GetXP;
var Step,Step1,Step2,Number,Num,Count:integer; NumberFound,EndofNums:Boolean;
begin
c:=0;
EndofNums:=False;
NumberFound:=False;
Step:=0;
Step1:=496
Step2:=509
Num:=0;
count:=1;
XP:=0;
repeat
Number:=Zero;
repeat
if (FindBitmapIn(Number,x,y,Step1,53,Step2,70))Then
begin
NumberFound:=True;
end else
begin
//Writeln('Number' + inttostr(Number) + ' was not found, trying next number')
Num:=Num+1;
if (Num=1)then Number:=One;
if (Num=2)then Number:=Two;
if (Num=3)then Number:=Three;
if (Num=4)then Number:=Four;
if (Num=5)then Number:=Five;
if (Num=6)then Number:=Six;
if (Num=7)then Number:=Seven;
if (Num=8)then Number:=Eight;
if (Num=9)then Number:=Nine;
end;
until((NumberFound=True) or (num>9))
if (NumberFound=True)then
begin
Num:=0;
Step:=Step+1;
NumberFound:=False;
c:=c+1;
end else
begin
EndofNums:=True;
end;
If ((Step=3)or(Step=6))then
begin
Step1:=Step1-6;
end;
Step1:=Step1-7;
Step2:=x;
if (EndofNums=False)then
begin
XP:=XP+(count*number)
count:=Count*10
end;
until(EndofNums=True)or(c>10)
if (c>10)then
begin
WriteLn('Something went wrong, Shutting down')
TerminateScript;
end;
End;
begin
XP:=0;
LoadBitmaps;
{WriteLn('555555-Starting-555555')
Wait(1000)
WriteLn('444444-Starting-444444')
Wait(1000)
WriteLn('333333-Starting-333333')
Wait(1000)
WriteLn('222222-Starting-222222')
Wait(1000) }
WriteLn('111111-Starting-111111')
Wait(1000)
GetXP;
WriteLn(' ')
WriteLn('Current XP is ' + inttostr(XP))
StartXP:=XP;
d:=0;
e:=0;
f:=0;
repeat
min:=60;
repeat
repeat
wait(1000)
d:=d+1;
GetXP;
def:=XP-StartXP;
TimeRan:=d+(e*60)+(f*3600);
XPPerHr:=(def/TimeRan/60)*60;
//XPPerHr:=def*(60/TimeRan);
Status('Xp Per/Hr = '+inttostr(XPPerhr)+' and '+inttostr(def)+'XP Gained---Running for '+inttostr(hr)+' hr(s)/ '+inttostr(e)+' min(s)/ '+inttostr(d)+' sec(s) ')
until(d>=59)
e:=e+1
d:=0
Writeln('Xp Per/Hr = '+inttostr(XPPerhr)+' and '+inttostr(def)+'XP Gained---Running for '+inttostr(hr)+' hr(s)/ '+inttostr(e)+' min(s)/ '+inttostr(d)+' sec(s) ')
min:=min/e;
until(e>=59)
e:=0;
f:=f+1
until(false)
end.