SRL Archive - SRL Archives

DynamicRSArrow


Avaphi

2006-05-22 14:22:37

Want the function that will bring the return of auto colors ? :cool:

function DRSARed(RedArrowcol:integer):boolean;
var xm,ym:integer;
begin
if FindMSColor(x,y,RedArrowCol)then
begin
GetMousePos(x,y);
xm:=x;
ym:=y;
curcolor:=GetColor(xm,ym);
Result:=True;
end;
Writeln('Current color is:'+ IntToStr(curcolor) + '!')
end;

Want to know how to use it? Here is a tutorial written by me ;)
http://82.92.130.193/forums/showthread.php?t=1592

Krazy_Meerkat

2006-05-23 01:03:21

Good idea :)

WhiteShadow

2006-05-23 04:30:46

Looks pretty tight. Don't people have to pick the color of the arrow though?

XxKanexX

2006-05-23 06:27:36

Heres the code a bit cleaner. Also, i made it a variable parametre for the CursorColor. This means it saves it into a variable the user can specifiy.


{.include SRL/SRL.scar}

function DRSARed(var CurColor: integer; ArrowColor: integer): boolean;
begin
if (FindMSColor(x, y, ArrowColor)) then
begin
Mouse(x, y, 0, 0, True);
Wait(150);
Getmousepos(x, y);
CurColor:= Getcolor(x, y);
Writeln('Current Color: ' + inttostr(CurColor));
result:= True;
end;
end;

Eg:

var Col: integer;
begin
DRSARed(Col, 0);
end.
;)

Avaphi

2006-05-25 02:15:49

I have edited it for much better functionality, Check main post for a tutorial on how to use this function and bring the return of auto colors ! :cool:

Renax

2006-05-25 15:26:44

this will only return the same color, and if the color has changed it will do nothing at all. try incorporating tolerance.

Avaphi

2006-05-25 20:22:58

Yea Renax, Or anyone for that matter, I am a bit busy with homework, Now its coming to the end of the school year, So If anyone can help me make this function better, I will add it in and give credit. ASAP… Also, Renax , I know If you have correct color finding procedure in your script, you can incorperate tolerance without changing function, And BTW, it always changes colors on my auto miner dude ;)

Renax

2006-05-25 22:30:28

it gets the color at the mouse position no matter where the mouse is, use a MMouse before getmousepos.

Avaphi

2006-05-26 00:13:22

function DRSARed(RedArrowcol:integer):boolean;
var xm,ym:integer;
begin
if FindMSColor(x,y,RedArrowCol)then
begin
MMouse(x,y,0,0)
GetMousePos(x,y);
xm:=x;
ym:=y;
curcolor:=GetColor(xm,ym);
Result:=True;
end;
Writeln('Current color is:'+ IntToStr(curcolor) + '!')
end;

Alright, ill change on my powerminer cuz… Its effin up right now :mad: Renax, Could I add you on Msn? If you dont want your email public, Just add me. [email]db.inc.email@gmail.com[/email]

If you dont want me to have your msn renax :( Perhaps you could help me on here :D I was planning on making it somewhat like Fawks color road finder, Where it stores road colors in an area of the script. I would like you to help me with that ASAP, Please :p

PS: Could I use a color finding procedure instead Findmscolor? The reason I used it is because I heard it was the fastest, So if there are any that find a color on MS fairly Fast, with tolerance, I would be willing to change :)