SRL Archive - FAQ

Can't run my Script anymore.


Failure

2014-04-06 16:37:36

Well hello, I updated my SRL and all. But for some reason it wont run.
In the SRL Setup Guide, it says there'll be an pop up to allow things, I don't get that popup.

{$i srl/srl.simba}

Using that, and ofcourse calling SRL itself with SetupSRL;

Help would be relly appricated, else my Script is dead… (Not for Runescape though)

The error

Exception in Script: File "srl/srl.simba" not found at line 3, column 5

It worked before, now I installed Windows again and it aint working anymore…

The Mayor

2014-04-06 18:01:45

It's because we now use SRL6, which means you have to put:


program new;
{$DEFINE SMART} // if using SMART
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba} //if using SPS

begin
end.

Of if you want to use Old School Runescape, you will have to install the OSR include correctly. Instructions can be found here.

Failure

2014-04-07 01:13:13

I get this when using SRL6….

Exception in Script: Duplicate declaration "Time" at line 5, column 45

When removing "Time" Exception in Script: Unknown declaration "TimeFromMark" at line 276, column 37

Have to remove all TimeFromMark now, which will get my Script stuck =/

P1ng

2014-04-07 06:18:38

These functions found in the "Time" include of SRL6 should be able to help you replace the "TimeFromMark" function you had previously in your script.

(* 
TTimeMarker
~~~~~~~~~~~

.. code-block:: pascal

type TTimeMarker = record
time, startTime: LongWord;
paused: Boolean;
end;

Timer type which is usefull for loops, timing and writing progress reports.

.. note::

- by Bart de Boer
*)
type
TTimeMarker = record
name: string;
time, startTime, __prevMark: LongWord;
paused: Boolean;
end;

(*
TTimeMarker.start
~~~~~~~~~~~~~~~~~

.. code-block pascal

procedure TTimeMarker.start();

Starts the timer. Can also be used when paused to continue where it left.

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

MyScriptTimer.start();
*)
procedure TTimeMarker.start();
begin
Self.__prevMark := GetSystemTime(); // used for adding time after a pause

// if it hasn't been started yet
if (not Self.paused) then
begin
Self.startTime := GetSystemTime();
Self.time := 0;
end;

Self.paused := False;
end;

(*
TTimeMarker.reset
~~~~~~~~~~~~~~~~~

.. code-block pascal

procedure TTimeMarker.reset();

Stops the timer and resets it to zero.

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

MyScriptTimer.reset();
*)
procedure TTimeMarker.reset();
begin
Self.paused := False;
Self.time := 0;
Self.startTime := 0;
end;

(*
TTimeMarker.pause
~~~~~~~~~~~~~~~~~

.. code-block pascal

procedure TTimeMarker.pause();

Pauses the timer. It can be continued with start().

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

MyScriptTimer.pause();
TakeABreak(90000);
MyScriptTimer.start();
*)
procedure TTimeMarker.pause();
begin
Self.time := Self.time + (GetSystemTime() - Self.__prevMark);
Self.paused := True;
end;

(*
TTimeMarker.getTime
~~~~~~~~~~~~~~~~~~~

.. code-block pascal

function TTimeMarker.getTime(): LongWord;

Gets the time from the timer. Returns zero if the timer was not set.

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

MyScriptTimer.start();
repeat
DoStuff;
until(MyScriptTimer.getTime() > 60000);

*)
function TTimeMarker.getTime(): LongWord;
begin
if not Self.paused then
Result := Self.time + (GetSystemTime() - Self.__prevMark)
else
Result := Self.time;
end;

(*
TTimeMarker.getTotalTime
~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block pascal

function TTimeMarker.getTotalTime(): LongWord;

Gets the time from the timer including the time it was paused. Returns zero if
the timer was not set.

.. note::

- by Bart de Boer

Example:

.. code-block:: pascal

BreakTime := MyTimer.getTotalTime() - MyTimer.getTime();

*)
function TTimeMarker.getTotalTime(): LongWord;
begin
if (Self.startTime > 0) then
Result := GetSystemTime() - Self.startTime;
end;

Failure

2014-04-08 01:56:17

Thanks but now I have this hahha I hate changes :p.

Exception in Script: Unknown declaration "MarkTime" at line 322, column 1

I done everything, even then my Scripts seems to be broken… Can I maybe send you my Script Privatly so you can check it? :o

The Mayor

2014-04-08 02:49:55

From: Failure
Thanks but now I have this hahha I hate changes :p.

Exception in Script: Unknown declaration "MarkTime" at line 322, column 1


Basically all timeFromMark and MarkTime should be replaced with TTimeMarkers.


var
t: integer;
begin
markTime(t);
if timeFromMark(t) > 10000 then
//blah
end;



var
t: TTimeMarker;
begin
t.start();
if t.getTime() > 10000 then
//blah
end;

Failure

2014-04-08 08:53:13

Can't get it to work, I consider my script dead…
Anyway to get back to old SRL?

Brotein

2014-04-08 09:35:10

You can always post your script so that someone could look at it and try and help you.

Failure

2014-04-08 09:55:07

From: Brotein
You can always post your script so that someone could look at it and try and help you.


That'd be amazing, though I rather to send it private. Since it's an private Script :)

Brotein

2014-04-08 09:58:45

From: Failure
That'd be amazing, though I rather to send it private. Since it's an private Script :)


I'd be willing to help you try and fix all your compile errors and update the script to SRL6. I don't know if I'll be able to test it for you but getting it to compile is the first step. If you want, send me the original before you tried to work on it.