PDA

View Full Version : How to use AutoColorThis



Cazax
03-08-2008, 07:15 PM
AutoColorThis

A function by sumillion


{************************************************* ******************************
function AutoColorThis(Bitmap, MaxTol, X1, Y1, X2, Y2: Integer): Integer;
By: Sumilion
Description: Resturns exact color of a bmp with tol found on the screen.
************************************************** *****************************}

AutoColorThis is way of autocoloring. Like other autocolorers (e.g FindWaterColor), AutoColorThis use a bitmap, a tolerance and a place to search the bmp.

First of all, make bitmap of the thing you want to get the color, a small bmp could be fine. Dont use high tolerance.

Something like this:
AutoColorThis(GrassBmp, 15, MMX1, MMY1, MMX2, MMY2)

You can use it for walking, e.g:
RadialWalk(AutoColorThis(GrassBmp, 15, MMX1, MMY1, MMX2, MMY2), 0, 360, 65, -1, 1)

Using AutoColorThis you dont need RadialWalkEx or other tolerance walker functions.

Naike
03-08-2008, 07:37 PM
Nice tut :P Will help many people..

Cazax
03-08-2008, 11:25 PM
Nice tut :P Will help many people..

Thanks :)

gillian
03-09-2008, 02:27 PM
Great tutorial .. thanks for sharing! :)

ShowerThoughts
03-09-2008, 02:42 PM
It's good clear tut(i need that, not xD)

Negaal
03-09-2008, 02:52 PM
You might want to post example script. So they see how you fill GrassBmp. Also this function lags a bit. If you use radialwalk more than 1 time, then
you might want to load color into a variable. And use variable in radialwalk.

stampede10343
03-09-2008, 03:53 PM
nice simple tut, i agree and a sample and declaring a variable also, but its good for a beginner scripter...

Rikje
03-09-2008, 04:20 PM
remember that AutoColorThis, Takes the color from the upper left pixel of the bitmap ;)

HellBoyz
03-17-2008, 04:07 AM
yeah, but i thought autocolorthis quite lag by itself but will try to use it soon. Now bookmark for future reference... lol

Can you some more example? :p

Cazax
03-17-2008, 08:19 PM
yeah, but i thought autocolorthis quite lag by itself but will try to use it soon. Now bookmark for future reference... lol

Can you some more example? :p


//procedure LoadBMP;
//bmpname := BitmapFromstring(stuff);
//remember to load the bmp.

procedure WalkThere;
var
AutoColorColor : integer;
begin
AutoColorColor := AutoColorThis(BmpName, MMX1, MMY1, MMX2, MMY2, Tol);// this will get the color of the bmp found in the minimap
if RadialWalk(AutoColorColor, stufffff,f,f,f,f) then
begin
Writeln('walking there');
end else
Writeln('we arent walking there');
end;

HellBoyz
03-20-2008, 01:32 PM
Thanks i'll get it gone on my script...

NiCbaZ
04-22-2008, 02:41 AM
thanks +rep i just need help with the bitmap but add me @

piperarcher35@hotmail.com please this will be very
handy


o[;"?

Maninblack144
05-28-2008, 06:45 AM
This function isn't all reliable anymore. Runescape switches minimap colors every time you enter a new area. That's why my script, using AutoColorThis, always gets stuck after a while, even though the Bmp Tolerance is like 70. Is there a way to dynamically make bitmaps?

Cazax
05-31-2008, 01:48 AM
This function isn't all reliable anymore. Runescape switches minimap colors every time you enter a new area. That's why my script, using AutoColorThis, always gets stuck after a while, even though the Bmp Tolerance is like 70. Is there a way to dynamically make bitmaps?

No, there isnt any way to make dynamic bitmaps(i think). Just use dynamic DTM's, there are good tuts on it ;) Check r0b0t's DTM tut on beginners section :)

Awkwardsaw
08-02-2008, 03:06 AM
can you use it like
if AutoColorThis(btmname, 15, MMX1, MMY1, MMX2, MMY2) then
DoProcedure;// <-- i know you can make it do that part