SRL Archive - OSR Help

doorprofiles.simba


honeyhoney

2012-05-22 20:20:51

\Simba\Includes\SRL\srl\misc\doorprofiles.simba

Few questions here…

  • Does all the functions/procedures still work properly? (my searches show that some of them weren't working properly 2+ years ago)
  • Are there any examples of doorprofiles.simba being used?
  • Anyone got any pointers? Perhaps any advice on how to implement any of the functions to help me find the door I want?


The door I wish to find (and click… duh!) is this one:
It's the largest door on this map (west of the bank):

If doorprofiles.simba doesn't work or doesn't hold the answers - any advice?

(note: a while back some people helped me out in #srl and suggested I click inbetween the two flags… it worked, it definitely worked, but it was very finicky and I've been looking for an alternative solution for a while)

Thanks!

Ashaman88

2012-05-22 23:17:54

Procedure TPAFind;
Var
X,Y,H,I,CTS: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
Begin
If (Not(LoggedIn)) Then
Exit;


MouseSpeed := RandomRange(18, 23);

CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);

SetColorSpeed2Modifiers(0.00, 0.00);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 6710891, MSX1, MSY1, MSX2, MSY2, 0);

ATPA := SplitTPAEx(TPA, 200,200);

SortATPASize(ATPA,True);

DebugATPABounds(ATPA);

If (Length(ATPA) = 0) Then
Begin
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
End;

H := High(ATPA);

For I := 0 To H Do
Begin
MiddleTPAEx(ATPA[I], X, Y);

// If (Length(aPArray[I]) < 20) or (Length(aPArray[I]) > 500) then
// Continue;

//Writeln(tostr(Length(ATPA[I])));

MMouse(X,Y,4,4);

If (WaitUpTextMulti(['Open','pen','oor','Door'],RandomRange(200,220))) Then
Begin
ClickMouse2(False);

If WaitOptionMulti(['Open','pen','oor','Door'],RandomRange(400,500)) Then
Begin
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
End;
End;
End;

ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
End;

Do something like that is my suggestion. Try it out and see if it works. Just find a unique color on the flags, then split tpa a large width and height. If it colors for the flag are unique, it will make a perfect box around the door, with the middle of it being the door.

J J

2012-05-23 03:57:08

I would also use something similiar to Ashamans example. Once you get the box I would count the color tolerance of the brown colors. If the colors are > X amount the door is closed and if the colors are < X amount the door is open which means you can continue walking. If the colors are < X amount you will MiddleTPA and open the doors.

It's just an extra failsafe, otherwise you are clicking between the flags while the door is opened.

if CountColorTolerance(Color, MSX1, MSY1, MSX2, MSY2, Tolerance)<300 then
begin
OpenDoor;
Exit;
end else
Exit;

honeyhoney

2012-05-23 05:40:56

From: ashaman88
-snip-

I'll give it a try thanks!

From: J J
-snip-

Cheers! I was thinking of something like this to determine if it's open or not! :)



Didn't expect so much help! Thanks a lot. :)

I'll report back here with how I get on - not going to be until this weekend though when I have more than 5 minutes spare. :P

bg5

2012-05-23 06:05:39

I did once door opener for one guy. check this thread:
http://villavu.com/forum/showthread.php?t=72578