SRL Archive - Research & Development Lounge

Temporary Uptext Fix


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! :)

Wanted

2009-12-23 20:13:26

If you're in a location were the ground isn't yellowish or blueish all you need to do is replace isuptext with that color with tol 70 for blue and tol 50 for yellow then use InRange or > X amount with CountColorsTolerance.

It all depends on where you are and what other uptexts nearby can interfere.

Coh3n

2009-12-23 20:18:23

From: IceFire908
If you're in a location were the ground isn't yellowish or blueish all you need to do is replace isuptext with that color with tol 70 for blue and tol 50 for yellow then use InRange or > X amount with CountColorsTolerance.

It all depends on where you are and what other uptexts nearby can interfere.

Yeah, I just figured this way was more accurate, but both works. I'm just hoping the "temporary" is going to be temporary. :p

Sir R. M8gic1an

2009-12-24 09:41:29

http://www.villavu.com/forum/showthread.php?p=667219#post667219


will get the ranges and function for you…

~RM

Coh3n

2009-12-24 11:14:20

From: Rasta Magician
http://www.villavu.com/forum/showthread.php?p=667219#post667219


will get the ranges and function for you…

~RM


Oh nice, must have missed that. :p I'll edit my first post.