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:
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.
Now, to get the progress report to show, you do something like this.
Simba Code:
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
Simba Code:
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.
Simba Code:
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.
Simba Code:
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