SRL Archive - Outdated Tutorials

[#45] New AutoColor.scar


Coh3n

2010-05-29 09:47:38

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.

    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.

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

MylesMadness

2010-05-29 09:54:08

Yay!

ZephyrsFury

2010-05-30 03:35:54

Are you missing the normal grey road (eg the one at Rimmington and Draynor Village)?

Coh3n

2010-05-30 09:28:29

From: ZephyrsFury
Are you missing the normal grey road (eg the one at Rimmington and Draynor Village)?

Yes sir, I am. IIRC, those roads are slightly darker than the other road colors. The other city road colors may work, but I'm not sure. If they do, that'll have to work until I (or someone else) have the time to update them.

noidea

2010-05-30 11:37:56

Is it confirmed that FindTreeColor works?

Coh3n

2010-05-30 12:13:21

From: noidea
Is it confirmed that FindTreeColor works?

Worked well when I tested it. :) And it's AutoColor(srl_TreeColor); ;)

noidea

2010-06-03 14:42:12

From: Coh3n
Worked well when I tested it. :) And it's AutoColor(srl_TreeColor); ;)


Wooo thanks! :D