SRL Archive - SRL Archives

Improved FindPick - Handles broken and attaching


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;

itSchRis917

2007-10-08 23:18:51

Works well for me.. Great job!

Harry

2007-10-08 23:21:30

Oh! Nice!

Will we be able to squeeze another scripting cup next to your name? Or maybe pull out the 'gears'? ;)

pwnaz0r

2007-10-09 07:58:10

Thanks for the comments guys. Might improve when i get home.

n3ss3s

2007-10-09 08:11:24

Or maybe pull out the 'gears'?


I missed the joke there, please tell..

Nice job, again. You've been making a lot good functions recently.

Harry

2007-10-09 08:41:47

Gears, as what Devs have next to their name.

n3ss3s

2007-10-09 09:43:32

Gears, as what Devs have next to their name.


Ahh, now I get it! Gear - Gears yes, the spinning things!

But Im pretty sure you need SRL Masters cup, then you will go 1 up, and then, if you wont apply yourself with kickass material, its about your only chance to get invited if im right.

pwnaz0r

2007-10-09 16:54:34

From: n3ss3s
Ahh, now I get it! Gear - Gears yes, the spinning things!

But Im pretty sure you need SRL Masters cup, then you will go 1 up, and then, if you wont apply yourself with kickass material, its about your only chance to get invited if im right.


indeed you are correct. Anyways that's not what this is about, so let's get back on the topic. I think this is what I will be using in my miner so :D i might make better. Not now though no time.

the scar noob

2007-10-10 09:18:13

It looks great, I hope you can get more on msn to teach me, I need it ;)

-Tsn.

EDIT: Yay! I just see I've got Bear Cup!! Woohoo! Thanks devs!;)
NExt Goal is scripters cup, what should I write? Anybody has got suggestions?

n3ss3s

2007-10-10 09:52:36

Thanks devs!


Correction: Thanks admins!

Umm for the scripters cup, write umm - AHA!:

Edgeville coal miner.

Goes down the stairs in edgeville, walks to the coals (theres tons of them!), mines full inv, and banks ;)

If its uber leet it should get you scripter cup.

the scar noob

2007-10-10 09:54:52

From: n3ss3s
Correction: Thanks admins!

Umm for the scripters cup, write umm - AHA!:

Edgeville coal miner.

Goes down the stairs in edgeville, walks to the coals (theres tons of them!), mines full inv, and banks ;)

If its uber leet it should get you scripter cup.


I'll have to lvl characters to test that one :(
Btw aren't there also beasts that attack you??

-Tsn.