Sorry, I misunderstood your question. I'll add it now.
Sorry, I misunderstood your question. I'll add it now.
Thx Euphemism and Vinyl for the awesome siggy and avatar!
Loved the tutorial. Good explanation and perfect amount of depth for getting people going. CTS and ACA are amazing tools! Think im gonna be using them all the time. The breakdown of the TPA was also very clear.
Great job!
Love it, thankyou!
Nice tutorial! Will post s script that uses it after the weekend
Has helped me a lot, thank you!!
I think I found a possible problem with Footy's FindImp procedure.
Simba Code:program new;
{$i srl/srl.simba}
Procedure FindImp;
var
tmpCTS, i, l, r, counter:integer;
ImpTPA:TPointArray;
begin
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.08, 0.95); //Ive plugged in my hue and sat mods. Plug in your own here.
FindColorsTolerance(ImpTPA, 1911631, MSX1, MSY1, MSX2, MSY2, 8);
SetColorToleranceSpeed(tmpCTS); //RIGHT AFTER we find our colors, we
SetToleranceSpeed2Modifiers(0.02, 0.02); //Change the CTS back.
L := High(ImpTPA)
marktime(counter);
for i := 0 to L do
begin
r := random(L);
wait(randomrange(60, 200));
mmouse(ImpTPA[r].x, ImpTPA[r].y, 2, 2);
if waituptext('mp', 300) then
Break;
if timefrommark(counter) > 3000 then
begin
writeln('We failed to find the Imp!');
Terminatescript;
end;
end;
writeln('We found the imp!');
clickmouse2(mouse_right);
Should be changed to something like
Simba Code:program new;
{$i srl/srl.simba}
Procedure FindImp;
var
tmpCTS, i, l, r, counter:integer;
ImpTPA:TPointArray;
begin
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.08, 0.95); //Ive plugged in my hue and sat mods. Plug in your own here.
FindColorsTolerance(ImpTPA, 1911631, MSX1, MSY1, MSX2, MSY2, 8);
SetColorToleranceSpeed(tmpCTS); //RIGHT AFTER we find our colors, we
SetToleranceSpeed2Modifiers(0.02, 0.02); //Change the CTS back.
L := High(ImpTPA)
if (L < 1) then // ********I added this part so that if no color is found it will give stop********
begin
writeln('We failed to find the Imp!');
Terminatescript;
end;
marktime(counter);
for i := 0 to L do
begin
r := random(L);
wait(randomrange(60, 200));
mmouse(ImpTPA[r].x, ImpTPA[r].y, 2, 2);
if waituptext('mp', 300) then
Break;
if timefrommark(counter) > 3000 then
begin
writeln('We failed to find the Imp!');
Terminatescript;
end;
end;
writeln('We found the imp!');
clickmouse2(mouse_right);
His version will think it found the imp and then click if no Imp-color is found. My edit makes it stop if no imp-color is found.
If I'm correct maybe an admin could adjust his post?
Thanks
The examples are only to show how to use ColorToleranceSpeed. Adding failsafes should be learned before getting to this level anyways, so I don't really think there's a point in adding that part.
It would also make more sense to edit the FindColorsTolerance(); into "if not FindColorTolerance() then Exit;" instead
I've been trying to find a super basic TPA tutorial because everyone keeps telling me its better than findobj! I have to go to bed for the night, but what I've read so far has been excellent. Thanks!
this one is easy to understand
http://villavu.com/forum/showthread.php?t=33111
And check WizzyPlugins tutorial for what TPa's / ATPa's could do!
Creds to DannyRS for this wonderful sig!
There are currently 1 users browsing this thread. (0 members and 1 guests)