PDA

View Full Version : Fishing



Giant Panda
09-13-2012, 07:47 AM
Hey everyone,

I'm looking for a bit of help with a script I made for fishing in an online pokemon game. I have a version that works 100% with wait timers but that means it's slow because I have had to allow for the slowest possibilities.

I'm trying to upgrade it so I'm using FindColorSpiralTolerance however for someone reason even though I can use the tool to find the colour once the script is running it just cant see what I'm looking for, unless I start it in the battle.

I'll quickly run you through the sequence

F2 casts the line - After this either nothing happens or the battle starts.
Battle starts - A bunch of red boxes appear and this is where I want simba to find them.
Battle - I press 'Z' twice, this is fine as it is.
Battle finishes - The battle window closes and I'm back to needing to fish. This can be done more easily with a wait timer as it's not random like casting a line and I one hit the wild pokemon.

I would like help trying to fix the part where it's finding the red boxes. The box that is selected by default is the colour '7175130' and the 3 other boxes are colour 5070016. They are found within the box x=262, y=454 x x=745, y=539

program Fish;

procedure Battle;

begin
Writeln('Battle');
wait(5000)
SendKeys('z', 100, 100); // Z Key
wait(1000)
SendKeys('z', 100, 100); // Z Key
wait(10000)
end;


procedure UseRod;

begin
wait(100)
Writeln('Fishing');
PressKey(113); // F2 Key
wait(100)
End;


procedure Fish;
var
x, y:Integer;


begin
wait(100)
FindColorSpiralTolerance(x, y, 14186568, 0, 0, 100, 100, 100)
Writeln('Colour');
if FindColorSpiralTolerance(x, y, 7175130, 262, 454, 745, 539, 20) Or
FindColorSpiralTolerance(x, y, 5070016, 262, 454, 745, 539, 20) Then
begin
Battle;
End Else UseRod;
end;


begin

wait(2000)

repeat

Fish;

until(false)

end.

Any ideas what I've done wrong/how to fix it?

Thanks,

Josh

EDIT: I Realize I have put this in the wrong section but would like to leave it here in case it's seen first :)