Make mouse click

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
mr_penguin





Posts: 541
Joined: Thu Feb 08, 2007 5:39 pm
Location: NJ

Make mouse click

Post by mr_penguin »

Does anyone know how to make it so when you click the mouse its like the mouse is constantly clicking like at 20 clicks a second or something.
Your mom became oversized. Please make your mom smaller before reposting. :shock:
Infern0 wrote:You just shave the excess bush and burn the leftovers.
User avatar
xzodia




Translator Connoisseur Coagulator

Posts: 1981
Joined: Sun May 15, 2005 10:31 am
Location: UK
Contact:

Post by xzodia »

Why would you want to do that?
Image
Halo 2 Plugins | Lock-on To Just About Anything | My Sites | Snow Hog
Old Plugins you have, upgrade you must...
Always Maintain a High Quality-To-Crap Ratio.
User avatar
CompKronos




Wordewatician 250

Posts: 462
Joined: Mon Sep 03, 2007 6:45 am
Location: New Jersey

Post by CompKronos »

probably a trainer or something similar to have auto fire with a weapon that doesn't have it.
Image
I <3 rant thread
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

Wow people, just answer :roll:

It's not like you are the only persons in the world he could ask.

Code: Select all

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

        private const int MOUSEEVENTF_LEFTDOWN = 0x02;
        private const int MOUSEEVENTF_LEFTUP = 0x04;
        private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
        private const int MOUSEEVENTF_RIGHTUP = 0x10;

Code: Select all

public void DoMouseClick()
        {
            //Call the imported function with the cursor's current position
            int X = Cursor.Position.X;
            int Y = Cursor.Position.Y;
            mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
        }
...left for good
User avatar
xzodia




Translator Connoisseur Coagulator

Posts: 1981
Joined: Sun May 15, 2005 10:31 am
Location: UK
Contact:

Post by xzodia »

It was more that I thought there might have been a better way to achieve his goal depending on what it was...
Image
Halo 2 Plugins | Lock-on To Just About Anything | My Sites | Snow Hog
Old Plugins you have, upgrade you must...
Always Maintain a High Quality-To-Crap Ratio.
mr_penguin





Posts: 541
Joined: Thu Feb 08, 2007 5:39 pm
Location: NJ

Post by mr_penguin »

thanks

Wait, is this C# or C++ because dllimports keeps giving me an error:

Error 1 The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Logan\Local Settings\Application Data\Temporary Projects\Auto Click\Form1.cs 21 10 Auto Click
Your mom became oversized. Please make your mom smaller before reposting. :shock:
Infern0 wrote:You just shave the excess bush and burn the leftovers.
User avatar
LuxuriousMeat





Posts: 824
Joined: Thu Nov 03, 2005 6:43 pm
Location: zzzzzzzzzzzzzzzz
Contact:

Post by LuxuriousMeat »

mr_penguin wrote:thanks

Wait, is this C# or C++ because dllimports keeps giving me an error:

Error 1 The type or namespace name 'DllImport' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Logan\Local Settings\Application Data\Temporary Projects\Auto Click\Form1.cs 21 10 Auto Click
Put this at the top of your code file.

Code: Select all

using System.Runtime.InteropServices;
Image
User avatar
kornman00




ONI New Age

Posts: 146
Joined: Fri Dec 12, 2003 6:30 pm
Contact:

Post by kornman00 »

I would suggest you sharpen up your interop skills, mouse_event's parameters are all uint based. long is a no-no, especially for the last parameter which is a pointer which in mouse_event's case is 32bit.
Patrickssj6




Pi Collaborator

Posts: 5426
Joined: Sat Jul 24, 2004 12:12 pm
Location: I'm a Paranoid
Contact:

Post by Patrickssj6 »

kornman00 wrote:I would suggest you sharpen up your interop skills, mouse_event's parameters are all uint based. long is a no-no, especially for the last parameter which is a pointer which in mouse_event's case is 32bit.
I copy pasted it from a website and didn't check up with MSDN. Didn't even notice that the params were all long. :wink:
...left for good
Post Reply