Results 1 to 3 of 3
  1. #1
    newplaye's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    13
    Reputation
    10
    Thanks
    2

    looking for editable, C# autoclicker

    If someone can make one or send me a code snippet that would be fine too.

  2. #2
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    Google your post title... https://www.google.com/search?q=c%23+auto+clicker

    First Result: Auto Clicker C# - CodeProject

    [DllImport("user32")]
    public static extern int SetCursorPos(int x, int y);

    The next API simulates mouse events (left/right click down/up, wheel EXE)

    private const int MOUSEEVENTF_MOVE = 0x0001; /* mouse move */
    private const int MOUSEEVENTF_LEFTDOWN = 0x0002; /* left button down */
    private const int MOUSEEVENTF_LEFTUP = 0x0004; /* left button up */
    private const int MOUSEEVENTF_RIGHTDOWN = 0x0008; /* right button down */

    DllImport("user32.dll",
    CharSet = CharSet.Auto,CallingConvention=CallingConvention.S tdCall)]
    public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons,
    int dwExtraInfo);

    To simulate one click, you need to use this method twice: the first time for down click and the second time for up click. On the save side, wait 100 milliseconds between moving new location and the click, like in the following code:

    SetCursorPos(action.X, action.Y)
    Thread.Sleep(100);
    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
    2 parts to this code:

    1) moving the cursor (you don't need winAPI for that...just use Cursor.Position = new point(x,y) if you want)
    2) clicking the cursor (see mouse_event API)


     

    How hard did you look...

    https://www.mpgh.net/forum/250-c-prog...-test-app.html

    ^^Still on first page of C# section
    Last edited by abuckau907; 10-04-2013 at 02:20 PM.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  3. #3
    Kushala Daora's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    RealmSupply
    Posts
    1,075
    Reputation
    73
    Thanks
    642
    My Mood
    Angelic
    good enough

Similar Threads

  1. Looking for a Video Editer !
    By rykos95 in forum General
    Replies: 8
    Last Post: 06-18-2011, 11:10 AM
  2. looking for editer
    By hakq in forum CrossFire Discussions
    Replies: 5
    Last Post: 10-30-2010, 10:52 AM
  3. Looking for HEX editer D3D 10-18-10
    By TV15 in forum WarRock Discussions
    Replies: 19
    Last Post: 10-18-2010, 09:23 PM
  4. looking for free editing software
    By m4custom in forum General
    Replies: 6
    Last Post: 09-30-2010, 05:02 PM
  5. Looking for rez editing helper
    By dddrrr in forum CrossFire Mods & Rez Modding
    Replies: 24
    Last Post: 07-06-2010, 03:24 AM