SRL Archive - OSR Help

So.. progress report?


Mattie403

2012-02-19 00:45:38

So here's what I would like, more of a walkthrough of how to make a progress report. I don't wanna just copy and paste something.. If there's a tutorial somewhere, could someone link it please? Other wise, I'd like a little 1v1 tut on how to make it. I already figured out how to get the total time. Here's what I used:
Writeln('Total Time: '+MsToTime(GetTimeRunning, Time_Abbrev));

**EDIT**
I used the method of getting the xp and the beginning of the script and the end and subtracting them to find my total. Is there a better method? Otherwise, this seems to work fine and comes out exact.

Runaway

2012-02-19 00:50:45

Example:


var
Ores: integer;

...
if MineOre then Inc(Ores);
// Inc adds 1 to the value of an integer
...

WriteLn('Ores Mined: ' + IntToStr(Ores));

To get more detailed outputs for your progress report, collect more data and manipulate it however you please. :)

Mattie403

2012-02-19 00:57:46

From: Runaway
Example:


var
Ores: integer;

...
if MineOre then Inc(Ores);
// Inc adds 1 to the value of an integer
...

WriteLn('Ores Mined: ' + IntToStr(Ores));

To get more detailed outputs for your progress report, collect more data and manipulate it however you please. :)


I'm doing herblore though.. Do they have a potion made method?

Runaway

2012-02-19 01:02:58

From: Mattie403
I'm doing herblore though.. Do they have a potion made method?


Well, if you withdraw the same amount every load, you can do something like this:


const
NumPerLoad = 14;

...

if MakePotions then Inc(LoadsDone);

...

WriteLn('Potions Made: ' + IntToStr(LoadsDone * NumPerLoad));

Mattie403

2012-02-19 01:28:39

Oh alright.. Well now how do I get the XP/hour? If I do a simple (xp/totaltime) it comes out 0.

Runaway

2012-02-19 02:00:30

From: Mattie403
Oh alright.. Well now how do I get the XP/hour? If I do a simple (xp/totaltime) it comes out 0.


Ok, using the same example:


var
StartTime, TotalXp, PotsMade: integer;
const
NumPerLoad = 14;
XpPerPot = 50;

MarkTime(StartTime);
// Place this at the beginning of your script
...
if MakePotions then Inc(LoadsDone);
...
PotsMade := LoadsDone * NumPerLoad;
TotalXp := PotsMade * XpPerPot;
WriteLn('Potions Made: ' + IntToStr(PotsMade));
WriteLn('Xp / hr: ' + IntToStr((TotalXp * (1000 * 60 * 60)) / TimeFromMark(StartTime)));
// When you multiply TotalXp by an hour and divide by the time running, you're essentially multiplying the
// TotalXp by a fraction of how many hours the script has run. Note that TimeFromMark grabs a number in
// milliseconds, so you have to multiply TotalXp by an hour in milliseconds.

Mattie403

2012-02-19 02:35:08

It's now coming out with a negative number.

Caotom

2012-02-19 03:02:16

An easier way to do exp per hour would be:


var
StartExp: Int64;

procedure setup;
begin
ToggleXPBar(True);
StartExp := GetXPBarTotal;
end;

procedure proggy;
begin
writeln('You are getting ' + IntToStr(((GetXPBarTotal - StartExp) * 3600) / (GetTimeRunning / 1000)) + ' exp per hour');
Writeln('You have been doing herblore for ' + TimeRunning + '');
end;

Hope This Helped :)
~Caotom

Mattie403

2012-02-19 03:08:45

Could you explain what that does so I know?

Runaway

2012-02-19 03:10:42

From: Mattie403
Could you explain what that does so I know?


It does the same exact thing as my method. Instead of gathering the info while the script runs to get the TotalXp at the end, he uses the xp bar in the top right corner and gets the difference between the time started and the current time.

Caotom

2012-02-19 03:10:45

It turns on your exp bar and saves that number (when you start the script).
Then when you want to do the proggy it takes the current total exp minus the original saved number to get the exp earned then puts it into xp/hour.

~Caotom