Results 1 to 5 of 5

Thread: FreezeMouse ~ Mouse.scar

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

    Default FreezeMouse ~ Mouse.scar

    Here are two functions that I made earlier whilst I was bored. They are FreezeMouse, and FreezeMousePos.

    procedure FreezeMouse(X, Y, Rx, Ry, WaitMS : Integer);

    What FreezeMouse does is freeze the mouse at X, Y for WaitMS milliseconds. If the mouse cursor is not already at X, Y, it will move the mouse to there with Rx, Ry randomness, and then wait.

    SCAR Code:
    procedure FreezeMouse(X, Y, Rx, Ry, WaitMS : Integer);
    var
      T, C, V : Integer;
     
    begin
      GetMousePos(C, V);
      if (C <> X) or (V <> Y) then
        MMouse(X, Y, Rx, Ry);
      T:= GetSystemTime;
      GetMousePos(C, V);
      repeat
        MoveMouse(C, V);
      until((GetSystemTime - T) = WaitMS);
    end;

    procedure FreezeMousePos(WaitMS : Integer);

    FreezeMousePos is similar to FreezeMouse except this freezes the mouse where it already is, for WaitMS milliseconds.

    SCAR Code:
    procedure FreezeMousePos(WaitMS : Integer);
    var
      X, Y : Integer;

    begin
      GetMousePos(X, Y);
      FreezeMouse(X, Y, 0, 0, WaitMs);
    end;

    Comments?
    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.

  2. #2
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    I'm not sure what this is good for actually ..

    Couldnt it be shortened to:
    "Wait(time)"; ?

    ~caused

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

    Default

    I'm not sure what it's good for either, but I was bored and wanted to do something

    And the point of this is to freeze the cursor, so that you can't even move it by moving the mouse. So, no, it couldn't use Wait().

    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.

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

    Default

    SCAR Code:
    MMouse(x, y, 0, 0);
    wait(100+random(50));
    ???

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

    Default

    Marpis, I was bored and wanted to do something, so I came up with this. I know it may be pointless, but it gave me something to do.
    <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.

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
  •