Results 1 to 15 of 15

Thread: GetMotion;

  1. #1
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default GetMotion;

    Is there any way to find out if your player is moving on the MM, and on the main screen, without using KYAB or something like that? Because it would be cool for a fire maker or something, once the screen moves, you know you lit a log. So how would one do this accurately in normal SCAR?

    Thanks
    ~ Harry


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  2. #2
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    function IsMoving : boolean;
    begin
    if FindDTM(PlayerSpot1,x,y,mmx1,mmy1,mmx2,mmy2) thend
    begin
    Wait(100);
    if Not FindDTM(PlayerSpot1,x,y,mmx1,mmy1,mmx2,mmy2) then
    Result := False;
    end else
    Result := True;
    end;

    Something like that?

  3. #3
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    No, it isn't going to be for a specific area - just when it sees your player moves a map tile or something it will result := True;


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  4. #4
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    What I have done in the past is made an array of all of the colors in certain points, in a grid style, on the minimap, waited 250 ms or so, got the colors again in a different array, looped through the arrays, and increased an integer for each time the colors on the different arrays didn't match. I then checked if the integer was higher than a certain amount, and if so, it would result true. I'm not sure how reliable this is. In, say, the desert, this probably wouldn't work to good because of the same ground color. I can't really think of another fast way of doing it off the top of my head right now.

  5. #5
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    @bullzeye: Can you give me some of that code? (h)


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  6. #6
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Nope, sorry, lost it

  7. #7
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    WAAAAAAaaaaHHHhhhhHHhh


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  8. #8
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function Moving : Boolean;
    var
      PointArray : TPointArray;
      ColourArray, ColourArrayCheck : TIntegerArray;
      I, ChangedPoints : Integer;
    begin
      FindColorsTolerance(PointArray, 0, MMCX, MMCY, MMX2, MMY2, 422);
      ColourArray := GetColors(PointArray);

      Wait(250);

      FindColorsTolerance(PointArray, 0, MMCX, MMCY, MMX2, MMY2, 422);
      ColourArrayCheck := GetColors(PointArray);

      for I := 0 to High(ColourArray) do
      if not(ColourArray[I] = ColourArrayCheck[I]) then
        Inc(ChangedPoints);

      Result := ChangedPoints >= 20;
    end;

    Maybe that would work?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  9. #9
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    zomg, you are too leet Santy, rep


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  10. #10
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Santa_Clause View Post
    SCAR Code:
    function Moving : Boolean;
    var
      PointArray : TPointArray;
      ColourArray, ColourArrayCheck : TIntegerArray;
      I, ChangedPoints : Integer;
    begin
      FindColorsTolerance(PointArray, 0, MMCX, MMCY, MMX2, MMY2, 422);
      ColourArray := GetColors(PointArray);

      Wait(250);

      FindColorsTolerance(PointArray, 0, MMCX, MMCY, MMX2, MMY2, 422);
      ColourArrayCheck := GetColors(PointArray);

      for I := 0 to High(ColourArray) do
      if not(ColourArray[I] = ColourArrayCheck[I]) then
        Inc(ChangedPoints);

      Result := ChangedPoints >= 20;
    end;

    Maybe that would work?
    Thats really slow, lol.

    A grid would probably be the best.. Take some random points on the MM, points around your dot, points in the N, W,S,E.. Should be enuf
    Verrekte Koekwous

  11. #11
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Try this

    SCAR Code:
    Function AreWeMoving(wTime, minChance: Integer): Boolean;
    Var
      A, R, X, Y, I, C: Integer;
      Col: TIntegerArray;
      TPA: TPointArray;
    Begin

      If Not LoggedIn Then Exit;
     
      SetArrayLength(TPA, 10);
      SetArrayLength(Col, 10);
     
      For I := 0 To 9 Do
      Begin
        A := (I + 1) * 40 + Random(50);
        R := 15 + Random(60);
        X := MMCX + Round(R * Cos(A / 180 * Pi));
        Y := MMCY + Round(R * Sin(A / 180 * Pi));
        TPA[i] := Point(X, Y);
      End;
     
      Col := GetColors(TPA);
      Wait(wTime);
     
      For I := 0 To 9 Do
        If GetColor(TPA[i].x, TPA[i].y) <> Col[i] Then
          C := C + 1;
         
      Result := C > minChance;
     
    End;

  12. #12
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Actually all your problems are that it won't skip player and yellow dots.

    For Hy's luck I got good memory
    http://www.villavu.com/forum/showthr...light=ismoving

    It works/ed well, I haven't tested it after the big MM update. It worked very well before that.

    Edit: Santy's one wouldn't work 100% aswell. Maybe like 5 peoples are moving on MM and function returns true...
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  13. #13
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Meh, I'll post a new one in a few minutes.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  14. #14
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    couldn' you use TVIYH's procedure but add a FlagPresent in it?

  15. #15
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just a thought, but to make it more accurte you could remove all Yellow dots from the integer count... Just figure out how many pixels per yellow dot , and red i guess. It would require some more specific programming

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
  •