View Full Version : Need help...
laakerules
01-31-2012, 03:02 AM
More like im working on homework majorly at the moment and need someone to do something for me! :P
I need someone to find a color on the ghouls to the west of canifis, the color cannot get confused wiht bones or the color on the ground! :P
Simple task im just heavy in homework atm, ill give you credit in my script and the thread for finding a working colors. either 2 or 3. so please help! :)
Flight
01-31-2012, 03:05 AM
How about I get you the best color as well as the Hue and Sat modifiers for for CTS2?
laakerules
01-31-2012, 03:08 AM
Lol sure, that works. I hate english class!!!!!!!!!
I havent used the hue and Sat modifiers for CTS2 yet so i dont know how they work.
And something you repeated for for 2 times. And i didnt realize until i read it throught the second time! :)
Flight
01-31-2012, 03:13 AM
http://i.imgur.com/Lg4pP.png
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(HueMod, SatMod);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tolerance);
ColorToleranceSpeed(CTS);
laakerules
01-31-2012, 03:15 AM
And how would i add that to my script? :O never even seen that before only heard of it.
Flight
01-31-2012, 03:41 AM
Function FindGhoul(Var X,Y: Integer): Boolean;
var
CTS: Integer;
TPA: TPointArray;
begin
Result := False;
CTS := GetColorToleranceSpeed;
{Set our CTS to 2}
ColorToleranceSpeed(2);
{Add in the Hue and Sat modifiers}
SetColorSpeed2Modifiers(Hue, Sat);
{Search for the color (9877428) starting at MSCX,MSCY within the area of the main screen, with a set color tolerance}
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tolerance);
ColorToleranceSpeed(CTS);
{If no color points were found, exit the function}
if (Length(TPA) < 1) then
Exit;
{[0] means it's the first in an array, and because the array starts at our play and moves outward, 0 would be the closest}
MMouse(TPA[0].X, TPA[0].Y, 5, 5);
if WaitUpText('ck Gh', 400) then
begin
GetMousePos(X, Y); //Get the mouse X/Y coordinate and set them to return as X/Y for this function
Result := True;
Exit;
end;
end;
Var
X,Y: Integer;
begin
if FindGhoul(X, Y) then
Writeln('Found a ghoul at Point('+IntToStr(X)+', '+IntToStr(Y)+')');
end;
laakerules
01-31-2012, 03:49 AM
So would it look like this then inside the script?
//credits to Flight
Function FindGhoul(Var X,Y: Integer): Boolean;
var
CTS: Integer;
TPA: TPointArray;
begin
Result := False;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers('0.12', '0.79');
FindColorsSpiralTolerance(MSCX, MSCY, TPA, (9877428, More colors if wanted?), MSX1, MSY1, MSX2, MSY2, 5);
ColorToleranceSpeed(CTS);
if (Length(TPA) < 1) then
Exit;
MMouse(TPA[0].X, TPA[0].Y, 5, 5);
if WaitUpText('ck Gh', 400) then
begin
GetMousePos(X, Y);
ClickMouse2(True);
Result := True;
Exit;
end;
end;
Flight
01-31-2012, 04:19 AM
FindColorsSpiralTolerance only searches for one color, so use that one color I provided you with. Also, as shown in the above picture, you'd want to use 16 as the tolerance, not 5.
That was only an example, if I were you I'd split those TPAs into ATPAs and search each TPA[] for the ghoul's uptext.
laakerules
01-31-2012, 05:16 AM
Ok, well i got it working really well now! :)
what thing was that you used to find the DATA?
It's ACAv2, look around it's a must-have :D
laakerules
01-31-2012, 05:37 AM
Nevermind i found it in the tutorial island under auto color aid! :P
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.