PDA

View Full Version : dtmFrogCrown - Edited by me



VivaLaRofl
02-26-2008, 12:19 AM
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('78DA63CC616460D8C480027E9C9265B001D 24' +
'01986FF40C0988F50C30C5573798D345C0D08306603591B50 D5FC' +
'3E6F86AA0664D71654359F8FC9A2AAC9C4B4EBE57E5435001 5B91' +
'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('78DA63BCCDC0C060C88002762CE660F80FA 41' +
'981F83F10305E02327450D5AC992C0BA619A17CC6AB40C204 55CD' +
'D7AB82A86AEE01095D543587962AA3AAB90924F450D53C5DC 280A' +
'AE6169030433347440C55CD754C737EEFE3265DCD0D4C35CF 364B' +
'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
02-26-2008, 12:35 AM
you can't find an npc with a dtm.

or at least its very hard--nearly impossible to do

VivaLaRofl
02-26-2008, 12:44 AM
It only searches for then crown, since I think it's the only gold thing within the area.

malotthouse
02-26-2008, 01:14 AM
ill try it. heck, if it works then ill post back. but i won't be autoing for a few days

Timer
02-26-2008, 01:32 AM
did u use DTMRotated(DTM, x, y, MSX1, MSY1, MSX2, MSY2) ?

VivaLaRofl
02-26-2008, 03:19 AM
Think so.

n3ss3s
02-26-2008, 01:11 PM
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
02-26-2008, 02:41 PM
Because mine didn't, why else.

Raskolnikov
02-26-2008, 03:15 PM
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
02-26-2008, 05:33 PM
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.