AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

BF2 MACROS (SUMMARY) - post all working macros here please
Goto page 1, 2, 3 ... 115, 116, 117  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
BF2fan
Guest





PostPosted: Thu Jul 27, 2006 10:14 pm    Post subject: BF2 MACROS (SUMMARY) - post all working macros here please Reply with quote

With all of the posts for BF2 macros, I am going to consolidate all scripts here to keep the questions down to a minimum.

I will post the links to scripts or the script itself for the most popular requests:

*Dolphin Diving
*C4 toss
*Repeat left clicks aka TV missle script
*Prone & shoot
*others
Back to top
BF2fan
Guest





PostPosted: Thu Jul 27, 2006 10:24 pm    Post subject: multiple left clicks (TV missle and auto fire) Reply with quote

Bind your windows key to trigger 10 left clicks

Code:
Lwin::
Loop, 10
{
Mouseclick, left
}
Return

;to change the key, just replace Lwin:: with another button such as Xbutton2:: for your mouse button 4


*forum thread: http://www.autohotkey.com/forum/topic10928.html&highlight=bf2

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

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


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

$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 )
}
Back to top
BF2fan
Guest





PostPosted: Thu Jul 27, 2006 10:27 pm    Post subject: combining 2 keys to a single key (prone & shoot) Reply with quote

blackrock wrote: combine 2 keys to a single key.
where n is key you are pressing to activate the two other keys.

n::
Sleep, 500
SetKeyDelay, 50, 50
Send, A
Send, w
Return


you can use this to prone and fire by assigning n to a particular mouse button and using Z and fire as the 2 keys to combine.
Back to top
BF2fan
Guest





PostPosted: Thu Jul 27, 2006 10:30 pm    Post subject: crouch-prone Reply with quote

crouch-prone repeatedly:

Code:
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
;
; Setup:
; 1. Map Crouch to 'x'
; 2. Map Prone to 'z'
;
; Description:
; 1. Press 'x' to go prone to standing repeatedly
;
#SingleInstance force
#InstallKeybdHook
;
; Only run this script when BF2.exe is running in the foreground
;
SetTimer, KeepRunning
return

KeepRunning:

; Get the process name of the active window (i.e. Notepad.exe)
WinGet, szProcessName, ProcessName, A
if szProcessName = bf2.exe
{
Suspend, off
}
else
{
Suspend, on
}
return

$^CapsLock::
ExitApp
return

$x::
Send, {x Down}
Sleep 100
Send, {z Down}
Send, {x Up}
Sleep 100
Send, {z Up}
Sleep 100
Send, {x Down}
Sleep 100
Send, {x Up}

return


*forum discussion here:
http://www.autohotkey.com/forum/topic10367.html&highlight=bf2
Back to top
BF2fan
Guest





PostPosted: Thu Jul 27, 2006 10:31 pm    Post subject: BF2: Drop Cartillery on USMC artillery as MEC on Karkand 90% Reply with quote

macro to drop cars on artillery pieces on Karkand


http://www.autohotkey.com/forum/topic11068.html&highlight=bf2
Back to top
BF2fan
Guest





PostPosted: Thu Jul 27, 2006 10:35 pm    Post subject: Dolphin Dive & Prone spam Reply with quote

http://www.autohotkey.com/forum/topic10692.html&highlight=dolphin+dive

Dolphin Dive:
Code:
#Persistent
#InstallKeybdHook
SetKeyDelay, 75, 75
; increase responsiveness
;#MaxThreadsPerHotkey 20
;#MaxThreadsBuffer on

z::
{
Sleep, 5
Send, {Space}
Sleep, 200
Send, {LShift}
Sleep, 500
Send, {LCtrl}
}
Return



Prone Spam
Code:
#Persistent
#InstallKeybdHook
SetKeyDelay, 75, 75
; increase responsiveness
;#MaxThreadsPerHotkey 20
;#MaxThreadsBuffer on

c::
{
Sleep, 5
Send, {LShift}
Sleep, 5
Send, {LCtrl}
Sleep, 5
Send, {LShift}
Sleep, 5
Send, {LCtrl}
}
Return
Back to top
WilleyE
Guest





PostPosted: Fri Jul 28, 2006 7:53 am    Post subject: C4 chuck Reply with quote

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force
#InstallKeybdHook
#InstallMouseHook

*XButton1::

Click down left
Send, {space down}
Sleep 5
Click up left
Send, {space up}
Sleep 10

return


This binds it to a side mouse button, change *XButton1:: to whatever you want you action key to be.

It simply throws C4, it doesn't switch to det, or try to move back, it leaves you in control, and ONLY throws it. You can not throw while running, because the game is coded to not be able to shoot while running.
Back to top
WilleyE
Guest





PostPosted: Fri Jul 28, 2006 7:57 am    Post subject: Reply with quote

BF2Fan, you should mention in the prone spam ones, and dolphin dives that the key would need to be remapped to match, as by default Lshift is sprint in BF2.
Back to top
BF2fan
Guest





PostPosted: Fri Jul 28, 2006 9:05 pm    Post subject: my dolphin dive macro Reply with quote

;Here is the script my friend and I use for dolphin diving.
;
;
XButton1::
If GetKeyState("Xbutton1", "P") = 1
{
Sendinput {Space down}
Sleep 5
Sendinput {Space up}
}
Loop
{
GetKeyState, state, Xbutton1, P
if state=U
break
Sleep 10
Sendinput {Z down}
Sleep 1
Sendinput {Z up}
Sleep 10
Sendinput {Z down}
Sleep 1
Sendinput {Z up}
Sleep 10
Sendinput {LCtrl down}
Sleep 1
Sendinput {LCtrl up}
Sleep 10
Sendinput {Space down}
Sleep 1
Sendinput {Space up}
}



********************
I believe if you want to repeat this dive 3 times you would need to change the line:
Loop
to say
Loop, 3
Back to top
BF2fan
Guest





PostPosted: Fri Jul 28, 2006 9:41 pm    Post subject: for XButton2 i have it set to Rapid Fire / TV missle click Reply with quote

;for rapid fire set to mouse button 5 on the side i am going to use this script...using Harmon's previous example.

$XButton2::
Loop
{
Sleep 90
GetKeyState, MButtonState, LButton, P
if MButtonState = U
break
MouseClick, left,,, 1, 0, D
Sleep, 20
MouseClick, left,,, 1, 0, U
}
Back to top
BF2fan
Guest





PostPosted: Fri Jul 28, 2006 9:53 pm    Post subject: Re: for XButton2 i have it set to Rapid Fire / TV missle cli Reply with quote

BF2fan wrote:
;for rapid fire set to mouse button 5 on the side i am going to use this script...using Harmon's previous example.


Doesn't seem to work. Any ideas???
Back to top
Bf2Highlander
Guest





PostPosted: Sat Jul 29, 2006 5:32 am    Post subject: Hey Reply with quote

Are there any PKM or MG36 macro scripts.

And is there anyway to enhance these to left button, with also sound to tell you there on.
Back to top
BF2fan
Guest





PostPosted: Sat Jul 29, 2006 6:53 am    Post subject: Re: Hey Reply with quote

Bf2Highlander wrote:
Are there any PKM or MG36 macro scripts.

And is there anyway to enhance these to left button, with also sound to tell you there on.



what kind of script are u looking for? most guys are using one that dives down>aim>and fires
i believe it would use 3 buttons: z>mouseclick right>mouseclick left
Back to top
Harmor



Joined: 06 Nov 2005
Posts: 183

PostPosted: Sat Jul 29, 2006 9:09 am    Post subject: Reply with quote

I'll post what I use when I get home later today...
_________________
//TODO: Create kewl sig...


Last edited by Harmor on Sat Jul 29, 2006 9:20 am; edited 2 times in total
Back to top
View user's profile Send private message
Harmor



Joined: 06 Nov 2005
Posts: 183

PostPosted: Sat Jul 29, 2006 9:18 am    Post subject: Reply with quote

Weird...can't edit my post above...something is wierd:

Code:
;
; AutoHotkey      Version: 1.x
; Language:       English
; Platform:       Win9x/NT
;
;
; Only run this script when bf2.exe is running in the foreground
;
#SingleInstance force
#InstallKeybdHook
#InstallMouseHook


SetTimer, KeepRunning
return

KeepRunning:

  ; Get the process name of the active window (i.e. Notepad.exe)
  WinGet, szProcessName, ProcessName, A
  if szProcessName = bf2.exe
  {
    Suspend, off
  }
  else
  {
    Suspend, on
  }
return

;
; Disable the Window's keys so they don't switch to desktop while in-game
;
$LWin::   ; Left Windows Button
$RWin::   ; Right Windows Button
   ; Do nothing
return

$^CapsLock::
   ExitApp
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Pressing Ctrl+V while BF2 is active
;
$^v::
   Sleep 200
   SetKeyDelay, 40
   Send,  {Space}%clipboard%
   SetKeyDelay, 0
return
;
; Prone spam
;
$x::
   Send, {x Down}
   Sleep 100
   Send, {z Down}
   Send, {x Up}
   Sleep 100
   Send, {z Up}
   Sleep 100
   Send, {x Down}
   Sleep 100
   Send, {x Up}
   Sleep 100

return

SayToAll(a_szMessage)
{
   SetKeyDelay, 40
   Send, {j Down}
   Sleep 100
   Send, {j Up}
   Send, %a_szMessage%{Enter}
   SetKeyDelay, 0
   
}

SayToSquad(a_szMessage)
{
   SetKeyDelay, 40
   Send, {l Down}
   Sleep 100
   Send, {l Up}
   Send, %a_szMessage%{Enter}
   SetKeyDelay, 0
   
}

SayToTeam(a_szMessage)
{
   SetKeyDelay, 40
   Send, {k Down}
   Sleep 100
   Send, {k Up}
   Send, %a_szMessage%{Enter}
   SetKeyDelay, 0
   
}

$Numpad1::
$NumpadEnd::
   SayToTeam("I'm using the APC because no one else is...if you want it get in and ask me to Bail out")
return

$Numpad2::
$NumpadDown::
   SayToTeam("Enemy near the Hotel!!!")
return

$Numpad3::
$NumpadPgDn::
   SayToTeam("Armor available at Gas Station")
return

$Numpad4::
$NumpadLeft::
   SayToAll("GLICHERS IN HOTEL!!!!")
return

$Numpad5::
$NumpadClear::
   SayToSquad("Enemy nearby, cover me")
return

$Numpad6::
$NumpadRight::
   SayToSquad("Go ahead, I'll cover your back")
return



;
; Bounce up/down and jump sideways while shooting
;
$c::
   Send, {x Down}
   Sleep 100
   Send, {d Down}
   Send, {x Up}
   Sleep 100
   Send, {Space Down}
   Sleep 500
   Send, {d Up}
   Send, {Space Up}
   Sleep 100
   Send, {x Down}
   Sleep 100
   Send, {z Down}
   Send, {x Up}
   Sleep 100
   Send, {z Up}
   Sleep 100
return
;
;  TV guided Missle - not working
;
;$^6::
;   If GetKeyState("6", "P") = 1
;   {
;      Sendinput {F2 down}
;      Sleep 1
;      Sendinput {F2 up}
;      Sleep 200
;      Sendinput {Click right down}
;      Sleep 25
;      Sendinput {Click right up}
;      Sleep 100
;
;      Loop
;      {
;         If GetKeyState("Mbutton", "P") = 0
;         {
;         Sendinput {F1 down}
;         Sleep 10
;         Sendinput {F1 up}
;         }
;         GetKeyState, state, MButton, P
;         if state=U
;         break
;         Sendinput {Click down}
;         Sleep 25
;         Sendinput {Click up}
;         Sleep 25
;      }
;   }
;
;return


SpotHere()
{
   MouseGetPos, , ypos
   offsetY := 30
   ; TODO: Figure out coord system, coordinate system migrates
   ;if(ypos > 382)
   ;{
   ;   offsetY := offsetY - ypos + 382
   ;}
   sleep 20
   MouseClick, Right, , , , , D
   sleep 40
   MouseClick, Right, , , , , U
   DllCall("mouse_event", uint,1, int,20, int,offsetY, uint,0, int,0 )
;   SayToTeam("ypos ". ypos . " offsetY " . offsetY)
   sleep 40
   MouseClick, Left, , , , , D
   sleep 40
   MouseClick, Left, , , , , U
   DllCall("mouse_event", uint,1, int,-20, int,-offsetY, uint,0, int,0 )
   Sleep 200
}
;
; Spot in 20x20 square area in Commander screen
;
$^LButton::
   DllCall("mouse_event", uint, 1, int, -10, int, -10, uint,0, int,0 )
   SpotHere()
   DllCall("mouse_event", uint, 1, int, 20, int, 0, uint,0, int,0 )
   SpotHere()
   DllCall("mouse_event", uint, 1, int, 0, int, 20, uint,0, int,0 )
   SpotHere()
   DllCall("mouse_event", uint, 1, int, -20, int, 0, uint,0, int,0 )
   SpotHere()
return
;
; Continually click Left Mouse Button while holding Middle Mouse button
;
$MButton::
   ; Pistol         9
   ; G36E (burst fire)  6
   ; G36E (single shot) 4
   ; G36E (zoomed)   2
   ; DAO 16

   Loop
   {
      Sleep 90
      GetKeyState, MButtonState, MButton, P
      if MButtonState = U
         break
      MouseClick, left,,, 1, 0, D
      Sleep, 20
      MouseClick, left,,, 1, 0, U
      ; Correct for bullet deviation by moving down X pixels
      DllCall("mouse_event", uint, 1, int, 0, int, 6, uint,0, int,0 )
   }

return
;
; Cartillery: USMC Left artillery - Karkand
;
$Numpad7::
$NumpadHome:
   DllCall("mouse_event", uint,1, int,-2000, int,-2000, uint,0, int,0 )
   sleep 100
   DllCall("mouse_event", uint,1, int,332, int,342, uint,0, int,0 )
   sleep 20
   MouseClick, Right, , , , , D
   sleep 40
   MouseClick, Right, , , , , U
   DllCall("mouse_event", uint,1, int,20, int,42, uint,0, int,0 )
   sleep 40
   MouseClick, Left, , , , , D
   sleep 40
   MouseClick, Left, , , , , U
return
;
; Double click on first server in list (favorites) and
; then press the OK button 2 seconds later
;
$Numpad8::
$NumpadUp:
 
   MouseClick, Left, 413, 145
   MouseClick, Left, 413, 145
   Sleep 2000
   MouseClick, Left, 614, 404
return
;
; Cartillery: USMC Right artillery - Karkand
;
$Numpad9::
$NumpadPgUp:
   DllCall("mouse_event", uint,1, int,-2000, int,-2000, uint,0, int,0 )
   sleep 100
   DllCall("mouse_event", uint,1, int,378, int,328, uint,0, int,0 )
   sleep 20
   MouseClick, Right, , , , , D
   sleep 40
   MouseClick, Right, , , , , U
   DllCall("mouse_event", uint,1, int,20, int,58, uint,0, int,0 )
   sleep 40
   MouseClick, Left, , , , , D
   sleep 40
   MouseClick, Left, , , , , U
return
;
; Press Joy5 to say "I'm sorry" using the Cammo Rose while flying
;
$Joy5::
   Send, {q Down}
   Sleep 200
   DllCall("mouse_event", uint,1, int,300, int,10, uint,0, int,0 )
   Sleep 40
   MouseClick, Left, , , , , D
   sleep 40
   MouseClick, Left, , , , , U
   Send, {q Up}
return
;
; Press Joy6 to spot a target directly in front of you using the Cammo Rose while flying
;
$Joy6::
   Send, {q Down}
   Sleep 100
   MouseClick, Left, , , , , D
   sleep 40
   MouseClick, Left, , , , , U
   Send, {q Up}
return

_________________
//TODO: Create kewl sig...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3 ... 115, 116, 117  Next
Page 1 of 117

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group