SRL Archive - Help

Accurate Clicking


Sirenia

2012-05-14 02:37:39

So guys im trying to make a script that will pick some Swap Toads for EPIC profit :P Ive completed most of the script but im struggling with the clicking part… You see those scumbag frogs are very tiny and
Mouse
will missclick them by clicking outside of the object.
procedure PickToads;
var
Waited, X, Y: integer;
begin
if FindColorSpiralTolerance(X, Y, ToadColor, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Mouse(X, Y, 0, 0, true);
Wait(350 + random(200));
repeat
Wait(100 + random(100));
Inc(Waited);
until(CustomFlag) or (Waited = 30)
end;
end;
Tell me what im doing wrong and suggest how it would work better.

x[Warrior]x3500

2012-05-14 02:40:24

well you are clicking exactly where you have found the color. so if it isnt clickin on the object, then your color is incorrect.

Abu

2012-05-14 02:41:48

If this is the case then I suggest you left - click and select an option.

Sirenia

2012-05-14 02:46:50

From: abu_jwka
If this is the case then I suggest you left - click and select an option.

Ive tried that too and I still have the same problem :/
@Randomguy posting that Im using wrong colors: Ive used autocolor for the toads and checked tons of times that its only finding the toads t_t

Abu

2012-05-14 02:48:59

Increase your Mouse speed to about 45 - which three times the normal speed that SetUpSRL will set it to.

Do this by calling:
MouseSpeed := 45
Before you start your function.

Sirenia

2012-05-14 02:51:06

From: abu_jwka
Increase your Mouse speed to about 45 - which three times the normal speed that SetUpSRL will set it to.

Do this by calling:
MouseSpeed := 45
Before you start your function.

Thanks ill test that :) How fast is the mouse @45 ? I did MoveMouse(X, Y); and ClickMouse(X, Y, 1); and it worked a little better

Abu

2012-05-14 02:52:31

From: Sirenia
Thanks ill test that :) How fast is the mouse @45 ? I did MoveMouse(X, Y); and ClickMouse(X, Y, 1); and it worked a little better


By default, the Mouse speed is 15, so 45 will be three times faster than how it normally is.

You can increase it more and more if you want till you get it fast enough :p

Sirenia

2012-05-14 02:55:31

From: abu_jwka
By default, the Mouse speed is 15, so 45 will be three times faster than how it normally is.

By the way, shouldnt FindColorSpiralTolerance click in the middle of the object? Still it feels like its trying to click at the top left corner :/ I recall you have to use something like mscx and mscy?

Abu

2012-05-14 03:00:19

From: Sirenia
By the way, shouldnt FindColorSpiralTolerance click in the middle of the object? Still it feels like its trying to click at the top left corner :/ I recall you have to use something like mscx and mscy?


That means it will start searching from the Main Screen Center, however, this doesn't affect where it clicks. It will return the co-ordinates of the first point it finds the colour - so it won't always click in the middle of the object, just where it finds the colour first.

Sirenia

2012-05-14 03:01:17

From: abu_jwka
That means it will start searching from the Main Screen Center, however, this doesn't affect where it clicks. It will return the co-ordinates of the first point it finds the colour - so it won't always click in the middle of the object, just where it finds the colour first.

Would FindObjTPA try to click in the middle or am I screwed there too?

Abu

2012-05-14 03:02:37

From: Sirenia
Would FindObjTPA try to click in the middle or am I screwed there too?


That might work, you could use that to MiddleTPAEx (Finds middle point) and then click…

Sirenia

2012-05-14 03:03:39

From: abu_jwka
That might work, you could use that to MiddleTPAEx (Finds middle point) and then click…

Thanks for the super valueable suggestions abu, I will test that :)