SRL Archive - SRL Suggestions

InPrisonPete fix


TRiLeZ

2009-12-07 18:47:01

InPrisonPete was broken so I fixed it…


{*******************************************************************************
function InPrisonPete: Boolean;
by: ZephyrsFury, modded by TRiLeZ
Description: Checks if we're in the Prison Pete Random.
*******************************************************************************}
function InPrisonPete: Boolean;
var
Pts: TPointArray;
ATPA: T2DPointArray;
X, Y: Integer;
begin
if (FindColor(X, Y, 60909, MMX1, MMY1, MMX2, MMY2)) then
if (CountColor(60909, MMX1, MMY1, MMX2, MMY2) = 1) then
if (FindColorTolerance(X, Y, 1322555, MMX1, MMY1, MMX2, MMY2, 10)) then
if (CountColorTolerance(1322555, MMX1, MMY1, MMX2, MMY2, 10) > 80) then
if (CountColorTolerance(13884127, MMX1, MMY1, MMX2, MMY2, 13) > 1000) then
begin
FindColorsTolerance(Pts, 237, MMX1, MMY1, MMX2, MMY2, 17);
ATPA := SplitTPA(Pts, 5);
if (InRange(Length(ATPA), 1, 3)) then
Result := (CountColorTolerance(clWhite, MMX1, MMY1, MMX2, MMY2, 50) > 500);
end;
end;
:D

I also made a function to leave the prison but I don't think it is needed until all of the the solver is made. If you would like to see it, say so.

marpis

2009-12-08 13:01:21

What colors are 60909 and 1322555?

jakeyboy29

2009-12-08 14:37:24

From: marpis
What colors are 60909 and 1322555?


60909 and 1322555…

couldn't help it ; )

Naike

2009-12-08 15:00:51

Use Consts.

I'm 99% sure no developer will add any function with you using them.

60909 and 1322555 makes no sense, at all.

TRiLeZ

2009-12-08 17:30:26

From: N1ke!
Use Consts.

I'm 99% sure no developer will add any function with you using them.

60909 and 1322555 makes no sense, at all.


60909 is the npc color on the MM (it was already in the function).
1322555 is the tree color on the MM.

noidea

2009-12-08 23:17:27

From: TRiLeZ
1322555 is the tree color on the MM.


FindTreeColor, FindTreeColor, FindTreeColor!
But disregard that if your function a;ready works 100% :p

TRiLeZ

2009-12-08 23:37:12

From: noidea
FindTreeColor, FindTreeColor, FindTreeColor!
But disregard that if your function a;ready works 100% :p


Since when did the FindTreeColor function find dead trees? :p

noidea

2009-12-08 23:46:23

From: TRiLeZ
Since when did the FindTreeColor function find dead trees? :p


._. Sorry, I didn't know you were looking for dead ones.

TRiLeZ

2009-12-09 17:52:01

From: noidea
._. Sorry, I didn't know you were looking for dead ones.


That's okay, its my fault for not letting you know it was dead trees that the function searched for. ;)

Wanted

2009-12-09 18:23:04

[PHP]Successfully compiled (5884 ms)
SRL Compiled in 31 msec
False
Successfully executed[/PHP]

Doesn't work, I still have the account btw.

TRiLeZ

2009-12-09 23:54:06

Updated first post with working InPrisonPete function.

Wanted

2009-12-11 17:13:35

Now it works.

I have two accounts in pete now, I might try a solver.

Also I have 2 mordauts, leo, frog, and pillary