SRL Archive - OSR Help

Opening Doors


Gushers

2012-01-02 00:30:06

It opens the door, but if the door is already opened it will close it.
Also when it gets to a point in the script where there are three doors around me it opens all three, when I only need it to open two.
Help me out? Here's my code:
procedure FindDoor;
var
X, Y: Integer;
begin
MakeCompass('W');
SetAngle(false);
If FindObj(x,y,'Open',8108474,5) then
x:=MSCX;
y:=MSCY;
Begin
StatsGuise('Opening Door...');
GetMousePos(x, y);
Mouse(X, Y, 5, 5, False);
WaitOption('Door', 500);
Wait(2000);
end;

pitoms

2012-01-02 00:40:15

For the first problem, I'd check if the door is closed before opening it by doing something like

if IsUpText('pen') then
openDoor();

I'm not sure how you would solve your second problem though

Flight

2012-01-02 00:44:05

Give this a whirl:

If FindObj(x,y,'Open',8108474,5) then
Begin
StatsGuise('Opening Door...');
ClickMouse2(True);
if not DidRedClick then //If we missed, then exit so we can try again (maybe use a label here?)
exit;
While IsMoving do
Wait(1);
//Maybe wait a little longer?
end else if FindObj(x,y,'Close',8108474,5) then //The door is already open, so let's exit
Exit;

Gushers

2012-01-02 01:11:15

From: Flight
Give this a whirl:

If FindObj(x,y,'Open',8108474,5) then
Begin
StatsGuise('Opening Door...');
ClickMouse2(True);
if not DidRedClick then //If we missed, then exit so we can try again (maybe use a label here?)
exit;
While IsMoving do
Wait(1);
//Maybe wait a little longer?
end else if FindObj(x,y,'Close',8108474,5) then //The door is already open, so let's exit
Exit;

Wow that works perfectly! Such a hero(: Lol.
One more question so I can finish this quest script!
Walking, on snow.. Possible? Or do I gotta wait until it's gone?

Flight

2012-01-02 01:27:15

From: Gushers
Wow that works perfectly! Such a hero(: Lol.
One more question so I can finish this quest script!
Walking, on snow.. Possible? Or do I gotta wait until it's gone?


Mmm, I imagine the normal Runescape map is just around the corner. It'll be very soon, I personally believe, that the holiday update will be removed, along with those snow maps you see. What I would do is just work on the rest of the script, excluding walking in that area, while you wait for the maps to return to normal.

Gushers

2012-01-02 01:36:09

From: Flight
Mmm, I imagine the normal Runescape map is just around the corner. It'll be very soon, I personally believe, that the holiday update will be removed, along with those snow maps you see. What I would do is just work on the rest of the script, excluding walking in that area, while you wait for the maps to return to normal.


Alrighty thanks again man, I'll just have to wait!
And in the code you gave me it said "maybe put a label here" … Whats a label?