Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

repeated mouse button 1 clicks(bf2)


  • Please log in to reply
23 replies to this topic
SHADOW0240
  • Guests
  • Last active:
  • Joined: --
would someone mind helping me out with making something like a autofire thing!(remember the game pads witht eh button u press to make a button click repeatedly?
like a autofire!
im wanting to make my mouse button 1 click alot when i hold it down!
this is for bf2 or any game that people can use it in
situation: in bf2 when i hold down mouse 1 i want it to be like click click click click click click click etc...
like i was doing it myself but faster...
if anyone has any clue plz let me know!

T-nm
  • Members
  • 27 posts
  • Last active: Mar 24 2012 07:03 AM
  • Joined: 22 Jun 2006
Someone gave me a script for this too. The way I arrange it is simple, I hold down another button on my mouse (mx518) and it turbo left click. The problem is that the script is on my other computer, which is in repair.

EDIT: you're in luck

~RButton::
Loop
{
    Sleep 100  ; This is the delay between clicks, in milliseconds.
    GetKeyState, RButtonState, RButton, P
    if RButtonState = U  ; User has physically released the button, so end the loop.
        break 
    MouseClick, Right
}
return

I suggest you remove the line with "Sleep 100 ;" etc.. to make it faster.
Thanks to Chris.

SHADOW0240
  • Guests
  • Last active:
  • Joined: --
i have the same mouse and this works great outside of game!
but i need this to run in battlefield 2!
some of the other guys have gotten a few macs to work in bf2 i know we can get this one to work!

shadow0240
  • Guests
  • Last active:
  • Joined: --
thanks for your help i figured it out! i needed to compile it to exe!
thanks alot for your help!

T-nm
  • Members
  • 27 posts
  • Last active: Mar 24 2012 07:03 AM
  • Joined: 22 Jun 2006
Hmm, I didn't know that when compiled it could make a difference.

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004

Hmm, I didn't know that when compiled it could make a difference.

Sounds like a different delay was required... I doubt compiling the script did anything except change the delay unless the game checks for an AutoHotkey process name somehow which seems unlikely.

Conn
  • Guests
  • Last active:
  • Joined: --
if you are doing this for TV guide missle control in the helicopter check BF2hacks.com . there is already a script for it

  • Guests
  • Last active:
  • Joined: --
so... u gotta hit "p" to activate this then?

Harmor
  • Members
  • 182 posts
  • Last active: Sep 20 2007 05:09 AM
  • Joined: 06 Nov 2005

so... u gotta hit "p" to activate this then?


No...if your notice the first line of the code "~RButton::" you press your right mouse button to activate this code.

Here's a version of the code above that uses the middle mouse buttin instead to press the Left Mouse button repeatedly:

$MButton::
   Loop
   {
      Sleep 90 
      GetKeyState, MButtonState, LButton, P
      if MButtonState = U 
         break
      MouseClick, left,,, 1, 0, D
      Sleep, 20 
      MouseClick, left,,, 1, 0, U
   }

The "P" is just a parameter to the GetKeyState function that sets the variable MButtonState with the state of the MButton key state. In this case "P" means to return the pressed state. If MButtonState is set to 'U' that means the user has released the button, otherwise we'll keep clicking the Left Mouse button every 90 milliseconds.

Here's a variant that will correct for bullet deviation:

$MButton::
   ; Pistol - 9
   ; G36E (burst fire) - 6
   ; G36E (single shot) - 4

   Loop
   {
      Sleep 90 
      GetKeyState, MButtonState, LButton, P
      if MButtonState = U 
         break
      MouseClick, left,,, 1, 0, D
      Sleep, 20 
      MouseClick, left,,, 1, 0, U
      DllCall("mouse_event", uint, 1, int, 0, int, 6, uint,0, int,0 )
   }

//TODO: Create kewl sig...

bones
  • Guests
  • Last active:
  • Joined: --

Here's a version of the code above that uses the middle mouse buttin instead to press the Left Mouse button repeatedly:

$MButton::
   Loop
   {
      Sleep 90 
      GetKeyState, MButtonState, LButton, P
      if MButtonState = U 
         break
      MouseClick, left,,, 1, 0, D
      Sleep, 20 
      MouseClick, left,,, 1, 0, U
   }


so Harmon, if you could help me understand this
$MButton::                 ;bind middle mouse button?
   Loop                       ;loop will repeat everything in the following {}
   {
      Sleep 90              ;Sleep pauses the script for 90ms
      GetKeyState, MButtonState, LButton, P           ;checks to see if middle mouse button is pressed, but MButtonState, LButton state confuses me!  Is it checking to see if BOTH buttons are pressed?
      if MButtonState = U                  ;if middle mouse button is release stop script.
         break
      MouseClick, left,,, 1, 0, D           ; if middle mouse button down press left click THEN IM CONFUSED what does the ,,, 1, 0, D tell it to do?
      Sleep, 20 
      MouseClick, left,,, 1, 0, U
   }


Two1361
  • Guests
  • Last active:
  • Joined: --
When I press the designated button, the loop won't stop. I changed it to make Z left click repeatedly. When I hit Z, it left clicks until I kill the process.

Know how to make it stop when I let off the key?

slomz
  • Guests
  • Last active:
  • Joined: --

When I press the designated button, the loop won't stop. I changed it to make Z left click repeatedly. When I hit Z, it left clicks until I kill the process.

Know how to make it stop when I let off the key?


Yes, let's say you want it to go 4 times. On the first loop type in: Loop, 4. Then take out tall the other loops.

  • Guests
  • Last active:
  • Joined: --
I don't get it, where do you type all of this

Ilkai
  • Guests
  • Last active:
  • Joined: --
why not instead of spending all this time trying to get macros working, actually play the game the fair way. using a macro is no different to using an aimbot. if you cant beat people the way the game was made, either stop playing it, or play it more, and get good.

Mobius_One_Fox3
  • Guests
  • Last active:
  • Joined: --
im having a problem the script starts when i press but it does not stop when i let go. Im very new 2 this so if u c a problem can u please help.

Thanks In Advance