Results 1 to 9 of 9

Thread: Proper Clicking Of A Moving Target

  1. #1
    Join Date
    Jan 2007
    Location
    Canada
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Proper Clicking Of A Moving Target

    Hello,

    I am currently trying to 'catch' a moving target, to right click it and trade it, however the process is looking slobby as the mouse moves to the one location is was at, doesn't find it, then finds his new location, then moves there and continues till it finally catchs up. Is there a better way to go about this?

    Heres the mouse finding I am doing:
    Code:
      repeat
                  FindColorTolerance(x, y, OurColor, 5, 5, 515, 338, 10);
                  MMouse(x, y, 6, 6);
                  if (IsUpText('alk') = true) then
                    begin
                      GetMousePos(x, y);
                      Mouse(x, y, 0, 0, false);
                    end;
                until(FindText(x, y, Text, upchars, 5, 5, 515, 338));
    So, how can I improve the pathfinding?

    Thanks for any help I can be given on this.

  2. #2
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    423
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    repeat
                  FindColorTolerance(x, y, OurColor, 5, 5, 515, 338, 10);
                  MMouse(x, y, 6, 6);
                  wait (100+random(20))   // a wait to give the text time to apear  
                    if (IsUpText('alk') = true) then
                    begin
                      Mouse(x, y, 0, 0, false);// the positon is already x,y so no need for the get mouse pos but it world make it more accurate but slower
                    end;
                until(FindText(x, y, Text, upchars, 5, 5, 515, 338));

  3. #3
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    6,136
    Mentioned
    28 Post(s)
    Quoted
    17 Post(s)

    Default

    Best way is:
    • First scan for the color
    • Move the mouse to that color
    • Check if there is a color in the upperleft of the mainscreen (Yellow, Orange, Blue indicating text)
    • Check for a tiny bit of the text (if the text is Attack Cow do a IsUpText("o") or IsUpText("ow")
    • Get the new Mouse Position (GetMousePos)
    • Click it using Mouse
    SRL is a Library of routines made by the SRL community written for the Program Simba.
    We produce Scripts for the game Runescape.

  4. #4
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Check your SRL Setup file, if your MouseSpeed is extremely slow, speed it up a bit.

    You might also want to try taking "6, 6" down to about 2 or 3. That will relieve some of the randomness of it.

  5. #5
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by meanage View Post
    SCAR Code:
    repeat
                  FindColorTolerance(x, y, OurColor, 5, 5, 515, 338, 10);
                  MMouse(x, y, 6, 6);
                  wait (100+random(20))   // a wait to give the text time to apear  
                    if (IsUpText('alk') = true) then
                    begin
                      Mouse(x, y, 0, 0, false);// the positon is already x,y so no need for the get mouse pos but it world make it more accurate but slower
                    end;
                until(FindText(x, y, Text, upchars, 5, 5, 515, 338));
    This is very untrue.
    MMouse(x,y,6,6)

    Moves mouse to x and y with a random of 6, small chance it will exactly x and y.
    You will need the GetMousePos.

    Also, use the if statement:

    SCAR Code:
    If FindColorTolerance Then
    Begin
      MMouse,wait,uptext and click.
    End
    Else WriteLn('no color');



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  6. #6
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    [Offtopic]
    Hey, Wizzup. Something I've always wondered... What exactly is your avatar a picture of?
    [/Offtopic]

  7. #7
    Join Date
    Feb 2007
    Location
    Yorkshire, England
    Posts
    180
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    his ivent

    after randoms and pik heads being lost lol

  8. #8
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Lol.

    At first I thought "That must be a picture of his inventory, after he CErized it (stackables).

    His Pickheads being lost and randoms makes sense, though.

  9. #9
    Join Date
    Jan 2007
    Location
    Canada
    Posts
    35
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the help guys, its still...hmm...not a smooth moving to the target, but I'll have to create a mouse function which detects for color on the go...however that'd probably be laggy...oh well it works fine, just a bit slower right now ^_^.

    Also thanks for pointing out adding the wait time, if I didn't have the wait time I noticed it lags right up and does nothing.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Moving and Clicking the mouse
    By Tom_Gower in forum OSR Help
    Replies: 13
    Last Post: 11-06-2008, 10:11 PM
  2. Replies: 12
    Last Post: 10-31-2007, 06:16 PM
  3. Moving/Clicking the mouse in Java
    By Jason2gs in forum Java Help and Tutorials
    Replies: 9
    Last Post: 10-29-2007, 11:38 PM
  4. A proper way to use FindRS?
    By Kik in forum OSR Help
    Replies: 7
    Last Post: 07-18-2007, 10:47 PM

Posting Permissions

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