SRL Archive - RS3 Help

Make the player rest


Mr. Roboto

2014-08-15 20:34:18

How can I make the player rest?

I can check if they are resting with this (API):

function TRSMinimap.isResting(): boolean;

Is there something like this code below?
TRSMinimap.rest();

riwu

2014-08-15 20:45:23

u have to create a variable of that type 1st:

var
minimap: TRSMinimap;
begin
minimap.rest();
end;
object-oriented programming

Mr. Roboto

2014-08-15 20:58:48

From: riwu
u have to create a variable of that type 1st:

var
minimap: TRSMinimap;
begin
minimap.rest();
end;
object-oriented programming



I could be mistaken but rest is not in the API. I just got this compiler error:

Exception in Script: Unknown declaration "rest"

The Mayor

2014-08-15 22:01:14

From: KLight
I could be mistaken but rest is not in the API. I just got this compiler error:

Exception in Script: Unknown declaration "rest"


Because rest isn't currently a function in SRL6. There should actually be a TRSMinimap.rest but it was never written. You could just paste this into your script:


procedure TRSMinimap.rest();
var
p: TPoint;
begin
p := self.button[MM_BUTTON_RUN].center;

if (not self.isResting()) then
begin
mouseCircle(p.x, p.y, self.button[MM_BUTTON_RUN].radius, MOUSE_RIGHT);
chooseOption.select(['Rest']);
print('minimap.rest(): Enabled rest', TDebug.SUB);
end;
end;

and then you can go:

minimap.rest()

Mr. Roboto

2014-08-15 22:15:31

Thank you, that works well.