SRL Archive - OSR Help

AutoColor.simba


P1ng

2012-09-06 06:38:27

Just wondering has anybody ever made use of this include and if they have do they have any tips/tutorials on how to use the functions inside it. Primarily looking at this for auto colouring with walking and location detection.

In addition to this, does anybody have any tips for how to make your own auto-colour function? :)

litoris

2012-09-06 06:46:55

I think there's another file, called newautocolor or something that seems to be more recent.
You could use a DDTM(search for WT-Fakawi's tut) to get something's color, and use the DDTM to identify a location. Auto color is not that viable when walking because if you load a new piece of map, all the colors change.
I searched around about auto color like last week, it seems that after ACA's release people stopped auto coloring and rely on CTS 2 with tolerance.

If all else fails, you can still do the bitmap thingy to auto color I think.

P1ng

2012-09-06 06:52:33

I'll check out Fakawi's tut again and look at how he does the auto-colouring. I find CTS2 quite unreliable when it comes to the minimap because of too many colour changes.

litoris

2012-09-06 07:01:34

From: P1ng
I'll check out Fakawi's tut again and look at how he does the auto-colouring. I find CTS2 quite unreliable when it comes to the minimap because of too many colour changes.


tl;dr version:
Creates a main DTM point with max tolerance, so that wherever you start the script is your "base"
Creates subpoints on something unique on the minimap, barn door in the tutorial.
Has an auto color function that outputs a TPA of a color(red in the tut) with tolerance, if the TPA fits the DTM subpoints he knows that those Tpoints belong to the unique thing, and gets the color on those points, and voila, you have auto colored something.
He thens proceeds to explain how he sets up pre-defined locations on the minimap to move to, with respect to the unique thing.

masterBB

2012-09-06 07:20:26

I just started writing this two days ago in my new tutorial. It will be covered.

P1ng

2012-09-06 07:24:00

BB would you mind PMing/posting here a quick run down of some questions that I have? :)

I would be forever grateful!

Olly

2012-09-06 07:34:47

From: masterBB
I just started writing this two days ago in my new tutorial. It will be covered.


Slightly off topic but I <3 your tutorials :P

masterBB

2012-09-06 08:07:56

Fakawi his method is a really strong one. Using autocolored DDTMs can be very efficient. Note however that autocoloring doesn't have effect if the bot enters a new part of runescape often, since all the colors would change again.

P1ng

2012-09-06 08:28:03

I think I may have worked out a way to do what I was after.

I now essentially have a loop which searches through an array of colours I have gathered and if it finds one of those with a quite low tolerance it sets that as my colour. This appears to be working for me at the moment, not sure why I didn't think of it earlier. However, still very interested to see your latest tutorial, you seem to be the go-to colour guy :)

riwu

2012-09-06 08:33:29

A basic form of autocolor that i use is to first have a rather high tolerance, then surf through the TPA until the correct uptext is found, then set that correct color as the new color with a much lower tolerance. Like masterBB said it's only useful if you are staying in a particular area for an extended period of time.

litoris

2012-09-06 08:41:46

From: riwu
A basic form of autocolor that i use is to first have a rather high tolerance, then surf through the TPA until the correct uptext is found, then set that correct color as the new color with a much lower tolerance. Like masterBB said it's only useful if you are staying in a particular area for an extended period of time.


Do the MS colors change when the area changes?

P1ng

2012-09-06 08:47:20

For those interested this is how I am doing it at present, which appears to be working alright and I can re-call this procedure before each lot of walking I would like to perform thus countering any changes in colour by the mini-map refreshing.

If this could be simplified/made better someone please let me know :)

The colours grabbed and placed in 'C' are just the road colour after each client refresh, I grab as many as I can be bothered and this appears to cover most instances of that road colour.

function PRoadColor: Integer;
var
x, y, i: Integer;
C: TIntegerArray;
begin
C := [];
for i := 0 to High(C) do
begin
if FindColorTolerance(x, y, C[i], MMx1, MMy1, MMx2, MMy2, 2) then
begin
Result := C[i];
Break;
end;
end;
end;

masterBB

2012-09-06 09:20:44

Result := GetColor(x, y);

litoris

2012-09-06 09:32:42

From: masterBB
Result := GetColor(x, y);


^this, you won't need any tolerance then.

My question is, how is knowing the road color helpful when walking?

BigFate

2012-09-06 09:38:09

Can you not use Color := AutoColor(srl_VarrockRoadColor); and just use your own TIntegerArray instead of the srl_VarrockRoadColor ?

P1ng

2012-09-06 09:38:29

Well I'm tweaking my guild miner so that it can auto-colour the bank in falador and auto-colouring the black on the MM for down in the mines. Primarily for location checking but also working for walking because then I can just TPA walk searching for the colour that it returns as opposed to just picking a grey colour and then adding quite high tolerance to it thus resulting in less accuracy and mis-clicking.

E: @BigFate - Well that was my initial question, but it seemed very few actually make use of the AutoColor include and when I attempted something similar to what you are suggesting it was returning errors (I've forgotten them now..). I then decided upon the above loop.

@MasterBB - Thank you :) I knew there would be yet a more accurate way!

litoris

2012-09-06 10:03:09

For the guild, why didn't you just use this?
(*
PercentBlackMM
~~~~~~~~

.. code-block:: pascal

function PercentBlackMM: integer;

Returns the percentage of the minimap which is black.

.. note::

Author: NaumanAkhlaQ
Last Modified: Unknown/March 08, 2012

Example:

.. code-block:: pascal

blackPercent := PercentBlackMM;
*)
function PercentBlackMM: Integer;
begin
Result := PercentColorMM(SRL_GetBlackBackground, 0);
end;

P1ng

2012-09-06 10:07:54

These are not all specific examples - I wanted to be able to auto-colour things as I pleased for any future scripting ventures I may have. The location detection and walking in my guild miner were just some of the things I was looking into this as having a potential use.