SRL Archive - OSR Help

[Q] I need help creating a Progress Report.


msemtex

2013-07-21 15:03:13

Hi Guys,

I want to create a progress report that generates the time running, amount done and xp per hour.

I know how the calculations for xp per hour would work. But I don't know how to calculate the time running using Simba.

Example:
———————————-
Time running: 1 hour 47 minutes
Logs fletched: 1507
Xp per hour: 25351
———————————-

Calculation for xp/h
(((1507*35)/ 107)*60)

All help is appreciated,

Msemtex

Sjoe

2013-07-21 15:11:19

Example taken from a script


procedure Proggy;
var
TimeRun, SnapeGP, SnapeGPH, SnapeH: Int64;

begin
ClearDebug;
TimeRun := (GetTimeRunning / 1000);

SnapeGP := Snapes * SnapePrice
SnapeGPH := Round(((SnapeGP * 3600) / TimeRun));
SnapeH := Round((Snapes * 3600) / TimeRun);

Writeln('Time Running: ' + TimeRunning);
Writeln('You have grabbed ' + IntToStr(Snapes) + ' Snape grass' + ' (' + IntToStr(SnapeH) + '/H)' );
Writeln('You have earnt ' + IntToStr(SnapeGP) + ' profit' + ' (' + IntToStr(SnapeGPH) + ' GP/H)');

Ian

2013-07-21 15:11:26

For time running you can do

WriteLn('Total Time: ' + MsToTime(GetTimeRunning, 2));

That would write
Total Time: 1 hr 1 min 1 sec

You can look at the different options at http://docs.villavu.com/srl-5/timing.html#mstotime

Sjoe

2013-07-21 15:27:26

From: BMWxi
For time running you can do

WriteLn('Total Time: ' + MsToTime(GetTimeRunning, 2));

That would write
Total Time: 1 hr 1 min 1 sec

You can look at the different options at http://docs.villavu.com/srl-5/timing.html#mstotime


or simple Writeln(TimeRunning) :)

msemtex

2013-07-21 15:48:18

Thanks very much for the responses! I will test it out now.

Ian

2013-07-21 15:54:51

From: Sjoe
or simple Writeln(TimeRunning) :)


This way you can change how it appears though :)

The Mayor

2013-07-21 17:07:57

You should also read other people scripts to see how they do it. There are hundreds around the forums you can learn from :)