SRL Archive - Help and Support

Thinking of a cool updated function...


Claymore

2008-10-20 21:19:55

While my script ran a crash test course (Draynor > Law Alter) It took like hell-ish long time for the mouse to finally get to the monks. So i thought, why can't the script wait for the mother f-er (I was pissed) to stop moving THEN click on them. Then i PAUSED! I found out i CAN do that.

All i need to do is use the TPA functions. So for example…


FindColorsTolerance(TPA1....);
Wait(750);
FindColorsTolerance(TPA2);
TPA3 := CombineTPA(TPA1, TPA2);

Then i'm stuck here, so what do i do next? This is what IM thinking.


if (Length(TPA3) < 5) then //So...If the NPC doesnt move
begin
//I move on to the function

I'm not sure if that's correct, because i'm no good at TPA's (Well I have not alot of knowledge about how they work) anyways i need someone to help me, A HERO… No seriously though someone experinced at TPAs. Thanks!


function FindMonks: Boolean;
var
ATPA: T2DPointArray;
TPA: TPointArray;
CTS, I: Integer;
P: TPoint;
Begin
Result := False;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.08);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2112600, MSX1, MSY1, MSX2, MSY2, 14);
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 25, 30);
SetLength(TPA, 0);
for I := 0 to Length(ATPA) - 1 do
begin
P := MiddleTPA(ATPA[I]);
MMouse(P.X, P.Y, 3, 3);
if (TextWait(500, ['k-t', 'onk', 'f Ent'])) then
begin
GetMousePos(P.X, P.Y);
Mouse(P.X, P.Y, 0, 0, False);
Wait(175 + Random(50));
if (ChooseOption('e-b')) then
begin
Flag;
if (HandleMonk) then
begin
Result := True;
Exit;
end;
end;
end;
Wait(175 + Random(50));
if (ClickToContinue) then
begin
if (HandleMonk) then
begin
Result := True;
Exit;
end;
end;
end;
WriteLn('Could not find a Monk.');
Exit;
end;

Not the best function, but it works… ;D

Esteban

2008-10-20 21:55:40

I believe N3ss3s would be the person to talk to.

Bobarkinator

2008-10-20 22:04:29

Combining the TPA's won't do anything for you… You need to compare them.

Claymore

2008-10-20 22:05:44

Slappy my face! Sorry, on Mondays I get dizzy, but thanks for the idea Bobarkinator!

The_Shermanator

2008-10-21 00:36:19

Just have it move the mouse fast and it should click it first try. Thats what I usually do:D

Claymore

2008-10-21 00:49:55

Whats a good mouse speed then ;p?

Bam Bam

2008-10-21 07:29:26

From: Deathscytex
Whats a good mouse speed then ;p?

oh, like 35-45ish xD

EvilChicken!

2008-10-21 07:45:29

Hm, a better alternative to that would be to indeed turn up the mousespeed [MouseSpeed := 35 + Random(10)] and maybe use GRBHSLXYZ colorspaces (if that's what it's called, someone confim this please..? >_<) to minimize amounts of wrong points used. i would reccomend using 15-20 tolerance for GRB, 10-15 tolerance for HSL and 5-7 tolerance for XYZ.

And, be sure to remember to set the mouse speed back to normal afterwards :)

Another tip would be to possible use a progressive object finder, something like SmartColors by Tarajunky.

Raskolnikov

2008-10-21 11:22:32

From: EvilChicken!
Hm, a better alternative to that would be to indeed turn up the mousespeed [MouseSpeed := 35 + Random(10)] and maybe use GRBHSLXYZ colorspaces (if that's what it's called, someone confim this please..? >_<) to minimize amounts of wrong points used. i would reccomend using 15-20 tolerance for GRB, 10-15 tolerance for HSL and 5-7 tolerance for XYZ.

And, be sure to remember to set the mouse speed back to normal afterwards :)

Another tip would be to possible use a progressive object finder, something like SmartColors by Tarajunky.


Red Green Blue Hue Saturation Luminance XYZ (don't know what this stands for??) :D


Yes I would move the mouse quickly. I was having the same problem with an autofighter I was making a while ago… It would find the thing, but it would move too slow enough and the thing would move.

MouseSpeed := 30+random(10); //perhaps?

Good luck.

Cut em2 it

EvilChicken!

2008-10-21 13:49:44

From: Cut em2 it
XYZ (don't know what this stands for??)


http://en.wikipedia.org/wiki/CIE_1931_color_space

I wasn't thinking about those, i already knew them (thank you though) but the whole name of those three together. If you look at the page that I'm liking you to in this post, you'll see that they refer to it as CIE 1931 color space. Now, unless I've screwed this up completely and Wiki'ed the wrong subject, the correct definition of the RGBHSLXYZ-stuff would be to call them "RGB/HSL/XYZ color spaces". Correct?



And, I'm really sorry for going offtopic here, but I mean that the question has already been answered by enough people.



E: Yeah, I'm getting pretty sure that it's called "color spaces", since the HSL color space also is mentioned that way.

Claymore

2008-10-21 19:17:39

Nah, i used ACA V2 and turns out the Monk could be found accuaratley by using CTS2. With Lum, and Sats.

And thanks people! I guess MouseSpeed will help, i jsut thought that we can make a TPA where we can find out that the NPC wil lstop moving.