Results 1 to 5 of 5

Thread: Clicking while running

  1. #1
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default Clicking while running

    Code:
    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.

    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.


    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.

  2. #2
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    You could potentially use MoveMouse() to overcome a situation where the mouse is not traveling fast enough.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols

  3. #3
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default

    Any ideas for the failsafe?

    Code:
    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...

    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.

  4. #4
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default

    Quote Originally Posted by KeepBotting View Post
    You could potentially use MoveMouse() to overcome a situation where the mouse is not traveling fast enough.
    Thanks, I'll test this out.

  5. #5
    Join Date
    Jan 2016
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Ty for info KeepBotting

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •