Results 1 to 15 of 15

Thread: Find a moving person

  1. #1
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default Find a moving person

    Right, I'm making a RM runner, and I've encountered my first problem. How would I find Duke whateverhisnameis with the mouse, when he moves about?

    Here's an image:


    If you can help, please let me know.

    Thanks,
    Richard.

    PS: Those of you with a good memory might remember that I was going to make a smither. I encountered too many problems, so I just forgot about that.

    EDIT: I forgot to circle him, the Duke guy is the guy on the top right in the blue.
    Last edited by Rich; 04-28-2009 at 11:57 PM.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  2. #2
    Join Date
    Oct 2007
    Location
    Denmark
    Posts
    409
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Reflection or colour?

  3. #3
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Preferably colour.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  4. #4
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Are trying to like basically find him on the screen..?

    FindObjTPA(x, y, [1979462], 3, 1, 1, 3, ['Duke', 'Horacio']); ??

  5. #5
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I am trying to find him on-screen, so then I can click on him. Would the function you wrote work for that?
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  6. #6
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, it finds him based on colors and then you can tell it what to do.

    example:
    SCAR Code:
    if FindObjTPA(x, y, [1979462], 3, 1, 1, 3, ['Duke', 'Horacio']) then //This line finds him and moves mouse to him
    begin
      Mouse(x, y, 3, 3, true); //This line click on him
      Wait(500 + Random(750)); //This like waits for about 500ms + another random 0-649ms (gives some time to walk to him)
    end;

    Edit: You may need to adjust the colors a bit, I just quickly took a common color from his hair. (Try to choose a color on him thats unique)
    Last edited by Nadeem; 04-29-2009 at 12:17 AM.

  7. #7
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Yeah just use colour finding.. I don't see an issue ^^
    Make it like it searches 5 times (in case he moves...) as failsafe.
    Ce ne sont que des gueux


  8. #8
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And right click it and check for the name

  9. #9
    Join Date
    Dec 2008
    Location
    Québec
    Posts
    419
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    use that for auto color, its realy good for ppl with trouble http://www.villavu.com/forum/showthread.php?t=26944
    Formerly known as FrancisHelie

  10. #10
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Can you use uptext 99_?

  11. #11
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    This is what I made awhile back for 99_'s and mine RM runner. You can change it up however you want, might need a little work since it's kinda old.

    SCAR Code:
    function NPCTalk(Color : TIntegerArray; UpText : array of string) : Boolean;
    var
      X, Y, Tries, I, looped : Integer;
      NPCUpText : array of string;
      NPCColor  : TIntegerArray;
    begin
      if not LoggedIn then
        Exit;
      NPCColor := Color;
      NPCUpText := UpText;
      for i := 0 to High(Color) do
      begin
        Tries := 0;
        OpenDoor;
        if FindObjTPA(x, y, NPCColor[i], 30, 2, 15, 25, 10, NPCUpText) then
          begin
            Wait(100 + Random(50));
            Mouse(x, y, 4, 4, False);
            Wait(100 + Random(200));
            ChooseOption('alk-to');
            Result := True;
            break;
          end else
          while (not FindObjTPA(x, y, NPCColor[i], 30, 2, 15, 25, 10, NPCUpText)) do
          repeat
            MakeCompass(IntToStr(Random(360)));
            Wait(3000 + Random(1500));
            Inc(Tries);
          until (FindObjTPA(x, y, NPCColor[i], 30, 2, 15, 25, 10, NPCUpText)) or (Tries >= 5);
          if tries >= 5 then Inc(looped);
        end;
        if (looped >= High(Color)) then
          begin
            Logout;
            NextPlayer(False);
            LoginPlayer;
            Inc(Errors);
          end;
    end;

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  12. #12
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Da 0wner, of course use UpText, but also right click, because if you find the color at 0, 0 (for easier math ), then the color moves to 50, 50 the mouse might get to 0, 0 after the color moved, and it would look quite bot-like in my opinion.

  13. #13
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I'm still struggling to find him. I've got this so far:

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    var
      x, y, i : Integer;
      Colours : array[0..6]of Integer;

    begin
      SetupSRL;
      ActivateClient;
      Colours:= [11495486, 5583114, 9327666, 5911562, 10641465, 1386286, 7059134, 11645628];
      for i:= 0 to 5 do
      begin
        Wait(500 + Random(500));
        if FindColorSpiralTolerance(x, y, Colours[i], MSX1, MSY1, MSX2, MSY2, 25) then
        begin
          if IsUpText('Duke') then
          begin
            Mouse(x, y, 3, 3, true);
            Wait(500 + Random(250));
            Exit;
          end;
        end;
      end;
    end.

    But it doesn't seem to find him, even with all those colours.

    Any help?

    Thanks,
    Richard
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  14. #14
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Dude, if you don't know how to find an NPC maybe you should make some easier script first? because colorbased quest solver takes serious skills. I raise my hat if you can make a script that does all the walking required in RM all in color...

    Start with making a simple autofighter, then practice walking by doing a script that simply walks from lumby to magetower.

    even from lumby to magetower is not an easy task, if you want to make it failproof.

    EDIT:
    Your procedure doesn't work because you check the uptext before your mouse is on duke.
    This is how it's done:
    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    var
      x, y, i : Integer;
      Colours : array[0..6]of Integer;

    begin
      SetupSRL;
      ActivateClient;
      Colours:= [11495486, 5583114, 9327666, 5911562, 10641465, 1386286, 7059134, 11645628];
      for i:= 0 to 5 do
      begin
        Wait(500 + Random(500));
        if FindColorSpiralTolerance(x, y, Colours[i], MSX1, MSY1, MSX2, MSY2, 25) then
        begin
          MMouse(x, y, 3, 3);
          wait(200+random(100));
          if IsUpText('uke') then
          begin
           GetMousePos(x, y);
           Mouse(x, y, 0, 0, true);
           Wait(500 + Random(250));
           Exit;
          end;
          end;
        end;
      end;
    end.

    I suggest using FindObjCustom() because it uses many colors
    Last edited by marpis; 04-30-2009 at 12:54 AM.

  15. #15
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I suggest using your own find object function using TPAs and ATPAs.

    Also, make sure you have a wait after the mmouse to the duke before checking because the uptext change isn't instant.

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
  •