PDA

View Full Version : Progress Report: Explained



NKN
04-19-2012, 10:03 PM
Alright, I'm going to explain how to make a progress report, while explaining what everything does to the best of my knowledge.
Contents

What is a progress report?
How do I make a progress report?
Explaining further.
Conclusion

What is a Progress report?
Glad you asked! A progress report is used to show how/what your script is doing, or how it is preforming. This is useful for many things, especially to see how your script stacks up against others.
How do I make a progress report?
Well, let's start off with this. It's good practice to have the fewest global variables you can, which is why many people keep progress report variables in the global variables, which is where they HAVE to be.

This is what I have for my Clay mining script:

var
Ores:Integer;

It tracks the amount of ores, I add this, at the end of the bank, so after it deposits the ore, it adds to the ore count.
Ores := Ores + 28
Now, to get the progress report to show, you do something like this.

procedure Progress;
var
OrePH,XPPH,GPPH:Integer;

begin
OrePH := Round((Ore * 3600) / (GetTimeRunning / 1000));
XPPH := Round(((Ore * 5) * 3600) / (GetTimeRunning / 1000));
GPPH := Round(((Ore * 150) * 3600) / (GetTimeRunning / 1000));
ClearDebug;
Writeln('***********Power Clay**********');
Writeln('* ~By NKN~ ');
Writeln('*Ore Mined: ' + IntToStr(Ore) + ' (' + IntToStr(OrePH) + ' P/H)');
Writeln('*XP earned: ' + IntToStr(Ore * 5)+ ' (' + IntToStr(XPPH) + ' P/H)');
Writeln('*GP Made: ' + IntToStr(Ore * 275)+ ' (' + IntToStr(GPPH) + ' P/H)');
Writeln('*Total Time: ' + TimeRunning);
Writeln('********************************');
end;

Explaining Further
var
OrePH,XPPH,GPPH:Integer;
These stand for Ore Per Hour, Experience per hour, and GP per hour respectively. I declare these as local variables, because everything they need is inside that procedure.
begin
OrePH := Round((Ore * 3600) / (GetTimeRunning / 1000));
XPPH := Round(((Ore * 5//Ore * 5 because 5 Experience a ore.) * 3600) / (GetTimeRunning / 1000));
GPPH := Round(((Ore * 150// Ore * 150 because that was the price clay was around) * 3600) / (GetTimeRunning / 1000));
ClearDebug;
You should know what begin does.

Now, for the next three lines, that tells how much per hour.
It uses that formula to calculate how much per hour.
ClearDebug; just clears the debug box, so it's not cluttered.
Writeln('***********Power Clay**********');
Writeln('* ~By NKN~ ');
Writeln('*Ore Mined: ' + IntToStr(Ore) + ' (' + IntToStr(OrePH) + ' P/H)');
Writeln('*XP earned: ' + IntToStr(Ore * 5)+ ' (' + IntToStr(XPPH) + ' P/H)');
Writeln('*GP Made: ' + IntToStr(Ore * 275)+ ' (' + IntToStr(GPPH) + ' P/H)');
Writeln('*Total Time: ' + TimeRunning);
Writeln('********************************');
end;
The * symbols are not needed, I use them in my scripts to make it better looking.
Alright, the IntToStr turns an Integer(A number) into a string(letters). You can use the + button to add more thins like I did. Totaltime is easy, just add TimeRunning like so. The bottom Println is there once again to make it look better.


Conclusion
I hope you find this guide the least bit useful, and can incorporate it into your scripting! Good luck,
~NKN

ShawnjohnSJ
04-19-2012, 10:14 PM
Great tutorial. Good job.

NKN
04-19-2012, 11:09 PM
Thanks. Appreciate it.

Edgeeawaits
04-21-2012, 03:09 AM
Great Tut, Clear and easy to understand. :)

LemonHaze
04-24-2012, 03:32 PM
nice tutorial mate!

Silentcore
04-24-2012, 03:36 PM
Really great tutorial to understand. Keep this good work up.

NKN
04-24-2012, 08:10 PM
Thanks!

What else should I write a tutorial on?

Striken
04-25-2012, 04:56 AM
Just read it, and it's pretty good :)

Kobbra
11-07-2012, 11:19 AM
Thanks, this is very clear and easy to understand, just one thing though. I see you have written for the Ore/PH, XP/PH, and GP/PH to be multiplied by 3600. What is this value?

Sorry if its a nooby question.

Benny
11-07-2012, 11:25 AM
3600 is the number of seconds in an hour.

60 seconds in a minute means 60 minutes X 60 seconds gives you 3600 seconds.

Hope that helped!

litoris
11-07-2012, 11:31 AM
If you are looking into expanding this, you should definitely tell how to use SRL's built in proggy. I use it in my miner and it's very convenient.

Kobbra
11-07-2012, 11:35 AM
3600 is the number of seconds in an hour.

60 seconds in a minute means 60 minutes X 60 seconds gives you 3600 seconds.

Hope that helped!

Tyvm it sure did help me

Sabzi
11-07-2012, 11:49 AM
If you are writing a progress report tut at least include padl, padr, padz.
Just to make them fancy :P.

Bizketben
06-25-2013, 08:23 PM
Great Guide, just added this to my script with no problems. Thanks!

hash1mate
09-03-2017, 08:33 AM
Any idea how to track combat experience? Not as simple as tracking items :/

Dan the man
09-03-2017, 11:58 PM
Any idea how to track combat experience? Not as simple as tracking items :/

Here is a snippet of the way I track combat xp.


WriteLn('## HP exp: ' +IntToStr(Round((((getXPBarAmount - StartTotalExp) / 5.33) * 1.33))));
WriteLn('## Strength exp: ' +IntToStr(Round((((getXPBarAmount - StartTotalExp) / 5.33) * 4))));


Firstly, StartTotalExp is declared as a global integer variable and is assigned a value when the script starts (the current value of our xp bar near the mini map).

I then put the above functions in a progress report block, which I add to my main loop in some scripts, or call it as a function in others.

Whenever you attack, you receive 5.33 xp per damage. So if you hit a 20, you would receive approximately 106 experience on the xp bar. Now we know that 4 of this is for your desired combat stat, and 1.33 is for your hitpoints, so what I have done is:

1. Find the total experienced gained this session.
2. Divided that experience by 5.33 to find out how much damage we have done.
3. Multiplied that by 1.33 or 4, to represent our combat exp and our hp exp gains.

Hope this helps :p