Coh3n
2009-12-23 20:09:04
Temporary Uptext Fix
EDIT: Go here -> http://www.villavu.com/forum/showthread.php?p=667219#post667219
Since a lot of people were asking about it, and I didn't see it posted anywhere else, I'll just post it here. Basically, it just looks for the color, counts the amount found, and checks if it's in a certain range. I've only tested it with the uptext "Chop down Willow", and it doesn't work every time.
{*******************************************************************************
function CorrectUptext( . . . ): Boolean;
By: Coh3n
Description: Returns true if the amount of colors found is in a specified
range.
*******************************************************************************}
function CorrectUptext(Color: Integer; hMod, sMod: Extended; Tol, minRange,
maxRange: Integer): Boolean;
var
countCols, curCTS: Integer;
begin
curCTS := GetColorToleranceSpeed;
SetColorSpeed2Modifiers(hMod, sMod);
{ You may need to edit the '150', depending on how long the text is. }
countCols :=
CountColorTolerance(Color, MSX1, MSY1, 150, 30, Tol);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(curCTS);
Result := InRange(countCols, minRange, maxRange);
end;
Obviously, you're going to have to play with the the tolerance/ranges a little to make it work the way you want. Remember to reload the RS client several times when picking colors. If you don't know already, Jagex has made it so the colors change every time the client is loaded. Here's the example I used on Willow trees:
{*******************************************************************************
function CorrectUptext( . . . ): Boolean;
By: Coh3n
Description: Returns true if the amount of colors found is in a specified
range.
*******************************************************************************}
function CorrectUptext(Color: Integer; hMod, sMod: Extended; Tol, minRange,
maxRange: Integer): Boolean;
var
countCols, curCTS: Integer;
begin
curCTS := GetColorToleranceSpeed;
SetColorSpeed2Modifiers(hMod, sMod);
countCols :=
CountColorTolerance(Color, MSX1, MSY1, 150, 30, Tol);
Writeln('Colors: ' + IntToStr(countCols) + '.');
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(curCTS);
Result := InRange(countCols, minRange, maxRange);
end;
var
i: Integer;
begin
SetupSRL;
ActivateClient;
for i := 1 to 20 do
begin
MMouse(223, 191, 5, 5);
Wait(RandomRange(300, 500));
if CorrectUptext(12830990, 0.08, 1.52, 25, 50, 100) then
Writeln('Found!');
MMouse(572, 263, 10, 10);
end;
end.
Enjoy! :)