Results 1 to 13 of 13

Thread: Key/Mouse Log help

  1. #1
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I'm using http://villavu.com/forum/showthread.php?t=3197 to keylog myself but it doesn't record mouse movements.

    Can someone either link me to, or write a simple script that will writeln or save to file all of my mouse movements and clicks including left/right click and coordiantes please?

    What is IsMouseButtonDown(1)/2 which is left/right?

    How do I make it so it doesn't writeln the mousepos if my mouse hasn't moved?
    Currently it spams mousepos even if mouse hasn't moved, tried to do it but failed

    Simba Code:
    program new;
    var x,y, q, w:Integer;
    begin
      repeat
        If x<>w Then
        Begin
          GetMousePos(x,y);
          Writeln(IntToStr(x) + ',' + IntToStr(y));
        End;
        GetMousePos(q,w);
        If IsMouseButtonDown(1)  Then
        Writeln('MouseDown 1 ');
        If IsMouseButtonDown(2) Then
        Writeln('MouseDown 2');
      Until(false)
    end.

    1 is left click
    2 is right click
    Last edited by YoHoJo; 12-01-2011 at 11:35 PM.

  2. #2
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Have a LastPos and CurrPos TPoint. LastPos at start will just be -1, -1 (or 0, 0, doesn't matter), and CurrPos will be GetMousePos(CurrPos.x, CurrPos.y);. if((CurrPos.x <> LastPos.x) and (CurrPos.y <> LastPos.y))then Writeln(ToStr(CurrPos.x) + ', ' + ToStr(CurrPos.y)); LastPos := CurrPos;

  3. #3
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    how do I?
    I know
    CurrentPos:= Point(GetMousePos(x,y)); is wrong, what do I do.

    got it!
    Simba Code:
    program new;
    var x,y, q, w:Integer;
    LastPos, CurrentPos:Tpoint;

    begin
      repeat
        GetMousePos(x,y)
        CurrentPos:= Point(x, y);
        If CurrentPos.X <> LastPos.X Then
        Begin
          Writeln(IntToStr(x) + ',' + IntToStr(y));
        End;
        GetMousePos(q,w);
        LastPos:= Point(q,w);
        If IsMouseButtonDown(1)  Then
        Writeln('MouseDown 1 ');
        If IsMouseButtonDown(2) Then
        Writeln('MouseDown 2');
      Until(false)
    end.

    E: Not working in some cases, any better way to do it, do I need to switch some lines to make it respond better?

    E: Whatevas made another similar quick script, figured out what I wanted to.
    Last edited by YoHoJo; 12-01-2011 at 08:44 PM.

  4. #4
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Simba Code:
    program new;

    var
      LastPos, CurrentPos:Tpoint;

    begin
      LastPos := Point(-1, -1);
      repeat
        GetMousePos(CurrentPos.x, CurrentPos.y);
        If CurrentPos <> LastPos Then
        Begin
          LastPos := CurrentPos;
          writeln(LastPos);
        End;
        If IsMouseButtonDown(1)  Then
        Writeln('MouseDown 1 ');
        If IsMouseButtonDown(2) Then
        Writeln('MouseDown 2');
      Until(false)
    end.

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Flippin perfect thanks!
    E:MoMo, can you add so it notes the time the mouse button is held down and then released?
    Basically how many ms between hold down and release please.

  6. #6
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Simba Code:
    program new;

    var
      LastPos, CurrentPos:Tpoint;

    begin
      LastPos := Point(-1, -1);
      repeat
        GetMousePos(CurrentPos.x, CurrentPos.y);
        If CurrentPos <> LastPos Then
        Begin
          LastPos := CurrentPos;
          writeln(LastPos);
        End;
        If IsMouseButtonDown(mouse_Right)  Then
        Writeln('MouseDown mouse_Right');
        If IsMouseButtonDown(mouse_Left) Then
        Writeln('MouseDown mouse_Left');
        If IsMouseButtonDown(mouse_Middle) Then
        Writeln('MouseDown mouse_Middle');
      Until(false);
    end.

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I said have it write the ms between the down/up of the mouse please please ! Sorry I'm being a froob :/.!
    Gonna have to include srl and use MarkTime

    Talked to momomo on MSN, all is well!
    Simba Code:
    program new;
    {.include SRL/SRL.scar}
    var
      LastPos, CurrentPos: TPoint;
      T: Boolean;
      DownKey: Integer;

    begin
      LastPos := Point(-1, -1);
      repeat
        GetMousePos(CurrentPos.x, CurrentPos.y);
        If CurrentPos <> LastPos Then
        Begin
          LastPos := CurrentPos;
          writeln(LastPos);
        End;
        If IsMouseButtonDown(mouse_Right) Then
        Begin
          MarkTime(DownKey);
          While IsMouseButtonDown(mouse_Right) Do
            Wait(1);
          Writeln('MouseDown mouse_Right');
          Writeln(IntToStr(TimeFromMark(DownKey)) + 'ms');
        End;
        If IsMouseButtonDown(mouse_Middle) Then
        Begin
          MarkTime(DownKey);
          While IsMouseButtonDown(mouse_Middle) Do
            Wait(1);
          Writeln('MouseDown mouse_Middle');
          Writeln(IntToStr(TimeFromMark(DownKey)) + 'ms');
        End;
        If IsMouseButtonDown(mouse_Left) Then
        Begin
          MarkTime(DownKey);
          While IsMouseButtonDown(mouse_Left) Do
            Wait(1);
          Writeln('MouseDown mouse_Left');
          Writeln(IntToStr(TimeFromMark(DownKey)) + 'ms'); 5
        End;
      Until(false);
    end.
    Last edited by YoHoJo; 12-01-2011 at 11:35 PM.

  8. #8
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Yo Ho,

    You've been around too long to be getting this kind of help on easy stuff!!! :P

  9. #9
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    Yo Ho,

    You've been around too long to be getting this kind of help on easy stuff!!! :P
    Triple and double posts too jk We love you YoHoJo
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

  10. #10
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Quote Originally Posted by Yago View Post
    Triple and double posts too jk We love you YoHoJo
    Merged em!

  11. #11
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Merged em!
    grr Do Not Conform...

    Ontopic: Did you get the script to work?
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

  12. #12
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    End result, all good:
    Simba Code:
    program new;
    {.include SRL/SRL.scar}
    var
      LastPos, CurrentPos: TPoint;
      T: Boolean;
      DownKey: Integer;

    begin
      LastPos := Point(-1, -1);
      repeat
        GetMousePos(CurrentPos.x, CurrentPos.y);
        If CurrentPos <> LastPos Then
        Begin
          LastPos := CurrentPos;
          writeln(LastPos);
        End;
        If IsMouseButtonDown(mouse_Right) Then
        Begin
          MarkTime(DownKey);
          While IsMouseButtonDown(mouse_Right) Do
            Wait(1);
          Writeln('MouseDown mouse_Right');
          Writeln(IntToStr(TimeFromMark(DownKey)) + 'ms');
        End;
        If IsMouseButtonDown(mouse_Middle) Then
        Begin
          MarkTime(DownKey);
          While IsMouseButtonDown(mouse_Middle) Do
            Wait(1);
          Writeln('MouseDown mouse_Middle');
          Writeln(IntToStr(TimeFromMark(DownKey)) + 'ms');
        End;
        If IsMouseButtonDown(mouse_Left) Then
        Begin
          MarkTime(DownKey);
          While IsMouseButtonDown(mouse_Left) Do
            Wait(1);
          Writeln('MouseDown mouse_Left');
          Writeln(IntToStr(TimeFromMark(DownKey)) + 'ms');
        End;
      Until(false);
    end.

  13. #13
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Cool I might take a look at this puppy
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

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
  •