SRL Archive - OSR Intermediate Scripting Tutorials

How to use AutoColorThis


Cazax

2008-03-08 14:15:56

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

2008-03-08 14:37:43

Nice tut :P Will help many people..

Cazax

2008-03-08 18:25:01

From: N1ke!
Nice tut :P Will help many people..


Thanks :)

gillian

2008-03-09 10:27:29

Great tutorial .. thanks for sharing! :)

ShowerThoughts

2008-03-09 10:42:02

It's good clear tut(i need that, not xD)

Negaal

2008-03-09 10:52:27

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

2008-03-09 11:53:24

nice simple tut, i agree and a sample and declaring a variable also, but its good for a beginner scripter…

Rikje

2008-03-09 12:20:34

remember that AutoColorThis, Takes the color from the upper left pixel of the bitmap ;)

HellBoyz

2008-03-17 00:07:09

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

2008-03-17 16:19:31

From: HellBoyz
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

2008-03-20 09:32:59

Thanks i'll get it gone on my script…

NiCbaZ

2008-04-21 22:41:56

thanks +rep i just need help with the bitmap but add me @

[email]piperarcher35@hotmail.com[/email] please this will be very
handy


o[;"?

Maninblack144

2008-05-28 02:45:32

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

2008-05-30 21:48:47

From: Maninblack144
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

2008-08-01 23:06:31

can you use it like
 if AutoColorThis(btmname, 15, MMX1, MMY1, MMX2, MMY2) then
DoProcedure;// <-- i know you can make it do that part