View Full Version : FindDirtRoadColor?
3Garrett3
05-16-2007, 08:58 PM
FindDirtRoadColor has stopped working for me? I made 2 bitmaps to use autocolorthis on, but they didnt work either. Could someone help me autocolor the dirt behind the lumby gen store? i need it for my willow buyer, but the autocolor never works anymore?
XcanadamanX
05-16-2007, 09:13 PM
didnt work for me today either.
Sp0rky
05-16-2007, 09:16 PM
This is the find dirt I use, borrowed it from a yew cutter and I can't remember who made it. Its excellent and I would really like to know who created it so I can ask their permission to use it.
function MyFindDirt: integer;
var Dirt, Dirt2, Dirt3, Dirt4, Dirt5, Dirt6, Dirt7, Dirt8, Tol: integer;
begin
Dirt := BitmapFromString(10, 3, 'z78DA333330313732321B52240' +
'0CF242437');
Dirt2 := BitmapFromString(11, 4, 'z78DA3331357632343719F124' +
'0001533809');
Dirt3 := BitmapFromString(11, 3, 'z78DA3331363635343019E224' +
'003E5B2731');
Dirt4 := BitmapFromString(25, 1, 'z78DA337636723634351E6424' +
'00B72620EA');
Dirt5 := BitmapFromString(27, 1, 'z78DA3331333637B43019C424' +
'00A5952170');
Dirt6 := BitmapFromString(22, 1, 'z78DA33713131323436195012' +
'0033DB1BAD');
Dirt7 := BitmapFromString(18, 1, 'z78DA33B33475353235A30B09' +
'0008A117A1');
Dirt8 := BitmapFromString(22, 1, 'z78DA333333753432361B5012' +
'004E531C1B');
repeat
Result := AutoColorThis(Dirt4, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt5, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt6, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt , Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt2, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt3, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt8, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt7, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then Tol := Tol +2
if Result < 500000 then Result := 0;
if Result > 3000000 then Result := 0;
until ((Result > 1) or (Tol > 60))
if Result < 1 then
begin
WriteLn('Dirt Color Not Found - Terminating script..');
TerminateScript;
end
WriteLn('DirtColor = '+IntToStr(Result)+' Found at a Tol of '+IntToStr(Tol));
DirtRoadColor := Result;
FreeBitmap(Dirt);
FreeBitmap(Dirt2);
FreeBitmap(Dirt3);
FreeBitmap(Dirt4);
FreeBitmap(Dirt5);
FreeBitmap(Dirt6);
FreeBitmap(Dirt7);
FreeBitmap(Dirt8);
end;
tarajunky
05-16-2007, 09:18 PM
If you test FindDirtRoadColor and it doesn't work, could you please post the color here, so I can update it? It is probably a minor fix.
XcanadamanX
05-16-2007, 09:19 PM
heres generic color:
4548987
3Garrett3
05-16-2007, 09:43 PM
mine doesnt find the color very often...
EDIT: Wow spork! that thing works amazingly! i love it! Worked first try with 6 tol and the second time with 12 tol, looks like my script is back on the road again!
rkroxpunk
05-17-2007, 07:08 AM
This is the find dirt I use, borrowed it from a yew cutter and I can't remember who made it. Its excellent and I would really like to know who created it so I can ask their permission to use it.
function MyFindDirt: integer;
var Dirt, Dirt2, Dirt3, Dirt4, Dirt5, Dirt6, Dirt7, Dirt8, Tol: integer;
begin
Dirt := BitmapFromString(10, 3, 'z78DA333330313732321B52240' +
'0CF242437');
Dirt2 := BitmapFromString(11, 4, 'z78DA3331357632343719F124' +
'0001533809');
Dirt3 := BitmapFromString(11, 3, 'z78DA3331363635343019E224' +
'003E5B2731');
Dirt4 := BitmapFromString(25, 1, 'z78DA337636723634351E6424' +
'00B72620EA');
Dirt5 := BitmapFromString(27, 1, 'z78DA3331333637B43019C424' +
'00A5952170');
Dirt6 := BitmapFromString(22, 1, 'z78DA33713131323436195012' +
'0033DB1BAD');
Dirt7 := BitmapFromString(18, 1, 'z78DA33B33475353235A30B09' +
'0008A117A1');
Dirt8 := BitmapFromString(22, 1, 'z78DA333333753432361B5012' +
'004E531C1B');
repeat
Result := AutoColorThis(Dirt4, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt5, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt6, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt , Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt2, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt3, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt8, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then
Result := AutoColorThis(Dirt7, Tol, 628 -Tol, 64 -Tol, 675 +Tol, 104 +Tol)
if Result < 1 then Tol := Tol +2
if Result < 500000 then Result := 0;
if Result > 3000000 then Result := 0;
until ((Result > 1) or (Tol > 60))
if Result < 1 then
begin
WriteLn('Dirt Color Not Found - Terminating script..');
TerminateScript;
end
WriteLn('DirtColor = '+IntToStr(Result)+' Found at a Tol of '+IntToStr(Tol));
DirtRoadColor := Result;
FreeBitmap(Dirt);
FreeBitmap(Dirt2);
FreeBitmap(Dirt3);
FreeBitmap(Dirt4);
FreeBitmap(Dirt5);
FreeBitmap(Dirt6);
FreeBitmap(Dirt7);
FreeBitmap(Dirt8);
end;
I bet it was Niesie's Yew cutter. He worked a lot on the dirt color because it was screwing up for him....his is prob the most popular yew cutter so check it out and then ask permission
nielsie95
05-17-2007, 08:14 AM
Yup, that's an (pretty old) DirtColorFinder of me :D.
There's actually a new DirtColorFinder in it now..
You guys have permission to use it, if you credit me right. :)
Markus
05-17-2007, 09:08 AM
I created another one using HSL bruteforcing, has never failed once for me.
function AutoDirtColor: Integer;
var
DaColors: TPointArray;
h, s, l: Extended;
i, clr, Time: Integer;
begin
if not loggedin then exit;
MarkTime(Time);
FindColorsSpiralTolerance(MMCX, MMCY, DaColors, 3760743, MMX1, MMY1, MMX2, MMY2, 50); //Spiral to reduce false positives
for i := 0 to GetArrayLength(DaColors) - 1 do
begin
clr := GetColor(DaColors[i].x, DaColors[i].y);
ColortoHSL(clr, h, s, l);
if (round(h) >= 9) and (round(h) <= 15) then
if (round(s) >= 27) and (round(s) <= 37) then
if (round(l) >= 20) and (round(l) <= 36) then
begin
Result := clr;
Writeln('AutoDirtColor = ' + inttostr(Result) + ' found in ' + inttostr(TimeFromMark(Time)) + ' ms');
Exit;
end else
begin
Writeln('Dirtcolor NOT found!');
end;
end;
end;
nielsie95
05-17-2007, 09:19 AM
Looks nice :)
Tested it, but it got the wrong color.
DirtColor was 1520453 and your function resulted in 2706778.
Markus
05-17-2007, 09:35 AM
Forgot to tell that it only works correctly when you're next to the road.
It works pretty well in my mindcrafter.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.