Sk1nyNerd
2013-05-02 01:18:10
so for almost two weeks now ive been trying to rewrite my function to talk to an NPC (the competition judge at the range guild) that has the exact same colors as nearby guards (which i do not want to click on AT ALL) but for what ever function i use the script will eventually ignore the check up text and click on a guard. ive been told to try ATPA's and TPA's so i did but it still clicks on the guards and its really slowed down my script. Not sure if i called everything right or if im missing some important things? im still relatively new hence all the selfcomments and this is my first ATPA/TPA attempt at finding something. need some real help and suggestions! *starting to pull my hair out*
procedure Start_Comp;
Var
JudgeHeadTPA: TPointArray;
JudgeHeadATPA, JudgeBodyATPA: T2DPointArray;
tempCTS, i, jx, jy, judgefindtimer: Integer;
begin
writeln('searching');
tempCTS := GetColorToleranceSpeed; //normal CTS
SetColorToleranceSpeed(2); //new CTS
SetToleranceSpeed2Modifiers(0.00,0.11); //enter hue and sat mods found with ACA
FindColorsTolerance(JudgeHeadTPA, 6774623, MSX1, MSY1, MSX2, MSY2, 12); //enter the color and tolerance ACA found. Make appropriate parameters
SetColorToleranceSpeed(tempCTS); //change back to normal
SetToleranceSpeed2Modifiers(0.02, 0.02); //change back to normal
//JudgeHeadATPA := TPAToATPAEx(JudgeHeadTPA, 7, 5);
JudgeHeadATPA := SplitTPAEx(JudgeHeadTPA, 7,5); //width and height searching bounds
SortATPASize(JudgeHeadATPA, True);
SortATPAFromFirstPoint(JudgeHeadATPA, Point(MSCX, MSCY));
for i := 0 To High(JudgeHeadATPA) do
begin
marktime(judgefindtimer);
SMART_DrawDotsEx(True, JudgeHeadATPA[i], clLime);
MiddleTPAEx(JudgeHeadATPA[i], jx, jy);
MMouse(jx, jy, 3, 3);
if (IsUpTextMultiCustom(['-', 'omp'])) then
begin
ClickMouse2(mouse_left);
break;
end;
if(timefrommark(judgefindtimer) > 10000) then
begin
writeln('negatory');
Logout;
TerminateScript;
end;
end;
end;