SRL Archive - Research & Development Lounge

Opening Doors at the Wizzards Tower.


Bad Boy JH

2010-02-18 00:59:52

Now, I need a couple of people to dissapear over to the wizzards tower (F2P) south of draynor, the bottom level, and make sure this function works, it should open doors if needed, and walk over to the water symbol. Yes, Coordinates are used, but I couldn't think of a better option…

Procedure OpenDoors;
var
CCount:Array of Integer;
TPoint:Tpoint;
begin
Setlength(CCount, 2);
CCount[0] := CountColorTolerance(4024458, 320, 140, 340, 160, 20);
CCount[1] := CountColorTolerance(4024458, 390, 15, 410, 35, 20);
Writeln(IntToStr(CCount[0]));
Writeln(IntToStr(CCount[1]));
if CCount[0] >= 100 then
begin
Mouse(325, 175, 5, 5, True);
Flag;
Wait(RandomRange(1000, 1500));
If CCount[1] >= 50 then
begin
Mouse(350, 25, 5, 5, true);
Flag;
Wait(RandomRange(1000, 1500));
end;
end else
if not(CCount[0] >= 100) and (CCount[1] >= 50) then
begin
Mouse(390, 25, 5, 5, True);
Flag;
Wait(RandomRange(1000, 1500));
end else
Writeln('Doors all Open');
FindSymbol(Tpoint.x, TPoint.y, 'water');
Mouse(Tpoint.x+25, Tpoint.y, 5, 5, true);
Flag;
end;

begin
SetupSRL;
OpenDoors;
end;

void_hatred

2010-02-18 09:46:52

just a tip, but Array of Integer could be TIntegerArray :)

void_hatred

Bad Boy JH

2010-02-18 16:36:42

hmmm…didn't know there was such a variable, don't see the point in changing it though, its the same thing, I could infact just use two variables…'twould be just as easy…

void_hatred

2010-02-18 16:58:35

it's not a variable, it's a type ;)

void_hatred

Coh3n

2010-02-18 23:10:25

Sorry, didn't work for me. I ran it, my mouse moved to the top left of the RS screen, and the debug box read:

0
3
Doors all Open
Except there were no doors open. :(

Bad Boy JH

2010-02-18 23:41:05

This is at the Wizzards Tower, on the East of the ladder (which is where you come up) compass north, and AngleHigh

Coh3n

2010-02-19 00:45:33

From: Bad Boy JH
This is at the Wizzards Tower, on the East of the ladder (which is where you come up) compass north, and AngleHigh

Like in the basement? Or the main floor?

EDIT: I ran it on the main floor and it worked perfectly. :) Although when it opened the door it didn't really walk to the bridge (I'm guessing that's what you were trying to do), it walked east right near the water. You may want to adjust that a little.

Also, have you tried using SRL's DoorProfiles to find and open the doors, etc? I would think it's better than clicking specified points. That has the chance to mess up depending on camera and compass angles.

Bad Boy JH

2010-02-19 01:39:00

Yes, I have looked at DoorProfiles, but that tells me the location of the doors on the minimap, but doesn't tell me if they are open or MS locations of them.
The Walking is supposed to be on the east side of the mini island, that way i can get it to click on the water, which walks with less clicks, which is what i do when not autoing…and means my crap walking procedures have less chance to screw up


Procedure OpenDoors;
var
CCount:Array of Integer;
TPoint:Tpoint;
begin
Setlength(CCount, 2);
CCount[0] := CountColorTolerance(4024458, 310, 140, 330, 160, 20);
CCount[1] := CountColorTolerance(4024458, 380, 15, 400, 35, 20);
Writeln(IntToStr(CCount[0]));
Writeln(IntToStr(CCount[1]));
if CCount[0] >= 100 then
begin
Mouse(325, 175, 5, 5, True);
Flag;
Wait(RandomRange(1000, 1500));
If CCount[1] >= 50 then
begin
Mouse(350, 25, 5, 5, true);
Flag;
Wait(RandomRange(1000, 1500));
end;
end else
if not(CCount[0] >= 100) and (CCount[1] >= 50) then
begin
Mouse(390, 25, 5, 5, True);
Flag;
Wait(RandomRange(1000, 1500));
end else
Writeln('Doors all Open');
FindSymbol(Tpoint.x, TPoint.y, 'water');
Mouse(Tpoint.x+25, Tpoint.y, 5, 5, true);
Flag;
end;

begin
OpenDoors;
Mouse(689, 81, 15, 15, True);
Wait(RandomRange(500, 1000));
WaitFunc(@FlagPresent, 20, 80000);
Flag;
end;
thats what will happen in the end, before a walk over to the altar…

Coh3n

2010-02-19 11:16:41

I just ran it a couple more times, and both times it tried to open the second door when the first one was closed. It would then continue to try to walk to the water.

Here's the debug:

SRL Compiled in 16 msec
26
229
Successfully executed

Bad Boy JH

2010-02-20 07:06:10

Hmm…I really need a better way…I think I can do one, if DoorProfiles was updated, but I do not have the skill to do so yet… I think the majority of the stuff works, just the coloring is the issue, I am now looking up AutoColor…

noidea

2010-02-20 10:02:23

Since the door profiles tell you the MM location, use MMtoMS() ?
or sort the MM points and then use MMtoMS()

Bad Boy JH

2010-02-20 17:52:19

Yes, I have Tried that, after I fixed up the procedure with things like autocolor, then I tried the MMToMs, but it isn't very accurate, and it needs to be fixed up…

i luffs yeww

2010-02-20 18:18:22

http://www.villavu.com/forum/showthread.php?t=55033

Might be useful. :p Naum will probably fix it, along with seven other useless functions, in a few minutes. ;)