SRL Archive - Help and Support

Help with this proc.


BobboHobbo

2009-07-18 10:19:44

Well i got my FindAxe proc, because SRL's is broken atm, here it is:


function FindAxeAccurate: Boolean;
var
AxeBH: string;
AxeHeadDTM, xQ, yQ: integer;
Axetype, Z, I: Integer;
begin
AxeHeadDTM := DTMFromString('78DA639CC0CCC0D0CEC8800CDCE3D219FE036' + '990E87F20609C0C54D38BAA06220B2381F414A09A16026A7A8950' + 'D30354D349404D07504D1B7E35009D660CB4');
Gametab(5);
if FindDTM(AxeHeadDTM, xQ, yQ, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('X :' + IntToStr(xQ) + ' Y: ' + IntToStr(yQ));
Writeln(GetColor(xQ, yQ));
case Axetype of
0: if (GetColor(xQ, yQ) = 1381655) then
AxeBH := 'Dragon';
1: if (GetColor(xQ, yQ) = 6774343) then
AxeBH := 'Rune';
2: if (GetColor(xQ, yQ) = 4544069) then
AxeBH := 'Adamant';
3: if (GetColor(xQ, yQ) = 6439747) then
AxeBH := 'Mithril';
4: if (GetColor(xQ, yQ) = 1381655) then
AxeBH := 'Black';
5: if (GetColor(xQ, yQ) = 7566203) then
AxeBH := 'Steel';
6: if (GetColor(xQ, yQ) = 5263446) then
AxeBH := 'Iron';
7: if (GetColor(xQ, yQ) = 2440526) then
AxeBH := 'Bronze';
end;
for Axetype := 0 to 7 do
begin
If not (AxeBH = '') then break;
Writeln(AxeBh);
Writeln('X :' + IntToStr(xQ) + ' Y: ' + IntToStr(yQ));
Writeln(GetColor(xQ, yQ));
end;
end
else
Result := false;
FreeDTM(AxeheadDTM);
end;

It cannot find what AxeBH is?!?? like when you play it it finds the exact colours and everything… Debug.

X :583 Y: 219
6774343

X :583 Y: 219
6774343

X :583 Y: 219
6774343

X :583 Y: 219
6774343

X :583 Y: 219
6774343


Which is the rune axe and the proc isnt saying it is. WHY?

Da 0wner

2009-07-18 10:23:19

Don't those colors change? And also, AxeType is 0 when the procedure starts, and you don't set it to anything. So all it does is check for the dragon axe…then exits the case because no other requirements are met.

BobboHobbo

2009-07-18 10:26:56

for Axetype := 0 to 7 do

its 0 to 7? How do i fix it then

And no i dont think so.

Da 0wner

2009-07-18 10:30:33

function FindAxeAccurate: Boolean;
var
AxeBH: string;
AxeHeadDTM, xQ, yQ: integer;
Axetype, Z, I: Integer;
begin
AxeHeadDTM := DTMFromString('78DA639CC0CCC0D0CEC8800CDCE3D219FE036' +
'990E87F20609C0C54D38BAA06220B2381F414A09A16026A7A8950' +
'D30354D349404D07504D1B7E35009D660CB4');
Gametab(5);
if FindDTM(AxeHeadDTM, xQ, yQ, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('X :' + IntToStr(xQ) + ' Y: ' + IntToStr(yQ));
Writeln(IntToStr(GetColor(xQ, yQ)));
for Axetype := 0 to 7 do
begin
case Axetype of
0: if (GetColor(xQ, yQ) = 1381655) then
AxeBH := 'Dragon';
1: if (GetColor(xQ, yQ) = 6774343) then
AxeBH := 'Rune';
2: if (GetColor(xQ, yQ) = 4544069) then
AxeBH := 'Adamant';
3: if (GetColor(xQ, yQ) = 6439747) then
AxeBH := 'Mithril';
4: if (GetColor(xQ, yQ) = 1381655) then
AxeBH := 'Black';
5: if (GetColor(xQ, yQ) = 7566203) then
AxeBH := 'Steel';
6: if (GetColor(xQ, yQ) = 5263446) then
AxeBH := 'Iron';
7: if (GetColor(xQ, yQ) = 2440526) then
AxeBH := 'Bronze';
end;
If not (AxeBH = '') then break;
Writeln(AxeBh);
Writeln('X :' + IntToStr(xQ) + ' Y: ' + IntToStr(yQ));
Writeln(GetColor(xQ, yQ));
end;
end
else
Result := false;
FreeDTM(AxeheadDTM);
end;

I didn't really rewrite or anything, just placed your case somewhere where it would actually work :).

BobboHobbo

2009-07-18 10:31:36

Ohh lol :) im an epic fail xD. Thanks.

EDIT: still doesnt work..

DEBUG:
X :583 Y: 219
6774343

X :583 Y: 219
6774343

TRiLeZ

2009-07-18 10:53:58

Your case isnt going to work…
AxeType already has to be set to a number and that case would be: if (AxeType = 0) then… you know.
Do this:

case GetColor(xQ, yQ) of
1381655: AxeBH := 'Dragon';
6774343: AxeBH := 'Rune';
And so on

TRiLeZ

2009-07-18 11:00:34

I have remade your axe finding function :D


function FindAxeAccurate: Boolean;
var
AxeBH: string;
AxeHeadDTM, xQ, yQ: integer;
Axetype, Z, I: Integer;
begin
AxeHeadDTM := DTMFromString('78DA639CC0CCC0D0CEC8800CDCE3D219FE036' +
'990E87F20609C0C54D38BAA06220B2381F414A09A16026A7A8950' +
'D30354D349404D07504D1B7E35009D660CB4');
Gametab(5);
if FindDTM(AxeHeadDTM, xQ, yQ, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('X :' + IntToStr(xQ) + ' Y: ' + IntToStr(yQ));
Writeln(IntToStr(GetColor(xQ, yQ)));
case GetColor(xQ, yQ) of
1381655: AxeBH := 'Dragon';
16774343: AxeBH := 'Rune';
4544069: AxeBH := 'Adamant';
6439747: AxeBH := 'Mithril';
1381655: AxeBH := 'Black';
7566203: AxeBH := 'Steel';
5263446: AxeBH := 'Iron';
2440526: AxeBH := 'Bronze';
end;
If (AxeBH = '') then
begin
Writeln('Couldn''t find an axe.');
Exit;
end;
Writeln(AxeBh);
Writeln('X :' + IntToStr(xQ) + ' Y: ' + IntToStr(yQ));
end;
Result := false;
FreeDTM(AxeheadDTM);
end;

Da 0wner

2009-07-18 11:01:33

I fixed it already ;).

ian.

2009-07-18 11:09:23

From: Da 0wner
I fixed it already ;).


orly? ;)

From: BobboHobbo
Ohh lol :) im an epic fail xD. Thanks.

EDIT: still doesnt work..

DEBUG: