Flight
05-12-2013, 02:01 PM
Last updated: 5-21-2013
I see that no one is working on this so I thought I'd throw out what I have so far. This isn't tested, infact it's about 10 minutes old but it's a place to start. I'll leave a snapshot of the ACA color list containing all the colors I have for the whirlpool so you guys can just add on to the list, and so on...
What I have so far is a simple checker that will search in the tile directly North of your player for this whirlpool color, then count the number found; if 200 of the color is found it's assumed there's a whirlpool at the spot north of us. It won't do anything to avoid the whirlpool so perhaps we could come up something for that like MM walk a couple of tiles away. Now, this could give us false positives from the colors read on our player (clothes, equipment, whatever) so it'll need to be tested with equipment near to this color. That or we could try CTS3.
Update:
Since there wasn't a function to calculate Pixelshift of a TPA only I made this one quick:
function calcPixelShiftTPA(T: Integer; TPA: TPointArray): Integer;
Var
BMP,BMP2: Integer;
begin
BMP := BitmapFromClient(MSx1,MSy1,MSx2,MSy2);
Wait(T);
BMP2 := BitmapFromClient(MSx1,MSy1,MSx2,MSy2);
Result := CalculatePixelShiftTPA(BMP, BMP2, TPA);
FreeBitmap(BMP);
FreeBitmap(BMP2);
end;
function foundWhirlPool(): boolean;
var
cts, l: integer;
tpa: TPointArray;
begin
cts := getToleranceSpeed();
result := false;
ColorToleranceSpeed(2);
setToleranceSpeed2Modifiers(1.67, 0.39);
findColorsTolerance(tpa, 12695998, 247, 136, 273, 170, 12);
setToleranceSpeed2Modifiers(0.02, 0.02);
ColorToleranceSpeed(CTS);
l := length(tpa);
if (l > 30) then
result := (calcPixelShiftTPA(300, tpa) >= (l/4));
end;
Also, this will need to be made for the other 3 tiles adjacent to our player (W/E/S) which should be quite simple. Anywho, it's not much but it's somewhere to start.
Edit:
Duh, forgot to leave the color list...
http://i.imgur.com/jP3lGOx.png
I see that no one is working on this so I thought I'd throw out what I have so far. This isn't tested, infact it's about 10 minutes old but it's a place to start. I'll leave a snapshot of the ACA color list containing all the colors I have for the whirlpool so you guys can just add on to the list, and so on...
What I have so far is a simple checker that will search in the tile directly North of your player for this whirlpool color, then count the number found; if 200 of the color is found it's assumed there's a whirlpool at the spot north of us. It won't do anything to avoid the whirlpool so perhaps we could come up something for that like MM walk a couple of tiles away. Now, this could give us false positives from the colors read on our player (clothes, equipment, whatever) so it'll need to be tested with equipment near to this color. That or we could try CTS3.
Update:
Since there wasn't a function to calculate Pixelshift of a TPA only I made this one quick:
function calcPixelShiftTPA(T: Integer; TPA: TPointArray): Integer;
Var
BMP,BMP2: Integer;
begin
BMP := BitmapFromClient(MSx1,MSy1,MSx2,MSy2);
Wait(T);
BMP2 := BitmapFromClient(MSx1,MSy1,MSx2,MSy2);
Result := CalculatePixelShiftTPA(BMP, BMP2, TPA);
FreeBitmap(BMP);
FreeBitmap(BMP2);
end;
function foundWhirlPool(): boolean;
var
cts, l: integer;
tpa: TPointArray;
begin
cts := getToleranceSpeed();
result := false;
ColorToleranceSpeed(2);
setToleranceSpeed2Modifiers(1.67, 0.39);
findColorsTolerance(tpa, 12695998, 247, 136, 273, 170, 12);
setToleranceSpeed2Modifiers(0.02, 0.02);
ColorToleranceSpeed(CTS);
l := length(tpa);
if (l > 30) then
result := (calcPixelShiftTPA(300, tpa) >= (l/4));
end;
Also, this will need to be made for the other 3 tiles adjacent to our player (W/E/S) which should be quite simple. Anywho, it's not much but it's somewhere to start.
Edit:
Duh, forgot to leave the color list...
http://i.imgur.com/jP3lGOx.png