SRL Archive - OSR Help

Progress report?


Hexless

2013-02-12 02:47:52

Is it possible for someone to help/make me a progress report that said how many logs and how much xp ive got when i stop the script?(and maybe even say how many levels i've got aswell?)
Thanks
heres the script it would be used for
[ATTACH]19139[/ATTACH]

Runehack123

2013-02-12 05:00:33

Made this for you…


Procedure WoodcuttingProgressReport;
var
Totalxp, XPhour, LogsHour: Integer;
Begin
If Not(LoggedIn) Then
Exit;
ClearDebug;
Totalxp := (GetXPBarTotal - InitialXP);
XPhour := Round((Totalxp)/(GetTimeRunning/3600000.0));
LogsHour := Round((LogLoad*28)/(GetTimeRunning/3600000.0));
Writeln('*****************************************************************************');
Writeln('Time Running: ' + TimeRunning);
Writeln('Est. Logs Total: ' + IntToStr(LogLoad*28));
Writeln('Est. Total Experience: ' + IntToStr(Totalxp));
Writeln('Est. Experience/Hour: ' + IntToStr(XPhour));
Writeln('Est. Logs/Hour: ' + IntToStr(LogsHour));
Writeln('*****************************************************************************');

Call on it everytime you finished chopping a whole inventory and also Inc(LogLoad) <<Declare as global Int variable everytime you finished chopping a whole inventory. :p

Hexless

2013-02-12 10:08:37

From: Runehack123
Made this for you…


Procedure WoodcuttingProgressReport;
var
Totalxp, XPhour, LogsHour: Integer;
Begin
If Not(LoggedIn) Then
Exit;
ClearDebug;
Totalxp := (GetXPBarTotal - InitialXP);
XPhour := Round((Totalxp)/(GetTimeRunning/3600000.0));
LogsHour := Round((LogLoad*28)/(GetTimeRunning/3600000.0));
Writeln('*****************************************************************************');
Writeln('Time Running: ' + TimeRunning);
Writeln('Est. Logs Total: ' + IntToStr(LogLoad*28));
Writeln('Est. Total Experience: ' + IntToStr(Totalxp));
Writeln('Est. Experience/Hour: ' + IntToStr(XPhour));
Writeln('Est. Logs/Hour: ' + IntToStr(LogsHour));
Writeln('*****************************************************************************');

Call on it everytime you finished chopping a whole inventory and also Inc(LogLoad) <<Declare as global Int variable everytime you finished chopping a whole inventory. :p


Thank you so much :)

Hexless

2013-02-12 10:18:14

From: Runehack123
Made this for you…


Procedure WoodcuttingProgressReport;
var
Totalxp, XPhour, LogsHour: Integer;
Begin
If Not(LoggedIn) Then
Exit;
ClearDebug;
Totalxp := (GetXPBarTotal - InitialXP);
XPhour := Round((Totalxp)/(GetTimeRunning/3600000.0));
LogsHour := Round((LogLoad*28)/(GetTimeRunning/3600000.0));
Writeln('*****************************************************************************');
Writeln('Time Running: ' + TimeRunning);
Writeln('Est. Logs Total: ' + IntToStr(LogLoad*28));
Writeln('Est. Total Experience: ' + IntToStr(Totalxp));
Writeln('Est. Experience/Hour: ' + IntToStr(XPhour));
Writeln('Est. Logs/Hour: ' + IntToStr(LogsHour));
Writeln('*****************************************************************************');

Call on it everytime you finished chopping a whole inventory and also Inc(LogLoad) <<Declare as global Int variable everytime you finished chopping a whole inventory. :p


Thanks so much and also how do i declare it as a global int variable? (Im kinda new to this)

Wardancer

2013-02-12 11:50:50

Declaring a global variable is the same as declaring a local variable, except "outside" the usual functions. Let's say your first function is called ILoveNarwhals, it'd look like:


var
x, y : Integer //There are global variables
function ILoveNarwhals : Boolean;
var
t : Integer //Local variables
begin
Result := IHaveABrain; //Only someone without a brain could not love narwhals.
end;

Runehack123

2013-02-13 05:34:40

@Hexless just declare them at the top of your script after your $define includes so you've got them all together.
Global variable: Can be used for ALL functions/procedures of your script.
Local variable: Can be used only for the function/procedure it is declared in.

Now you might think that global variables are the easier option - but avoid them if you can!
http://c2.com/cgi/wiki?GlobalVariablesAreBad
Just remember,
Local variable > Global variable