SRL Archive - OSR Outdated Tutorials

Using SRL's SmartColors for object finding


Sir R. M8gic1an

2009-11-21 12:50:14

Smart Colors!
https://github.com/SRL/SRL-5/blob/master/srl/misc/smartcolors.simba



Introduction
[INDENT]I am extremely happy and proud to present the SmartColors.simba include. This is an Artificial Inteligence object finding method, but no need to be scared, as it is extremely simple to use. For basic use, you only need to worry about 2 functions:

procedure MakeObj(MyName: string; MyColor, MyTol: integer; MyHue, MySat: extended; MyUpTexts, MyOptions: TStringArray);

function SmartColors(FindWhat: string): boolean;

All you need to do is call MakeObj once before calling SmartColors, (I'd suggest at the start of the script) and then you just call SmartColors whenever you want to find something.

Here is how I used it:

{$i SRL\Misc\SmartColors.simba}

MakeObj('tree', 4689280, 9, 0.05, 0.74, ['n Tr', 'ree', 'hop', 'own'], ['hop down']);
SmartColors('tree');
NOTE: The name you give the object is the name you have to call.
NOTE: SmartColors finds and clicks the tree.[/INDENT]


History
[INDENT]Long story made short, a couple of years ago Tarajunky made a post about a new system he called SmartColors. It got me very interested and I learnt it straight from him and his ChickenKiller. I then developed a SmartColors function which never got into SRL, but still worked fairly well and I used it in the first version of RM Chopper. I then made a few threads about it and it caught EvilChicken's attention. EC then used his own version in his agility script. Since then, we've often enough attempted to develop a propper include for SRL with SmartColors. Here it finally is.[/INDENT]


The SmartColors 'Algorithm'
[INDENT]SmartColors, as the name suggests, is smart and therefore learns and becomes better the more often it is called. The first time it is called, it will do a normal TPA finding and it will gather colors which are similar and close to the color you provided it with.
It will then scan the MainScreen to see how unique these colors are. If they are rare enough, it will add them to an array of colors.
Once added to this array of colors, it chooses the rarest of them to pass it on to a final array. You now have your SCArray ready (SmartColorsArray).

Being done with picking all the best colors, you will now see the big difference between this system and previous ones. You will search for one color at a time from the SCArray with no tolerance. Usually, searching for even just the first color with 0 tol will be enough to find your object, making search times as low as 0 ms.

If it does not find your object without tolerance, it will then go through all the colors again, this time with tolerance. This rarely happens.

The speed is a big factor, but even more than that, SmartColors updates the SCArray as it runs; When it finds your object by a certain color, it will move that color up in the SCArray, meaning that next time it will search with this color sooner. What this means is that the best colors will eventually be the first ones to be searched for.

And finally, when searching with tolerance and it finds the object, it analyses the new color, and if the color is unique enough and within tolerance range it will add it to the SCArray, meaning that SmartColors also learns about new colors to use.[/INDENT]


Advanced Use of SmartColors
[INDENT]SmartColors if not setup will use the default SC_ constants values, however, you can set these up yourself if you wish.

type
{Type TSCDetails
Description: Extra Object details; Can set them up or leave it to default values }
TSCDetails = record
IsSCSetup : boolean; //do not touch, let SC know if you are using custom or default values
UNIQUE_COLOR_MIN : integer; //the mininum amount of color for it to join the SC array
UNIQUE_COLOR_MAX : integer; //same as above for maximum
MAX_COLORS_IN_ARRAY : integer; //max length of SC Array
HALF_BOX_SIZE : integer; //half box size of object you are searching
USE_TOL : integer; //tolerance for your object
TPA_DIST : integer; //max distanc between points
CLICK_STYLE : integer; //how to click your object. Check consts
RANDOM_RL_CHANCE : integer; // x/100 to do R Click instead of L click
end;

It is extremely simple to set them up as all you have to do is call one single function:

procedure SetupSmartColorsDetails(Name: string; ColorMin, ColorMax, MaxColors, BoxSize, Tol, Dist, ClickStyle, R_RL_Chance: integer);

And here are the default values:

SC_UNIQUE_COLOR_MIN = 5;
SC_UNIQUE_COLOR_MAX = 20;
SC_MAX_COLORS_IN_ARRAY = 7;
SC_HALF_BOX_SIZE = 25;
SC_USE_TOL = 5;
SC_TPA_DIST = 5;
SC_CLICK_STYLE = 3;
SC_RANDOM_RL_CHANCE = 20; // x / 100 for R click

So finally, for an advanced use of SmartColors here is your code:

MakeObj('clay', 5215677, 17, 0.01, 1.01, ['ine', 'ock'], ['ine']);
SetupSmartColorsDetails('clay', 3, 15, 7, 15, 5, 5, 3, 15);
SmartColors('clay');
[/INDENT]


And so, I hope to see people using this new system as it is extremely fast, accurate and very easy to use.

Lots o' Love,
The Dev Team

Coh3n

2009-11-21 12:56:26

Wow, when I read the include, I didn't think it would be that easy to use. Very nice! :biggrin:

Naum

2009-11-21 12:57:18

Great work!
Will be definitely using this in my next script :)

NCDS

2009-11-21 13:01:53

Very nice RM.

I may mess with this once I update my 99 mage script

noidea

2009-11-21 13:09:09

Simply Beautiful. Lovely code.

Good job RM :)

Rick

2009-11-21 13:11:00

Amazing, will definitely use this ! :)
Thanks.

mixster

2009-11-21 13:17:37

Sounds nice, but disappointed at string identifiers. Constant integers would've been nicer imo and made it easier for scripters as the slight differences in string names may cause problems (haven't read through, but I assume at the least it will give a runtime writeln saying that it doesn't exist or at worst cause a crash of some kind).

Sir R. M8gic1an

2009-11-21 13:22:42

From: mixster
Sounds nice, but disappointed at string identifiers. Constant integers would've been nicer imo and made it easier for scripters as the slight differences in string names may cause problems (haven't read through, but I assume at the least it will give a runtime writeln saying that it doesn't exist or at worst cause a crash of some kind).


I recon it would crash. Constant identifiers weren't really the best option in my opinion, as I was aiming for ease of use ;) Also, there was very little point in constants, as there are no actually pre-made records, the scripter has to construct them themselves.

edit: Added failsafe, no longer crashes, sends an SRL_warning and exits smart colors

~RM

TRiLeZ

2009-11-21 15:40:46

Wonderful job RM! I can't wait to use this. :)

mixster

2009-11-21 15:56:52

It just means that the scripter has to remember which string he is using or setup a const for it, which means that an integer one would have been just as easy.

Sir R. M8gic1an

2009-11-21 16:01:44

From: mixster
It just means that the scripter has to remember which string he is using or setup a const for it, which means that an integer one would have been just as easy.


easier to remember 'mithril' rather than 10 I recon. Also, 'mithril' is more reader-friendly than 10.

~RM

mormonman

2009-11-21 17:00:06

From: Rasta Magician
easier to remember 'mithril' rather than 10 I recon. Also, 'mithril' is more reader-friendly than 10.

~RM


Don't we use player[].integers[] as numbers? I honestly don't think that it would be that user unfriendly…

Nice job.

mixster

2009-11-21 18:00:06

const mithril = 10;

or, even better, sc_mithril = 10; sc_coal = 11; sc_ *ctrl+space* => all the smart colours defined.

senrath

2009-11-21 18:19:26

From: mixster
const mithril = 10;

or, even better, sc_mithril = 10; sc_coal = 11; sc_ *ctrl+space* => all the smart colours defined.


Well, you can do constant strings too, if you're dead set on using constants.

Naike

2009-11-21 18:39:17

You're too sexy.
Just watching this makes me wanna go create a script :I
Rep++ for this, awesome.

(I don't go like this everyday, so you better be proud >;I )

mixster

2009-11-21 18:47:42

you could do constant strings, but then the whole point of using strings to be user friendly kind of goes down the drain.

Gu3st...

2009-11-21 19:11:34

Amazing piece of art right there! Great job RM! :D
I love how it works, I'll test it asap :)
(I ran scar on my friends computer today and stupid avarst antivirus deleted scar.exe… <_<)

Rick

2009-11-21 20:01:21

I just tested this out and it works wonderfully.

MylesMadness

2009-11-21 20:29:56

VERY sexy
I would have done:
I:=MakeObj(4689280, 9, 0.05, 0.74, ['n Tr', 'ree', 'hop', 'own'], ['hop down']);
But what ever

Sir R. M8gic1an

2009-11-22 07:03:28

Ok guys, I have added an advanced setup to the include and explained it in the tutorial :) This should be the finalized version of Smartcolors:)

~RM

Gu3st...

2009-11-22 10:34:38

From: Rasta Magician
Ok guys, I have added an advanced setup to the include and explained it in the tutorial :) This should be the finalized version of Smartcolors:)

~RM
Good job :)
Nicely explained and it seems extremely easy to use :O <3 your work RM :redface:

mastaraymond

2009-11-22 11:28:11

Very nice, always good to see some innovation in SRL!

tarajunky

2009-11-22 18:27:48

Tremendous work. I'm proud of designing the strategy, but you've really made it shine.

Nava2

2009-11-22 18:41:32

Perhaps it should just return an x, y and not click..

mixster

2009-11-22 20:37:40

Isn't one of the great things about SRL that it is open sauce? Go in and alter it to return a point :)

Camaro'

2009-11-22 21:38:20

Great work! 100% using this! :)

@Mixster, editing srl mean that if you release a script, user has to edit srl to.

Sir R. M8gic1an

2009-11-22 21:39:20

From: Nava2
Perhaps it should just return an x, y and not click..


I guess an option to not click could be added, although I don't see why you'd want this.

Also thanks for the comments :)

Finally, I've altered it to accept a variant as identifier, which keeps simplicity of use for newbies and keeps the more advanced constant-users happy.

~RM

Nava2

2009-11-22 21:51:32

Because clicking should be customizable, this is too much like
MineRock();
Bank();
GoToMine();
//...

Clicking is something important that I believe should be done individually in a script.

E: oh, and do the new versions return an integer when you declare the object? Can't look atm.

Sir R. M8gic1an

2009-11-22 22:06:28

From: Nava2
Because clicking should be customizable, this is too much like
MineRock();
Bank();
GoToMine();
//...

Clicking is something important that I believe should be done individually in a script.

E: oh, and do the new versions return an integer when you declare the object? Can't look atm.


Ways of clicking….
- Left Click
- Right Click + Choose Option
- One of the above with a Random percentage

All of them included…

And to the second question, no.

SmartColors(ROCK_MITHRIL), not I := MakeObj(…); SmartColors(I);

~RM

Nava2

2009-11-22 22:24:47

From: Rasta Magician
Ways of clicking….
- Left Click
- Right Click + Choose Option
- One of the above with a Random percentage

All of them included…

And to the second question, no.

SmartColors(ROCK_MITHRIL), not I := MakeObj(…); SmartColors(I);

~RM


Why not just make it return an integer, and you don't have to use it if you don't want to?

The 0.00001 ms delay of variable assigning the one time per creation seems worthwhile to me :) That way you can still use the constants/vars during runtime.

Sir R. M8gic1an

2009-11-22 22:47:19

From: Nava2
Why not just make it return an integer, and you don't have to use it if you don't want to?

The 0.00001 ms delay of variable assigning the one time per creation seems worthwhile to me :) That way you can still use the constants/vars during runtime.


Because you already can use constants, in case you forgot what a variant is :) Also, you'd have me edit a lot of code for something that is barely useful :)

also, http://www.villavu.com/forum/showthread.php?p=658411#post658411

~RM

wesleyxD

2009-11-23 10:41:42

can i use this function for finding bankchest at castlewars?
i just want use it as find function i dont want it click on it.

mormonman

2009-11-23 16:21:14

From: wesleyxD
can i use this function for finding bankchest at castlewars?
i just want use it as find function i dont want it click on it.


It would probably be smarter(hah) to make a custom function for that, but yes you could.

Coh3n

2010-02-25 10:46:56

I'm have problems trying to use this. I made an object of the Draynor bank booth. The finding works awesome, it always moves the mouse to the closest booth first, but it never clicks.

program New;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/misc/SmartColors.scar}

const
DRAY_BANK_BOOTH = 0;

procedure CreateMSObject(theObject: Integer);
begin
case theObject of
DRAY_BANK_BOOTH:
begin
MakeObj(DRAY_BANK_BOOTH, 6909561, 7, 0.45, 0.50, ['ooth'], ['uickly']);
SetupSmartColorsDetails(DRAY_BANK_BOOTH, 80, 200, 10, 15, 7, 5, RIGHT_CLICK, 0);
end;
end;
end;

begin
Smart_Server := 152;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;

SetupSRL;
ActivateClient;

CreateMSObject(DRAY_BANK_BOOTH);
SmartColors(DRAY_BANK_BOOTH);

Wait(RandomRange(250, 500));
if (BankScreen) then
Writeln('Yay!')
else
Writeln('Awe!');
end.
When I set the uptext to 'alk' (which is not what I want), I get this:

SRL Compiled in 15 msec
SMART Initialized.
Loaded: Server 152, Members: False, Signed: True, Super Detail: False.
SC Array: 0
first finder
found text
gathering colors
unable to gather colors
Uptext: Use Bank booth / 4 more options
found text
gathering colors
in color gatherer
Analyse 5856616: 210
Analyse 6053989: 210
Analyse 6185578: 210
Analyse 6514797: 210
Analyse 6054246: 210
Analyse 6251367: 210
Analyse 5988456: 210
Analyse 6383212: 210
Analyse 6251371: 210
Analyse 6382698: 210
Analyse 6316907: 210
Analyse 6054247: 210
Analyse 6185582: 210
Analyse 6711924: 210
Analyse 7238266: 210
Analyse 7698558: 210
Analyse 6185586: 210
Analyse 6580603: 210
Analyse 6382963: 210
Analyse 6382962: 210
Analyse 5856621: 210
Analyse 6185587: 210
Analyse 5922412: 210
Analyse 6580599: 210
Analyse 6383211: 210
Analyse 6185579: 210
Analyse 7040627: 210
Analyse 6316916: 210
Analyse 6317173: 210
Analyse 6251123: 210
Analyse 7106683: 210
Analyse 6712180: 210
Analyse 7238011: 210
Analyse 6185584: 210
Analyse 6777979: 210
Analyse 6975094: 210
Analyse 5988458: 210
Analyse 6514544: 210
Analyse 7303803: 210
Analyse 7632765: 210
Analyse 6119526: 210
Analyse 6645871: 210
Analyse 6909043: 210
Analyse 6251630: 210
Analyse 7106165: 210
Analyse 6382956: 210
Analyse 6580334: 210
Analyse 6449005: 210
Analyse 6317160: 210
Analyse 6251369: 210
Analyse 6383215: 210
Analyse 6251111: 210
Analyse 6119785: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 7238011: 210
Analyse 6185584: 210
Analyse 6777979: 210
Analyse 6975094: 210
Analyse 5988458: 210
Analyse 6514544: 210
Analyse 7303803: 210
Analyse 7632765: 210
Analyse 6119526: 210
Analyse 6645871: 210
Analyse 6909043: 210
Analyse 6251630: 210
Analyse 7106165: 210
Analyse 6382956: 210
Analyse 6580334: 210
Analyse 6449005: 210
Analyse 6317160: 210
Analyse 6185578: 210
Analyse 6251369: 210
Analyse 6383215: 210
Analyse 6251111: 210
Analyse 6185579: 210
Analyse 7238266: 210
Analyse 6119785: 210
Analyse 6185576: 210
Analyse 6119788: 210
Analyse 5856873: 210
Analyse 6974835: 210
Analyse 6119791: 210
Analyse 5922666: 210
Analyse 6053996: 210
Analyse 7435387: 210
Analyse 6119781: 210
Analyse 5922664: 210
Analyse 5856870: 210
Analyse 6119784: 210
Analyse 5988457: 210
Analyse 5922662: 210
Analyse 5988201: 210
Analyse 6054246: 210
Analyse 6053990: 210
Analyse 6711920: 210
Analyse 6317161: 210
Analyse 6711919: 210
Analyse 6185317: 210
Analyse 6514540: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
unable to gather colors
Uptext: Use Bank booth / 4 more options
Successfully executed
When I set it to 'ooth', I get this:

SRL Compiled in 16 msec
SMART Initialized.
Loaded: Server 152, Members: False, Signed: True, Super Detail: False.
SC Array: 0
first finder
found text
gathering colors
in color gatherer
Analyse 5988458: 210
Analyse 6383212: 210
Analyse 6185578: 210
Analyse 6514797: 210
Analyse 6054246: 210
Analyse 5988456: 210
Analyse 6316907: 210
Analyse 6054247: 210
Analyse 6185582: 210
Analyse 6711924: 210
Analyse 7238266: 210
Analyse 7698558: 210
Analyse 6185586: 210
Analyse 6580603: 210
Analyse 6382963: 210
Analyse 6382962: 210
Analyse 5988453: 210
Analyse 6054000: 210
Analyse 6449015: 210
Analyse 6316651: 210
Analyse 5988454: 210
Analyse 6185579: 210
Analyse 6316915: 210
Analyse 6975104: 210
Analyse 6646395: 210
Analyse 6449012: 210
Analyse 6843514: 210
Analyse 5922666: 210
Analyse 7303803: 210
Analyse 6580339: 210
Analyse 7303545: 210
Analyse 5725032: 210
Analyse 5922410: 210
Analyse 6449007: 210
Analyse 6119525: 210
Analyse 6316906: 210
Analyse 6974838: 210
Analyse 7238008: 210
Analyse 7172215: 210
Analyse 6119786: 210
Analyse 6646387: 210
Analyse 6514544: 210
Analyse 6382956: 210
Analyse 6842994: 210
Analyse 6119788: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 5988453: 210
Analyse 6054000: 210
Analyse 6449015: 210
Analyse 6316651: 210
Analyse 5988454: 210
Analyse 6185579: 210
Analyse 6316915: 210
Analyse 6975104: 210
Analyse 6646395: 210
Analyse 6449012: 210
Analyse 6843514: 210
Analyse 5922666: 210
Analyse 7303803: 210
Analyse 6580339: 210
Analyse 7303545: 210
Analyse 5725032: 210
Analyse 5922410: 210
Analyse 6449007: 210
Analyse 6119525: 210
Analyse 6316906: 210
Analyse 6974838: 210
Analyse 7238008: 210
Analyse 6185578: 210
Analyse 7172215: 210
Analyse 5988456: 210
Analyse 6119786: 210
Analyse 6646387: 210
Analyse 6514544: 210
Analyse 6382956: 210
Analyse 6842994: 210
Analyse 6119788: 210
Analyse 6449005: 210
Analyse 6842992: 210
Analyse 5988460: 210
Analyse 6119787: 210
Analyse 6054249: 210
Analyse 6053996: 210
Analyse 7304056: 210
Analyse 6119781: 210
Analyse 5922664: 210
Analyse 5856870: 210
Analyse 5988457: 210
Analyse 5922662: 210
Analyse 6382955: 210
Analyse 5922661: 210
Analyse 6053990: 210
Analyse 6711920: 210
Analyse 6317161: 210
Analyse 6185317: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 5988461: 210
Analyse 6975105: 210
Analyse 6909311: 210
Analyse 7698559: 210
Analyse 6251120: 210
Analyse 8158856: 210
Analyse 6711932: 210
Analyse 6580603: 210
Analyse 6909312: 210
Analyse 6974584: 210
Analyse 6777724: 210
Analyse 5988207: 210
Analyse 6317173: 210
Analyse 6382959: 210
Analyse 6448757: 210
Analyse 6646139: 210
Analyse 5988456: 210
Analyse 5725034: 210
Analyse 7830407: 210
Analyse 6448749: 210
Analyse 6974843: 210
Analyse 5856618: 210
Analyse 6317171: 210
Analyse 7500923: 210
Analyse 6449008: 210
Analyse 6251379: 210
Analyse 7369337: 210
Analyse 5791082: 210
Analyse 5922666: 210
Analyse 5725032: 210
Analyse 5988198: 210
Analyse 6251371: 210
Analyse 5790823: 210
Analyse 7172219: 210
Analyse 7304063: 210
Analyse 6712180: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 5790823: 210
Analyse 7172219: 210
Analyse 6251371: 210
Analyse 6317171: 210
Analyse 7304063: 210
Analyse 6712180: 210
Analyse 5856621: 210
Analyse 6449014: 210
Analyse 5725032: 210
Analyse 6514553: 210
Analyse 6580603: 210
Analyse 6646134: 210
Analyse 7238015: 210
Analyse 8159113: 210
Analyse 7830409: 210
Analyse 6185061: 210
Analyse 6646391: 210
Analyse 6251116: 210
Analyse 5922406: 210
Analyse 5922664: 210
Analyse 6251372: 210
Analyse 5922407: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 7106681: 210
Analyse 6580333: 210
Analyse 5988202: 210
Analyse 6909302: 210
Analyse 5725289: 210
Analyse 6646395: 210
Analyse 6449014: 210
Analyse 6843515: 210
Analyse 6053997: 210
Analyse 6251380: 210
Analyse 6514553: 210
Analyse 6711929: 210
Analyse 7238017: 210
Analyse 6316915: 210
Analyse 6515063: 210
Analyse 5856871: 210
Analyse 5922413: 210
Analyse 7040896: 210
Analyse 6514810: 210
Analyse 7106171: 210
Analyse 6974578: 210
Analyse 8159113: 210
Analyse 7830409: 210
Analyse 6448492: 210
Analyse 7171959: 210
Analyse 6185581: 210
Analyse 5791080: 210
Analyse 5922406: 210
Analyse 5922664: 210
Analyse 6251372: 210
Analyse 5922407: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 5922661: 210
Analyse 6975091: 210
Analyse 6448490: 210
Analyse 5988202: 210
Analyse 6514539: 210
Analyse 6251372: 210
Analyse 6317419: 210
Analyse 6317164: 210
Analyse 6317162: 210
Analyse 6382956: 210
Analyse 6119785: 210
Analyse 6251370: 210
Analyse 5988454: 210
Analyse 5988453: 210
Analyse 6185577: 210
Analyse 6777711: 210
Analyse 6119784: 210
Analyse 7304057: 210
Analyse 6711923: 210
Analyse 6185575: 210
Analyse 6119786: 210
Analyse 6251113: 210
Analyse 5856614: 210
Analyse 6185320: 210
Analyse 6185836: 210
Analyse 6054247: 210
Analyse 6185583: 210
Analyse 6382185: 210
Analyse 6514543: 210
Analyse 6449005: 210
Analyse 6251378: 210
Analyse 6382966: 210
Analyse 6382962: 210
Analyse 6711920: 210
Analyse 6185587: 210
Analyse 6514809: 210
Analyse 6383222: 210
Analyse 6712179: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 6317170: 210
Analyse 6449013: 210
Analyse 6185579: 210
Analyse 6843504: 210
Analyse 7961479: 210
Analyse 6119787: 210
Analyse 5790826: 210
Analyse 6909310: 210
Analyse 6383223: 210
Analyse 6975105: 210
Analyse 5988462: 210
Analyse 5856620: 210
Analyse 7698561: 210
Analyse 6514553: 210
Analyse 6580346: 210
Analyse 6711932: 210
Analyse 6843256: 210
Analyse 6909312: 210
Analyse 6974584: 210
Analyse 6580603: 210
Analyse 5988207: 210
Analyse 6317173: 210
Analyse 6777725: 210
Analyse 6448493: 210
Analyse 7369859: 210
Analyse 6382706: 210
Analyse 6053475: 210
Analyse 5790823: 210
Analyse 7698564: 210
Analyse 6119781: 210
Analyse 6974579: 210
Analyse 6317171: 210
Analyse 6251378: 210
Analyse 7040373: 210
Analyse 6053996: 210
Analyse 6119793: 210
Analyse 7106165: 210
Analyse 6053997: 210
Analyse 5791082: 210
Analyse 6711663: 210
Analyse 7895939: 210
Analyse 5922666: 210
Analyse 5725032: 210
Analyse 5922664: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 6251378: 210
Analyse 6382966: 210
Analyse 6185583: 210
Analyse 6382962: 210
Analyse 6711920: 210
Analyse 6185587: 210
Analyse 6514809: 210
Analyse 6383222: 210
Analyse 6712179: 210
Analyse 7040627: 210
Analyse 6382709: 210
Analyse 6909568: 210
Analyse 7501186: 210
Analyse 6712183: 210
Analyse 6119785: 210
Analyse 7040373: 210
Analyse 5987945: 210
Analyse 7698566: 210
Analyse 8093321: 210
Analyse 5987946: 210
Analyse 6646389: 210
Analyse 5988458: 210
Analyse 6580336: 210
Analyse 7303803: 210
Analyse 7238008: 210
Analyse 6251374: 210
Analyse 6580078: 210
Analyse 6251630: 210
Analyse 6382698: 210
Analyse 7106423: 210
Analyse 7106165: 210
Analyse 6119783: 210
Analyse 6053993: 210
Analyse 6382958: 210
Analyse 6251370: 210
Analyse 6054247: 210
Analyse 6382957: 210
Analyse 5922665: 210
Analyse 6580334: 210
Analyse 6185579: 210
Analyse 6185322: 210
Analyse 6185581: 210
Analyse 6448750: 210
Analyse 6317418: 210
Analyse 6054250: 210
Analyse 6383214: 210
Analyse 6185582: 210
Analyse 5988200: 210
Analyse 6317421: 210
Analyse 6185578: 210
Analyse 5988456: 210
Analyse 5791082: 210
Analyse 6054253: 210
Analyse 5922408: 210
Analyse 5988457: 210
Analyse 6251626: 210
Analyse 6317162: 210
Analyse 6251627: 210
Analyse 5922664: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 6382697: 210
Analyse 6251113: 210
Analyse 6711918: 210
Analyse 6449013: 210
Analyse 7830404: 210
Analyse 6711931: 210
Analyse 6119790: 210
Analyse 6514809: 210
Analyse 6580601: 210
Analyse 5725034: 210
Analyse 6514553: 210
Analyse 6580346: 210
Analyse 6383223: 210
Analyse 6646134: 210
Analyse 6777723: 210
Analyse 6974584: 210
Analyse 6514550: 210
Analyse 6646395: 210
Analyse 6119794: 210
Analyse 7040634: 210
Analyse 7698823: 210
Analyse 6119789: 210
Analyse 6053997: 210
Analyse 6185581: 210
Analyse 7566973: 210
Analyse 6317170: 210
Analyse 6119786: 210
Analyse 6448750: 210
Analyse 7238009: 210
Analyse 6185575: 210
Analyse 6054250: 210
Analyse 6119785: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 6054247: 210
Analyse 6185577: 210
Analyse 5856614: 210
Analyse 6251625: 210
Analyse 6054248: 210
Analyse 5988202: 210
Analyse 6514539: 210
Analyse 6383213: 210
Analyse 6580590: 210
Analyse 6120039: 210
Analyse 6382956: 210
Analyse 6119785: 210
Analyse 6185574: 210
Analyse 6580591: 210
Analyse 6185325: 210
Analyse 5988454: 210
Analyse 5988458: 210
Analyse 6119783: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 6251373: 210
Analyse 7632771: 210
Analyse 6251377: 210
Analyse 8224648: 210
Analyse 6909310: 210
Analyse 5988461: 210
Analyse 6646395: 210
Analyse 6514553: 210
Analyse 5922155: 210
Analyse 6251121: 210
Analyse 6251120: 210
Analyse 5725035: 210
Analyse 5922414: 210
Analyse 6777724: 210
Analyse 6054257: 210
Analyse 6316911: 210
Analyse 6777725: 210
Analyse 5988206: 210
Analyse 6646139: 210
Analyse 6382956: 210
Analyse 6842993: 210
Analyse 7567236: 210
Analyse 6382447: 210
Analyse 6317171: 210
Analyse 5725033: 210
Analyse 6449008: 210
Analyse 7172218: 210
Analyse 5988203: 210
Analyse 6449012: 210
Analyse 6711919: 210
Analyse 6185584: 210
Analyse 6382955: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 6119783: 210
Analyse 6119784: 210
Analyse 6185579: 210
Analyse 6251626: 210
Analyse 6448490: 210
Analyse 6843249: 210
Analyse 6449008: 210
Analyse 6842993: 210
Analyse 6316906: 210
Analyse 6251373: 210
Analyse 6382958: 210
Analyse 6185583: 210
Analyse 7040629: 210
Analyse 6053995: 210
Analyse 6251372: 210
Analyse 6316911: 210
Analyse 6251378: 210
Analyse 5988458: 210
Analyse 6316916: 210
Analyse 6514810: 210
Analyse 6383221: 210
Analyse 6514550: 210
Analyse 6580853: 210
Analyse 6777725: 210
Analyse 6909312: 210
Analyse 6711931: 210
Analyse 6251368: 210
Analyse 7106425: 210
Analyse 6185331: 210
Analyse 5988460: 210
Analyse 6382959: 210
Analyse 6119785: 210
Analyse 7040373: 210
Analyse 6842995: 210
Analyse 6448755: 210
Analyse 5987945: 210
Analyse 5922410: 210
Analyse 6317161: 210
Analyse 6580336: 210
Analyse 7238008: 210
Analyse 6317167: 210
Analyse 6909043: 210
Analyse 6251630: 210
Analyse 6382698: 210
Analyse 7369593: 210
Analyse 7106165: 210
Analyse 7237753: 210
Analyse 6580594: 210
Analyse 6777714: 210
Analyse 6251370: 210
Analyse 6054247: 210
Analyse 6317166: 210
Analyse 7304059: 210
Analyse 6317160: 210
Organizing colors
Done organizing
unable to gather colors
Uptext: Walk here / 1 more options
Uptext: Walk here / 2 more options
Uptext: Walk here / 1 more options
Uptext: Walk here / 1 more options
Uptext: Walk here / 1 more options
found text
gathering colors
in color gatherer
Analyse 6382955: 210
Analyse 6383213: 210
Analyse 6185319: 210
Analyse 6975091: 210
Analyse 7040630: 210
Analyse 7895937: 210
Analyse 5988202: 210
Analyse 7238015: 210
Analyse 6974835: 210
Analyse 5790825: 210
Analyse 7895942: 210
Analyse 7106428: 210
Analyse 6711930: 210
Analyse 5725034: 210
Analyse 5856620: 210
Analyse 6054253: 210
Analyse 6316915: 210
Analyse 6119793: 210
Analyse 6843518: 210
Analyse 5922670: 210
Analyse 6646126: 210
Analyse 5922413: 210
Analyse 6449017: 210
Analyse 6580603: 210
Analyse 7238275: 210
Analyse 6185061: 210
Analyse 7566979: 210
Analyse 6251116: 210
Analyse 6317166: 210
Analyse 6119786: 210
Analyse 6580593: 210
Organizing colors
Done organizing
unable to gather colors
found text
gathering colors
in color gatherer
Analyse 5988458: 210
Analyse 6580336: 210
Analyse 7238008: 210
Analyse 6317167: 210
Analyse 6909043: 210
Analyse 6251630: 210
Analyse 6382698: 210
Analyse 7369593: 210
Analyse 7106165: 210
Analyse 7237753: 210
Analyse 6580594: 210
Analyse 6777714: 210
Analyse 6251370: 210
Analyse 6054247: 210
Analyse 6317166: 210
Analyse 7304059: 210
Analyse 6317160: 210
Analyse 6185322: 210
Analyse 6119784: 210
Analyse 6448750: 210
Analyse 6119785: 210
Analyse 6383214: 210
Analyse 6185582: 210
Analyse 6317421: 210
Analyse 5791080: 210
Analyse 6382955: 210
Analyse 5922662: 210
Analyse 6185584: 210
Analyse 6251372: 210
Analyse 6053996: 210
Analyse 7435387: 210
Analyse 6185577: 210
Analyse 6119786: 210
Analyse 6054250: 210
Analyse 6382957: 210
Analyse 5988454: 210
Analyse 5988456: 210
Analyse 6317420: 210
Analyse 6777455: 210
Analyse 6514283: 210
Analyse 6251368: 210
Analyse 6975090: 210
Analyse 6382954: 210
Analyse 6580076: 210
Organizing colors
Done organizing
unable to gather colors
Uptext: Walk here / 2 more options
Uptext: Walk here / 1 more options
found text
gathering colors
in color gatherer
Analyse 5856871: 210
Analyse 5922413: 210
Analyse 7040896: 210
Analyse 6514810: 210
Analyse 8159113: 210
Analyse 7238275: 210
Analyse 6185061: 210
Analyse 7566979: 210
Analyse 6251116: 210
Analyse 6448494: 210
Analyse 7895937: 210
Analyse 6317166: 210
Analyse 6251372: 210
Analyse 6645869: 210
Analyse 5988454: 210
Analyse 5922663: 210
Analyse 6185580: 210
Organizing colors
Done organizing
unable to gather colors
Uptext: Walk here / 2 more options
Uptext: Walk here / 1 more options
Uptext: Walk here / 1 more options
Uptext: Walk here / 1 more options
Awe!
Successfully executed

The uptext part only shows up when it mouses over the unused bank booths.

So it writes the correct uptext in the debug when I have it set to the wrong uptext, and the opposite when it's set to the right uptext. I don't know if I'm doing something wrong, but either way it's not clicking.

Thanks,
Coh3n

EDIT: When I just run Writeln(rs_GetUpText), it finds the correct uptext every time.

Sir R. M8gic1an

2010-02-25 15:12:48


Organizing colors
Done organizing
unable to gather colors


That means that either the Max colors or Min colors setting is not tweaked correctly.


for i:= 0 to High(ColorArray) do
begin
L := AnalyseColor(ColorArray[i], Rock);

if L <= Rock.Details.UNIQUE_COLOR_MAX then
begin
Rock.SCArray[RockColorIndex] := ColorArray[i];
LengthArray[i] := L;
Inc(RockColorIndex);
end;
end;


FindColors(TPA, Color, MSX1, MSY1, MSX2, MSY2)

L := Length(TPA);

//this will avoid a useless color returning a false positive
if L < Rock.Details.UNIQUE_COLOR_MIN then L := Rock.Details.UNIQUE_COLOR_MAX + 10;

SC_Debug('Analyse '+IntToStr(Color)+': '+IntToStr(L));

so it's finding 210 points, which might be too few or too many points per color, depending on your settings.

~RM

Coh3n

2010-02-25 17:03:55

No matter what I set as the ColorMax, it always finds 10 more than what I set it to.

Analyse 6514286: 9010
Analyse 5988463: 9010
Analyse 6185587: 9010
Analyse 5922412: 9010
Analyse 6909303: 9010
Analyse 6383211: 9010

Analyse 6514286: 260
Analyse 5988463: 260
Analyse 6185587: 260

EDIT: Idk, I think I was setting my sizes way too big. I set the ColorMin to 0, ColorMax to 100, and MaxColors to 20, and it worked. :confused:

EDIT2: I also found out why it was +10 every time after looking through the code a bit. :p

Baked0420

2010-02-25 17:42:40

I want to try using this, I never knew exactly how good it could be until I read this tut on it. The only thing is, I don't know how I would go about getting the hue and sat of a color, can someone please explain how to. Sorry if it's answered already, I searched this thread though and didn't find anything about it.

Coh3n

2010-02-25 17:46:37

From: Baked0420
I want to try using this, I never knew exactly how good it could be until I read this tut on it. The only thing is, I don't know how I would go about getting the hue and sat of a color, can someone please explain how to. Sorry if it's answered already, I searched this thread though and didn't find anything about it.

Use AutoColorAid in the scripting tools folder in SRL.

If you choose CTS 2, pick a few colors, and then press get best color or something like that, the tolerance, color, hue/sat mods are on the right.

Blumblebee

2010-02-25 17:47:30

From: Baked0420
I want to try using this, I never knew exactly how good it could be until I read this tut on it. The only thing is, I don't know how I would go about getting the hue and sat of a color, can someone please explain how to. Sorry if it's answered already, I searched this thread though and didn't find anything about it.


autocoloring aid is a great way to do it. It's in scripting tools which is found in the includes folder.

SCAR -> Includes -> scripting tools -> autocoloring aid (ACA for short)

Sir R. M8gic1an

2010-02-26 09:07:33

From: Coh3n
No matter what I set as the ColorMax, it always finds 10 more than what I set it to.

Analyse 6514286: 9010
Analyse 5988463: 9010
Analyse 6185587: 9010
Analyse 5922412: 9010
Analyse 6909303: 9010
Analyse 6383211: 9010

Analyse 6514286: 260
Analyse 5988463: 260
Analyse 6185587: 260

EDIT: Idk, I think I was setting my sizes way too big. I set the ColorMin to 0, ColorMax to 100, and MaxColors to 20, and it worked. :confused:

EDIT2: I also found out why it was +10 every time after looking through the code a bit. :p


Ah yes, the +10 means it's a useless color. SC needs some better debugging.

~RM

Coh3n

2010-02-26 11:21:45

From: Rasta Magician
Ah yes, the +10 means it's a useless color. SC needs some better debugging.

~RM

Maybe… :D

Cigue

2010-08-05 19:57:57

I just shat myself. Thank you RM.

Sir R. M8gic1an

2010-08-05 20:43:57

From: Cigue
I just shat myself. Thank you RM.


I loled. My gf, (who knows little about this) is wondering why the hell I made you shit xD

~RM

Cigue

2010-08-05 20:47:29

Funny :P I was wondering if there was a possibility to make this include more efficient by modding it with INIs?

lordsaturn

2010-08-05 20:57:51

I think line 360 is incorrect. The following code segment:
 L := Length(ColorArray);

SetLength(Rock.SCArray, L);
SetLength(LengthArray, L);

for i:= 0 to High(ColorArray) do
begin
L := AnalyseColor(ColorArray[i], Rock);

if L <= Rock.Details.UNIQUE_COLOR_MAX then
begin
Rock.SCArray[RockColorIndex] := ColorArray[i];
LengthArray[i] := L; //line 360
Inc(RockColorIndex);
end;
end;

SetLength(Rock.SCArray, RockColorIndex + 1);
Rock.SCArray := OrganizeColors(Rock.SCArray, LengthArray);
Result := (RockColorIndex > 2);
Because the indices in SCArray are supposed to correspond to the indices in LengthArray in order to be used in OrganizeColors, correct?

Sir R. M8gic1an

2010-08-06 06:47:38

From: lordsaturn
I think line 360 is incorrect. The following code segment:
 L := Length(ColorArray);

SetLength(Rock.SCArray, L);
SetLength(LengthArray, L);

for i:= 0 to High(ColorArray) do
begin
L := AnalyseColor(ColorArray[i], Rock);

if L <= Rock.Details.UNIQUE_COLOR_MAX then
begin
Rock.SCArray[RockColorIndex] := ColorArray[i];
LengthArray[i] := L; //line 360
Inc(RockColorIndex);
end;
end;

SetLength(Rock.SCArray, RockColorIndex + 1);
Rock.SCArray := OrganizeColors(Rock.SCArray, LengthArray);
Result := (RockColorIndex > 2);
Because the indices in SCArray are supposed to correspond to the indices in LengthArray in order to be used in OrganizeColors, correct?


I see what you mean. Looks to me like it should be LengthArray[RockColorIndex] := L; , no?

~RM

Cigue

2010-08-06 19:34:27

Is there a way to use SmartColors in custom procedures?

Sir R. M8gic1an

2010-08-07 06:14:36

From: Cigue
Is there a way to use SmartColors in custom procedures?


You can use the idea of SmartColors, or you can copy/paste the code and edit it as you need. You can also access the SmartColorsArray (SCArray) if you wish to manipulate any of the information on it.

~RM

lordsaturn

2010-08-07 11:58:17

From: Rasta Magician
I see what you mean. Looks to me like it should be LengthArray[RockColorIndex] := L; , no?

~RM


Yes that's correct.

Cigue

2010-08-07 18:13:52

From: Rasta Magician
You can use the idea of SmartColors, or you can copy/paste the code and edit it as you need. You can also access the SmartColorsArray (SCArray) if you wish to manipulate any of the information on it.

~RM


I'd like to work it out with someone who is more familiar with the include, think you could help me?

Sir R. M8gic1an

2010-08-07 22:51:22

From: Cigue
I'd like to work it out with someone who is more familiar with the include, think you could help me?


My PM box is open; Whatever I can help with and whatever I have time for, I'd be glad to help :)

~RM

Sabzi

2011-12-08 13:58:19

Bumpity bump.
New users should notice this imo. Maybe even more with all the new rs update.

Also I recall more new srl update then new thread here. Not that every single addition should get a tutorial but there may have been a few that requires further explaining.
Maybe not, again, I didn't check out the updates recently(~1.5 year).

Oh, and I used the search for this, sorry if I didn't see any recent version of this so bear with me if this was unnecessary.

marpis

2011-12-09 03:24:22

From: Sabzi
Bumpity bump.
New users should notice this imo. Maybe even more with all the new rs update.


This is, indeed, brilliant. :)
Thanks for bringing this thread up!

Jagex_Fagex

2012-01-30 12:19:50

I know this is old now, but does this still work? It looks like it could be mighty helpful to me :)

Sabzi

2012-01-30 12:48:46

It should.
I mean, there is nothing runescape related in there. So as long as there is no compile error I think it's good to go.
Why don't you just give it a try? :)

legoace

2012-01-30 12:49:35

Has Flight released his FMiner?

Once he does his methods of finding the bound of the object onscreen after IDing it should be added to this - the code should find the colors within that bound that are both unique and plentiful.

This is an amazing step to the next level, let's continue to make it better.

Jagex_Fagex

2012-01-30 13:59:17

Still works, going to do some testing to see how well and find out the real power of it. Thanks Devs :D

Coh3n

2012-03-25 04:48:09

Updated this guide and moved it to SRL Tutorials.

foxfly1

2012-03-27 23:19:35

that's pretty smart!