PDA

View Full Version : Whirlpool random



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

Ashaman88
05-12-2013, 02:24 PM
Great, are the whirlpool colors pretty unique from the water and whatnot?

Flight
05-12-2013, 02:29 PM
Great, are the whirlpool colors pretty unique from the water and whatnot?

Indeed it is. You can see in the above picture only 1 pixel out of the neighboring 2 fishing spots was detected with the same color. Also, sorry about the late upload up the picture, but it's there now along with the list of colors I used.

Ashaman88
05-12-2013, 04:13 PM
Indeed it is. You can see in the above picture only 1 pixel out of the neighboring 2 fishing spots was detected with the same color. Also, sorry about the late upload up the picture, but it's there now along with the list of colors I used.

Excellent work, looks like it shouldn't be too hard to implement then.

Olly
05-12-2013, 04:23 PM
Would be nice to improve it some more, perhaps combine it with calcPixelShiftTPA?

Something like

if (length(arr) > 200) then
if (calcPixelShiftTPA(arr) > 100) then
writeln('its a whirlpool!');

Flight
05-13-2013, 12:30 AM
Would be nice to improve it some more, perhaps combine it with calcPixelShiftTPA?

Something like

if (length(arr) > 200) then
if (calcPixelShiftTPA(arr) > 100) then
writeln('its a whirlpool!');

That's the smart thing to do, I clearly should have used other pixelshift methods. Thanks for the tip Olly.

Edit:
Ok so I made a function to calculate the pixelshift for a single TPA over X milliseconds. I added it and the new function to the OP. Still untested but I'll be running it in my monkfishing script today, hoping to detect the random.

Olly
05-13-2013, 10:39 PM
Ok so I made a function to calculate the pixelshift for a single TPA over X milliseconds. I added it and the new function to the OP. Still untested but I'll be running it in my monkfishing script today, hoping to detect the random.

I changed a few things, yours would always take 300ms because you would search for pixelshift (even if you found no colors!), and i changed it so only half of the tpa has to shift.

function foundWhirlPool(): boolean;
var
cts, l: integer;
tpa: TPointArray;
begin
cts := getToleranceSpeed();
result := false;

setToleranceSpeed(2);
setToleranceSpeed2Modifiers(1.67, 0.39);

findColorsTolerance(tpa, 12695998, 247, 136, 273, 170, 12);

setToleranceSpeed2Modifiers(0.02, 0.02);
setToleranceSpeed(cts);

l := length(tpa);

if (l > 200) then
result := (calcPixelShiftTPA(300, tpa) > (l / 2));
end;

Obviously i can't test but i hope this could be an improvement from yours!

Flight
05-13-2013, 11:08 PM
I changed a few things, yours would always take 300ms because you would search for pixelshift (even if you found no colors!), and i changed it so only half of the tpa has to shift.

function foundWhirlPool(): boolean;
var
cts, l: integer;
tpa: TPointArray;
begin
cts := getToleranceSpeed();
result := false;

setToleranceSpeed(2);
setToleranceSpeed2Modifiers(1.67, 0.39);

findColorsTolerance(tpa, 12695998, 247, 136, 273, 170, 12);

setToleranceSpeed2Modifiers(0.02, 0.02);
setToleranceSpeed(cts);

l := length(tpa);

if (l > 200) then
result := (calcPixelShiftTPA(300, tpa) > (l / 2));
end;

Obviously i can't test but i hope this could be an improvement from yours!

Looks great I'll add it to the OP and to my script for testing today.

Edit:
Ok well that didn't detect the whirlpool, I imagine 1/2 is too high then. I'll try 1/4 1/5 and see if that works.

Edit2:
The whirlpool is detected at a much lower length of the TPA (40 I found is sufficient) before we can even begin to calculate the pixelshift. I changed it up a bit and the function successfully detected the whirlpool both times I watched one spawn. I updated the OP.