nielsie95
2007-04-07 11:20:03
What is the best way to AutoColor dirt?
I'm trying to AutoGrab the DirtColor above the Lumbridge Swamp (next to Draynor). The SRL-function doesn't work there or it gets the wrong color. I have tried a couple of things, but this is my latest try:
^ This will most of the time grab the right color at the Yews, but next to the Draynor Bank (where the Dirt begins) it will most of the time grab the wrong color. However, next to the bank, SRL FindDirtRoadColor works like 65% of the time (not if the color is too dark or too light :p).
So now my question: What is the best way to get the right color at both of those places?
I'm trying to AutoGrab the DirtColor above the Lumbridge Swamp (next to Draynor). The SRL-function doesn't work there or it gets the wrong color. I have tried a couple of things, but this is my latest try:
function FindDirt: 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('DirtRoadColor NOT found!');
WriteLn('Terminating script..');
TerminateScript;
end
WriteLn('DirtColor = '+IntToStr(Result)+' Found at a Tol of '+IntToStr(Tol));
FreeBitmap(Dirt);
FreeBitmap(Dirt2);
FreeBitmap(Dirt3);
FreeBitmap(Dirt4);
FreeBitmap(Dirt5);
FreeBitmap(Dirt6);
FreeBitmap(Dirt7);
FreeBitmap(Dirt8);
end; ^ This will most of the time grab the right color at the Yews, but next to the Draynor Bank (where the Dirt begins) it will most of the time grab the wrong color. However, next to the bank, SRL FindDirtRoadColor works like 65% of the time (not if the color is too dark or too light :p).
So now my question: What is the best way to get the right color at both of those places?