PDA

View Full Version : A tutorial to New Auto Color



Shuttleu
07-12-2010, 06:31 PM
NewAutoColor.scar is a way of autocoloring symbols on the MM by getting only one color. So for example, you can get the color of a rock, and by getting the color of the rock you can get the color of many other symbols on the MM without having to AutoColor them

The colors that you can AutoColor are

grey rock
brown rock
bank symbol
anvil symbol
magic shop symbol
clothes shop symbol
quest symbol
mining symbol
plate symbol
general store
transport
palm tree green(VEB is surrounded by them)
fishing spot symbol
farming spot symbol
guide symbol
cooking range
green tree(the roundish green trees on the minimap)
training dummy

There are 3 main functions that you need to know about NewAutoColor.scar

These are
procedure SetupNewAutoColor;
procedure SetAutoColorReference(Name: string; Color: Integer);
function srl_AutoGetColor(Name: string): Integer;

Before you use NewAutoColor you need to run
SetupNewAutoColor;
What this does is it sets the constants, loads the colors and sets other variables that are needed

Next you need to set the variable that will get you the colors for all the other symbols that you can get from NewAutoColor.scar

To do this you need

procedure SetAutoColorReference(Name: string; Color: Integer);
this is easy to use

You get the color of one of the symbols or items on the MM and use it like so

TempRockColor:= GetRockColor;
if (TempRockColor > 0) then
SetAutoColorReference('grey rock', TempRockColor);


This is just an example of how to use it.
REMEMBER, to use the above, there MUST be a grey rock on the MM that it can AutoColor

From here you have everything that you need set up

So to get the color of the general store you can do the following
srl_AutoGetColor('general store');

So a way that you can use this is
FindColor(x, y, srl_AutoGetColor('general store'), MMX1, MMY1, MMX2, MMY2);

Because it gets the color of the store symbol, you do not need to set tolerance :)

The only downside to this is if Jagex decide to change the relationship between the symbol colours.

There are other functions that you can use
For example
srl_AutoGetColorsMulti(Name: TStringArray): TIntegerArray;

You can use this like so
var
TheSymbolColors: TIntegerArray;
begin
TheSymbolColors:= srl_AutoGetColors(['magic shop symbol', 'clothes shop symbol', 'quest symbol', 'mining symbol']);


This way

TheSymbolColors[0] will equal magic shop symbol
TheSymbolColors[1] will equal clothes shop symbol
TheSymbolColors[2] will equal quest symbol
TheSymbolColors[3] will equal mining symbol

Well thats the end of my tutorial

If you have any questions or queries then ask away and i will answer then ASAP

~shut

Sir R. M8gic1an
07-12-2010, 07:02 PM
TheSymbolColors[0] will equal magic shop symbol
TheSymbolColors[0] will equal clothes shop symbol
TheSymbolColors[0] will equal quest symbol
TheSymbolColors[0] will equal mining symbol


Nice tut. That ^ needs fixing.

~RM

Shuttleu
07-12-2010, 07:06 PM
TheSymbolColors[0] will equal magic shop symbol
TheSymbolColors[0] will equal clothes shop symbol
TheSymbolColors[0] will equal quest symbol
TheSymbolColors[0] will equal mining symbol


Nice tut. That ^ needs fixing.

~RM

thanks for pointing that out

Rep++

~shut

MylesMadness
07-12-2010, 07:25 PM
So. Much. Win.

This is the system I just made and here it is better then how I made it. How can I add stuff to it? I will add a bunch probably

Shuttleu
07-12-2010, 07:37 PM
Look here: http://villavu.com/forum/showthread.php?p=723550

~shut

MylesMadness
07-12-2010, 08:43 PM
I would also like to note that all road colors seem to work in this system.

King of Knives
07-12-2010, 09:12 PM
There are other functions that you can use
For example
srl_AutoGetColors(Name: string): TIntegerArray;


Great, simple tutorial. Also, the content seems pretty neat.
One thing, though: The param in this function is a string-array, right? Not just a string. You definitely use a string-array in the example below, and it makes much more sense.

Of course a minor mistake, and it doesn't change the fact that it's cool as hell.

-Knives

Shuttleu
07-12-2010, 10:54 PM
Great, simple tutorial. Also, the content seems pretty neat.
One thing, though: The param in this function is a string-array, right? Not just a string. You definitely use a string-array in the example below, and it makes much more sense.

Of course a minor mistake, and it doesn't change the fact that it's cool as hell.

-Knives

Thanks for pointing that out, i just had a look at the include and it seems its not a TStringArray like i tought it was... :(
me thinks someone should change the include

~shut

EDIT: im trying to get the include changed here http://villavu.com/forum/showthread.php?t=57867

BraK
07-15-2010, 06:12 AM
Nice Tut shut I think I might be able to use this with my next script as a fail safe for some of my walking procedures. Short and sweet