Results 1 to 18 of 18

Thread: is player moving

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default is player moving

    Code:
    begin
      Mouse(x, y, 3, 3, True);
      IsMoving(0);
      marktime(m);
      repeat
        MMouse(x, y, 3, 3);
        wait (100);
        findrandoms;
      until not (isuptext(TreeUptext)) or (m = 25000);
    end;
    ok can someon explain to me what ismoving does and how to use it in my scripts

    like what does the integer mean in the ()'s

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

    Default

    IsMoving waits until the character is standing still
    The "0":
    SCAR Code:
    {*******************************************************************************
    function IsMoving(WaitTime: Integer): Boolean;
    By: Bullzeye95; Edits by Nava2
    Description: Checks if the currently loaded player is moving. Uses Minimap,
                 ignoring all dots which can move without the player moving.
                 Nava2 edit: Added try..finally, also changed to work with SMART,
                 as well added WaitTime Parameter.
    *******************************************************************************}

    function IsMoving(WaitTime: Integer): Boolean;
    var
      BMP, BMP2, I, H, x, y: Integer;
      ReplaceCols: TIntegerArray;
      P: TPointArray;
      DC: HDC;
    begin
      WaitTime := Max(50, WaitTime);
      try
        DC := GetTargetDC;
        ReplaceCols:= [65536, 16711422, 12961221, 14869218, 16777215, 15527148, 195836, 56797, 60909, 52428,
                       13816530, 982782, 1310462, 62965, 2105598, 395004, 789758, 3553023, 217, 188, 241,
                       206, 233, 64768, 58880, 51456, 49152, 44800, 61440, 16215571, 9716750, 13129742];
        BMP:= BitmapFromString(100, 100, '');
        BMP2:= BitmapFromString(100, 100, '');
        SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(BMP), MMCX - 50, MMCY - 50, MMCX + 50, MMCY + 50, 0, 0, 100, 100);
        H := High(ReplaceCols);
        for I:= 0 to H do
          FastReplaceColor(BMP, ReplaceCols[i], 0);
        wait(WaitTime);
        SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(BMP2), MMCX - 50, MMCY - 50, MMCX + 50, MMCY + 50, 0, 0, 100, 100);
        SetTargetDC(GetBitmapDC(BMP2));
        for I:= 0 to H do
        begin
          FindColorsTolerance(P, ReplaceCols[i], 0, 0, 99, 99, 0);
          y:= High(P);
          for x:= 0 to y do
            FastSetPixel(BMP2, P[x].x, P[x].y, FastGetPixel(BMP, P[x].x, P[x].y));
        end;
        Result:= not FindBitmapIn(BMP, x, y, 0, 0, 100, 100);
      finally
        SetTargetDC(DC);
        FreeBitmap(BMP);
        FreeBitmap(BMP2);
      end;
    end;

    WaitTime's max is 50, but idk what it does.
    Ce ne sont que des gueux


  3. #3
    Join Date
    Jul 2008
    Location
    England
    Posts
    763
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    WaitTime just waits until a specified time then checks if your moving.
    lol

  4. #4
    Join Date
    Feb 2006
    Posts
    44
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    its a good function becuase using flag when you click on places where you cant walk it sits and waits a while wqhere as this only looks to see if the mm has stoped moving. i love it

  5. #5
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    Repeat
      Wait(200);
    Until not IsMoving(600);
    If I set it up this way, would it still work, I mean if I set the WaitTime > 50? The issue is that some dev revisions back it worked this way for me, but with dev rev 55, it doesn't end the loop anymore
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

  6. #6
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    can IsMoving be used for like mining.
    I want my script to know if we are still mining, how can i do that?

    T~M

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

    Default

    Yes it will set it to 50 because it uses max.

  8. #8
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I don't think you can use it for mining as it checks the minimap movements, but while mining on one rock your minimap doesn't move...
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

  9. #9
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Quote Originally Posted by bugger0001 View Post
    I don't think you can use it for mining as it checks the minimap movements, but while mining on one rock your minimap doesn't move...
    oh ok.

    T~M

  10. #10
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    Yes it will set it to 50 because it uses max.
    But any ideas why it doesn't work for me anymore? I tried using
    SCAR Code:
    Repeat
      Wait(50);
    Until not IsMoving(50);
    but still nothing, just keeps repeating the loop...
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

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

    Default

    SCAR Code:
    while not IsMoving(50) do
        Wait(50);
    Try that.

  12. #12
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Already did :P
    But I guess it's got something to do with the latest opendev revision, as using another PC with rev 52 on it, everything works...
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

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

    Default

    This seems to not work for me either. Wtf?

  14. #14
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    As a matter of fact InvCount too seems to be not working...
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

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

    Default

    Have you tried restarting SCAR and then refocussing the client.
    Ce ne sont que des gueux


  16. #16
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, I have. Even restarted my PC. I don't think reinstalling Scar would help, at least redownloading SRL didn't...
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

  17. #17
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Read the "Site Trouble" thread in General.

    /threaD.

  18. #18
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's not it. Now the repo is up and I re-downloaded it, but still the same
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

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
  •