pwnaz0r
2007-10-08 23:12:34
Well, I used DTMs instead of bitmaps, it works, some things in the old FindPick wasn't working as well as I had hope(i think there is an exit in the wrong spot?). Anyways I redid it, it now handles a broken pickaxe (not the same as the head flying off) and it writes alot more to help the user know whats going on. Go ahead, try it!
function FindPick2: Boolean;
var
HeadDTM, HandleDTM, BrokenDTM, AxeDTM, hx, hy, mx, my, i, c, x, y: integer;
Lost, Wielded: boolean;
begin
BrokenDTM:= DTMFromString('78DA63CC62626098C0C8800A189148209D045' +
'4D347404D1E504D170135E540359388503385809A2A22D45403D5' +
'4C26C21C42EE4907AA994B404D2A50CD2222C2701901358940354' +
'B8950438C5D0B8870F32C026A328808C354C2E9070005DF1192');
HandleDTM:= DTMFromString('78DA634C676260F0656440058C482490CE00A' +
'A0921A02605A82686809A4422D42401D54410615730116EF626A0' +
'260FA8C69D809A2CA01A0FDC6AD8417436508D1B0135394035AE4' +
'498E347400DC83D0144A80924A02613A82608BF1A007DFD0B4F');
HeadDTM:= DTMFromString('78DA8DD2390E80300C44D198E39250B0738AB' +
'043071C15D34183BF0BBB79D2C8D2C89E38978BFB8EBCB6DE434D' +
'6B980598494D6798084CAFA60159B561066046609EDF2BC3CCC0A' +
'CC06CD094C0148621DDB8D40460BC614E3529E86100C60393FD9B' +
'1B6F23174D');
AxeDTM:= DTMFromString('78DA6374606260B8C38006189148206D0954F' +
'389801A6BA09A67B8D530C2CC7945408D0550CD5B026ACC816A3E' +
'1050E30454F380801A67A09AFB04D47800D5DC26A0C60DA8E6161' +
'16AAE13E19E6B44F8FD260135A684DD0300CC7D1006');
if FindDTM(BrokenDTM, hx, hy, 546, 203, 737, 466) then
begin
Writeln('Broken Pick Found!');
if FindDTM(AxeDTM, hx, hy, 546, 203, 737, 466) then
begin
Writeln('Found a new pickaxe.');
end else
result:= true;
end;
GameTab(4);
if not FindDTM(AxeDTM, hx, hy, 546, 203, 737, 466) then
begin
if FindDTM(HandleDTM, hx, hy, 546, 203, 737, 466) then
begin
Writeln('Handle Found!');
Lost:= true;
end else
begin
GameTab(5);
if not FindDTM(AxeDTM, hx, hy, 546, 203, 737, 466) then
Writeln('Handle Found!') else
Lost:= true;
Wielded:= true;
Mouse(hx, hy, 0 ,0, true);
end;
end;
GameTab(4);
if not Lost then exit;
repeat
if not (LoggedIn) then Exit;
c := c + 1;
x := Random(510) + 5;
y := Random(330) + 5;
if (FindColorSpiral(x, y, hc1, 3, 3, 515, 338)) or
(FindColorSpiral(x, y, hc2, 3, 3, 515, 338)) or
(FindColorSpiral(x, y, hc3, 3, 3, 515, 338)) or
(FindColorSpiral(x, y, hc4, 3, 3, 515, 338)) or
(FindColorSpiral(x, y, hc5, 3, 3, 515, 338)) then
begin
MMouse(x, y, 2, 2);
if IsUpTextMulti('Take', 'pick', 'head') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
end;
Flag;
Wait(1000 + Random(100));
lost:= not FindDTM(HeadDTM, hx, hy, 546, 203, 737, 466);
end;
until(c >= 10) or (Lost = false);
if (c >= 10) then
begin
Writeln('Could not find pick!');
exit;
end else
Writeln('Pick Head Found!');
for c:= 0 to 10 do
begin
if FindDTM(HandleDTM, hx, hy, 546, 203, 737, 466) then
if FindDTM(HeadDTM, mx, my, 546, 203, 737, 466) then
begin
Mouse(mx, my, 0, 0, true);
wait(500+random(600));
Mouse(hx, hy, 0, 0, true);
wait(1000+random(500));
result:= not FindDTM(AxeDTM, hx, hy, 546, 203, 737, 466);
if not result then
begin
Writeln('Pick Attached!');
break;
end;
end;
end;
FreeDTM(BrokenDTM);
FreeDTM(HandleDTM);
FreeDTM(HeadDTM);
FreeDTM(AxeDTM);
end;