SRL Archive - Outdated Tutorials

[#46] RadialWalkAutoColor


Coh3n

2010-05-29 20:54:21

Just a simple function to go along with the new AutoColor.scar. This function just uses a TAutoColorInfo record to radial walk and is more accurate as it uses ColorToleranceSpeed(2).

Very simple to use:

RadialWalkAutoColor(srl_VarrockRoadColor, 45, 90, 60, 2, 2);

No need to set the CTS (if that's what you did before) or call an auto coloring function.

For reference:

function RadialWalkAutoColor(autoColorConst, sRad, eRad, r, modX, modY: Integer): Boolean;
var
acInfo: TAutoColorInfo;
curCTS: Integer;
hMod, sMod: Extended;
begin
curCTS := GetColorToleranceSpeed;
GetColorSpeed2Modifiers(hMod, sMod);

acInfo := AutoColorEx(autoColorConst);
with acInfo do
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(hueMod, satMod);

result := RadialWalkTolerance(color, sRad, eRad, r, modX, modY, lumTol);
end;

SetColorSpeed2Modifiers(hMod, sMod);
ColorToleranceSpeed(curCTS);
end;

Enjoy,
The Development Team

Sir R. M8gic1an

2010-06-08 13:57:48

Sexy!

edit: we are still at #42 tho ;)

~RM

Coh3n

2010-06-08 17:55:46

From: Rasta Magician
Sexy!

edit: we are still at #42 tho ;)

~RM

Yeah, I know, but I just kept adding to the previous number so it would appear at the top. Lol