New AutoColor.scar
Hey everyone,
If you haven't noticed already, revision 510 has some new, long awaited, autocoloring functions. It has been purposely written to make it easy for the scripter. There are two functions that you'll need to worry about: AutoColorEx and AutoColor.
AutoColorEx(which: Integer): TAutoColorInfo;
- This function is more for the advanced scripters that want to use the different elements of the TAutoColorInfo record. See Globals.scar for the record.
AutoColor(which: Integer): Integer;
- This is what most of you will be using. Very simple to use as it's much like the old autocoloring.
SCAR Code:
procedure WalkOnVarrockRoad;
var
varrockRoadColor: Integer;
begin
varrockRoadColor := AutoColor(srl_VarrockRoadColor);
RadialWalkTolerance(varrockRoadColor, 186, 173, 70, 2 , 1, 10);
end;
The parameter "which" is determined from a list of constants in AutoColor.scar.
SCAR Code:
srl_VarrockRoadColor = 0;
srl_LumbridgeRoadColor = 1;
srl_FaladorRoadColor = 2;
srl_AlKharidRoadColor = 3;
srl_DarkDirtRoadColor = 4;
srl_LightDirtRoadColor = 5;
srl_SandColor = 6;
srl_WaterColor = 7;
srl_SwampWaterColor = 8;
srl_LadderColor = 9;
srl_RockColor = 10;
srl_MineRockColor = 11;
srl_TreeColor = 12;
I've personally tested every color, but more testing is always appreciated. There are a few things you should be aware of before using these functions:
- Due to the dynamically changing colors of basically everything on the minimap, it's highly recommended to use a tolerance when using functions like RadialWalking (RadialWalkTolerance). You should always use tolerance anyway, but this is just a heads up.
- There are a few colors (water, swamp water, sand color) that may require a higher tolerance then others, so experiment.
- I've attached a .zip file of all the .aca files that hold each array of colors. If for some reason, one of the colors isn't being found, I encourage to load the required file in ACA and add the new colors to the list. If you do this, post them here so they can be updated.
I thinks that's everything.
Enjoy,
The SRL Development Team