PDA

View Full Version : Clicking while running



Keelijh
01-19-2016, 05:57 AM
MyPlayer.FFlag(randomrange(3,6),100000); //as an example..
repeat
if someObj.isONMS then
Reflect.Mouse.Move(someObj.GetMSPoint, 1,1);
if isUpTextMulti(UpTextArray) then //failsafe
Reflect.Mouse.Click(MOUSE_LEFT);
sleep(100);
until Reflect.mouse.didclick(true,500);



Using this method while walking or stopped has a very high success rate of clicking the object on the main screen.:cool:

However, while running, the same method often misses the object--either clicking too late or the mouse does not move fast enough and so the failsafe does not trigger. :duh:


I have thought about moving the mouse to where the MS coords are expected to be given the speed difference, but integrating this concept with camera movement(s) is over my head. Perhaps I could move the mouse to some tile which appears on the MS before someObj, as this could reduce the time it takes for the function to complete. Still, there exists the case where such a tile may in fact be further from the destination tile, thus creating some inefficiency with mouse movements. :bart:

KeepBotting
01-19-2016, 12:34 PM
You could potentially use MoveMouse() to overcome a situation where the mouse is not traveling fast enough.

Keelijh
01-20-2016, 12:21 AM
Any ideas for the failsafe?


function TReflectionText.IsUpTextMulti(UpText: TStringArray): Boolean;
var
I: integer;
UT: string;
T: TReflectTimer;
begin
Result := False;
T.Start;
while UT = '' do
begin
UT := Reflect.Text.GetUpText;
if T.ElapsedTime > 1000 then
Exit;
Wait(50+Random(50));
end;
for I := 0 to High(UpText) do
begin
Result := Pos(Trim(UpText[I]), UT) > 0;
if Result then Exit;
end;
end;


If I alter this function from a total max wait time of 100, down to <50, will this cause many issues? I wonder...:p

Does anyone know how long it takes to scan the uptext array for the conditions, if the array length is less than 5 and the conditions are more often less than 10 chars? I cannot think of a method currently to test the time. On this note, how long does it take the client to update the UpText (this may not be very important, still curious..)? And then for reflection to retrieve such an UpText?

If this takes some time, scanning the array and checking the conditions against it, if greater than 30ms, then I understand why the wait time is so high.



If not, what is the purpose for such high wait times? I will begin testing lower wait times.

Keelijh
01-20-2016, 12:32 AM
You could potentially use MoveMouse() to overcome a situation where the mouse is not traveling fast enough.

Thanks, I'll test this out.

Marsupial
01-28-2016, 11:17 PM
Ty for info KeepBotting