SRL Archive - Research & Development Lounge

dtmFrogCrown - Edited by me


VivaLaRofl

2008-02-25 19:19:31

I needed to try and make a new frog crown DTM, and I@m not sure how, or even if this will work properly.


So if you don't mind testing?..

Incase the DTM I made does NOT work; he is the SolveFrogSwamp function:

function SolveFrogSwamp: Boolean;
var
arPoolPoints: TPointArray;
AveragePoint: TPoint;
i, fx, fy, dtmFrogCrown, OptionMark, FrogMark, tcts: Integer;
begin
dtmFrogCrown := DTMFromString('78DA63CC616460D8C480027E9C9265B001D24' +
'01986FF40C0988F50C30C5573798D345C0D08306603591B50D5FC' +
'3E6F86AA0664D71654359F8FC9A2AAC9C4B4EBE57E54350015B91' +
'3ED');
MarkTime(FrogMark);
repeat;
tcts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.2, 10.0);
FindColorsTolerance(arPoolPoints, 6189364, MMX1, MMY1, MMX2, MMY2, 50);
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(tcts);
if(GetArrayLength(arPoolPoints) = 0)then
begin
Writeln('Failed to find the center of the frog cave.');
Result := False;
FreeDTM(dtmFrogCrown);
Exit;
end;
for i := 0 to GetArrayLength(arPoolPoints) - 1 do
begin
AveragePoint.x := AveragePoint.x + arPoolPoints[i].x;
AveragePoint.y := AveragePoint.y + arPoolPoints[i].y;
end;
AveragePoint.x := AveragePoint.x / (GetArrayLength(arPoolPoints) - 1);
AveragePoint.y := AveragePoint.y / (GetArrayLength(arPoolPoints) - 1);
MFNF(AveragePoint.x, AveragePoint.y, 5, 5);
Flag;
MarkTime(OptionMark);
repeat;
if(FindDTM(dtmFrogCrown, fx, fy, 90, 102, 473, 334))then
begin
Mouse(fx, fy, 0, 0, False);
Wait(200 + Random(500));
if(ChooseOption('Talk'))then
Break;
end else Break;
until(TimeFromMark(OptionMark) > 30000);
if(TimeFromMark(OptionMark) > 30000)then
Logout;
if not(LoggedIn)then
begin
WriteLn('******** FROG RANDOM MISSED ********');
WriteFileString(TheFile, '******** FROG RANDOM MISSED ********' + Chr(13));
Players[CurrentPlayer].Rand := 'Frog Random';
Players[CurrentPlayer].Active := False;
Result := False;
NoFrogs := NoFrogs + 1;
FreeDTM(dtmFrogCrown);
Exit;
end;
Flag;
Wait(300 + Random(500));
until(FindText(fx, fy, 'mph', NPCChars, MCX1, MCY1, MCX2, MCY2)) or
(TimeFromMark(FrogMark) > 60000);
if (TimeFromMark(FrogMark) > 60000) then Logout;
repeat;
if not (LoggedIn) then
begin
WriteLn('******** FROG RANDOM MISSED ********');
WriteFileString(TheFile, '******** FROG RANDOM MISSED ********' + Chr(13))
Players[CurrentPlayer].Rand := 'Frog Random'; //Players[CurrentPlayer].Loc := 'Frog Random';
Players[CurrentPlayer].Active := False;
Result := False;
NoFrogs := NoFrogs + 1;
FreeDTM(dtmFrogCrown);
Exit;
end;
ClickToContinue;
Wait(500 + Random(500));
until not (DetectFrogCave);
Result := True;
TakeScreen('Solved Frog Cave');
Frogs := Frogs + 1;
FreeDTM(dtmFrogCrown);
WriteLn('******** FROG RANDOM SOLVED ********');
WriteFileString(TheFile, '******** FROG RANDOM SOLVED ********' + Chr(13))
end;

And the new one with the edited DTM:

function SolveFrogSwamp: Boolean;
var
arPoolPoints: TPointArray;
AveragePoint: TPoint;
i, fx, fy, dtmFrogCrown, OptionMark, FrogMark, tcts: Integer;
begin
dtmFrogCrown := DTMFromString('78DA63BCCDC0C060C88002762CE660F80FA41' +
'981F83F10305E02327450D5AC992C0BA619A17CC6AB40C20455CD' +
'D7AB82A86AEE01095D543587962AA3AAB90924F450D53C5DC280A' +
'AE6169030433347440C55CD754C737EEFE3265DCD0D4C35CF364B' +
'61BA591B55CDEC6A23143500C1AD1E75' +
'3ED');
MarkTime(FrogMark);
repeat;
tcts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.2, 10.0);
FindColorsTolerance(arPoolPoints, 6189364, MMX1, MMY1, MMX2, MMY2, 50);
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(tcts);
if(GetArrayLength(arPoolPoints) = 0)then
begin
Writeln('Failed to find the center of the frog cave.');
Result := False;
FreeDTM(dtmFrogCrown);
Exit;
end;
for i := 0 to GetArrayLength(arPoolPoints) - 1 do
begin
AveragePoint.x := AveragePoint.x + arPoolPoints[i].x;
AveragePoint.y := AveragePoint.y + arPoolPoints[i].y;
end;
AveragePoint.x := AveragePoint.x / (GetArrayLength(arPoolPoints) - 1);
AveragePoint.y := AveragePoint.y / (GetArrayLength(arPoolPoints) - 1);
MFNF(AveragePoint.x, AveragePoint.y, 5, 5);
Flag;
MarkTime(OptionMark);
repeat;
if(FindDTM(dtmFrogCrown, fx, fy, 90, 102, 473, 334))then
begin
Mouse(fx, fy, 0, 0, False);
Wait(200 + Random(500));
if(ChooseOption('Talk'))then
Break;
end else Break;
until(TimeFromMark(OptionMark) > 30000);
if(TimeFromMark(OptionMark) > 30000)then
Logout;
if not(LoggedIn)then
begin
WriteLn('******** FROG RANDOM MISSED ********');
WriteFileString(TheFile, '******** FROG RANDOM MISSED ********' + Chr(13));
Players[CurrentPlayer].Rand := 'Frog Random';
Players[CurrentPlayer].Active := False;
Result := False;
NoFrogs := NoFrogs + 1;
FreeDTM(dtmFrogCrown);
Exit;
end;
Flag;
Wait(300 + Random(500));
until(FindText(fx, fy, 'mph', NPCChars, MCX1, MCY1, MCX2, MCY2)) or
(TimeFromMark(FrogMark) > 60000);
if (TimeFromMark(FrogMark) > 60000) then Logout;
repeat;
if not (LoggedIn) then
begin
WriteLn('******** FROG RANDOM MISSED ********');
WriteFileString(TheFile, '******** FROG RANDOM MISSED ********' + Chr(13))
Players[CurrentPlayer].Rand := 'Frog Random'; //Players[CurrentPlayer].Loc := 'Frog Random';
Players[CurrentPlayer].Active := False;
Result := False;
NoFrogs := NoFrogs + 1;
FreeDTM(dtmFrogCrown);
Exit;
end;
ClickToContinue;
Wait(500 + Random(500));
until not (DetectFrogCave);
Result := True;
TakeScreen('Solved Frog Cave');
Frogs := Frogs + 1;
FreeDTM(dtmFrogCrown);
WriteLn('******** FROG RANDOM SOLVED ********');
WriteFileString(TheFile, '******** FROG RANDOM SOLVED ********' + Chr(13))
end;

Also could someone tell me what the "'3ED'" thing is? Do I have to change this too?


Credits too:

Entire SRL Team
YoHoJo's DTM tutorial


Thanks,

Please post if it works or not..

malotthouse

2008-02-25 19:35:58

you can't find an npc with a dtm.

or at least its very hard–nearly impossible to do

VivaLaRofl

2008-02-25 19:44:31

It only searches for then crown, since I think it's the only gold thing within the area.

malotthouse

2008-02-25 20:14:21

ill try it. heck, if it works then ill post back. but i won't be autoing for a few days

Timer

2008-02-25 20:32:45

did u use DTMRotated(DTM, x, y, MSX1, MSY1, MSX2, MSY2) ?

VivaLaRofl

2008-02-25 22:19:14

Think so.

n3ss3s

2008-02-26 08:11:54

Don't want to discourage you, but why did you make one since SRL has got one? Last time my SRL succesfully solved a frog was yesterday.

VivaLaRofl

2008-02-26 09:41:12

Because mine didn't, why else.

Raskolnikov

2008-02-26 10:15:04

I think that frogs talk? Don't they? Just make a new one for SRL by yourself. I don't think this will work though. Well if this doesn't work, searching for the npc, search for the color of the crown, then do click it I guess….

~ Cut em2 it

VivaLaRofl

2008-02-26 12:33:04

The DTM I edited was only to FIND the frogs crown; the gold parts is what I used.

THe rest of the procedure is done by the rest of the script which I didn't make.