Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

BF4 Script - IfWinActive, Battlefield


  • Please log in to reply
7 replies to this topic
Gatekeeper
  • Members
  • 2 posts
  • Last active: Jan 19 2014 07:20 PM
  • Joined: 29 Dec 2013

Hello 

 

I thought I would share this, I got this to function so that I could leave the script running and only have Suspend, off when BF4 was running 

The sleep times would have to be adjusted for a players style and IO speeds I assume

 

Any other tweaks or feedback is appreciated  :-) 

SetTitleMatchMode, 1
SetTitleMatchMode, Slow
Loop{ 
    IfWinActive, Battlefield
    { 
        Suspend, off
    } 
    else 
    {    
        Suspend, on
    } 
}

;================== Toggle suspend in game if the above loop is not desired
F6::suspend 

;================== Auto holds breath when zoomed @key RButton - set steady to " hold " @key t
~RButton::
Sleep 600 
Send {t down}
Sleep 200 
Send {t up}
return

;================== Prone @key9 when reloading @key8
~8::9

;================== ONE BUTTON DEFIB / CLAYMORE / MINE ==========
;=== If Scroll Lock is down
;===  When DEFIB or CLAYMORE or MINE  is pressed @key 4  . . . . . . 
;=== GO Prone @key 9 - Click the Mouse to deploy / Defib  - Switch back to Primary weapon @key 1
~4::
GetKeyState, state, scrolllock, T
if state = D
{
Sleep 400 
Send {9 down}
Sleep 100 
Send {9 up}
Sleep 500 
   MouseClick, left,,, 1, 0, D
    Sleep 75
    MouseClick, left,,, 1, 0, U
       Sleep 75
Sleep 600 
Send {1 down}
Sleep 100 
Send {1 up}
}
return
;==================CAPS LOCK AUTO SINGLE FIRE WEAPON===========
;=== If Caps Lock is DOWN repeatedly click the Left Mouse when held down
;=== This is priceless when using the DMR weapons with low recoil - and killer for Handguns 

;=== To modify for handguns only, simply bind the secondary weapon key to set caps lock down 
;=== then Primary weapon key to set caps lock up 


~LButton::
GetKeyState, state, capslock, T 
if state = D
{
    Loop
    {
   GetKeyState, LButtonState, LButton, P
    if LButtonState = U
    {
       break
    }
   MouseClick, left,,, 1, 0, D
    Sleep 75
    MouseClick, left,,, 1, 0, U
       Sleep 75
; === TODO: 
; === Add recoil reduction mouse movement function here
; === Should have a couple variables to be able to adjust for different weapon stability
; === uncertain if this would be " Legal " 
    }
}
return
=================================================


jelllo
  • Members
  • 1 posts
  • Last active: Jan 07 2014 12:11 PM
  • Joined: 03 Jan 2014

sounds very usefull!
i'll try this shortly and give a reply.
plz keep on working on this.



Ryix
  • Members
  • 12 posts
  • Last active: Apr 23 2014 11:34 AM
  • Joined: 03 Jan 2014

Disapproving aside, i should point out autohotkey is fairly well known macro program and its process likely scanned for by punkbuster. I wouldnt suggest using this script at all unless you want to buy another copy of BF4.

The rapid fire for dmr/pistol thing however, explains so much, alot of full-auto dmr's out there at the moment... ya git!



stemsmit
  • Members
  • 17 posts
  • Last active: Apr 27 2014 03:16 PM
  • Joined: 16 May 2013

How likely is it that punkbuster picks up AHK?



nbbsn
  • Members
  • 2 posts
  • Last active: Apr 27 2014 01:45 AM
  • Joined: 12 Nov 2013

How likely is it that punkbuster picks up AHK?

Very likely imo.

I got kicked a lot from Punkbuster in BF3 when I forgot to stop my AHK scripts (and those were just my regular scripts for text expansion and launching programs).



Issvor
  • Members
  • 2 posts
  • Last active: Jan 24 2014 10:52 PM
  • Joined: 19 Jan 2014

Disapproving aside, i should point out autohotkey is fairly well known macro program and its process likely scanned for by punkbuster. I wouldnt suggest using this script at all unless you want to buy another copy of BF4.

The rapid fire for dmr/pistol thing however, explains so much, alot of full-auto dmr's out there at the moment... ya git!

I have a ahk for a few alt codes, would it pick up that? Or does it pick up anything that deals with ahk?



Gatekeeper
  • Members
  • 2 posts
  • Last active: Jan 19 2014 07:20 PM
  • Joined: 29 Dec 2013

@ Jello - Thanks  :shy:. .. . workin' on it occasionally, not much more I wish to do really the recoil mouse movement would be over the top I think.
@ Ryix / Isvor / stemsmit / nbbsn - B) Compile your scripts into an EXE and run that instead of running the AutoHotKey.exe - Problem solved

In relation to whether or not you disapprove - This script is nothing more than what can be done with a good programmable mouse,  without the $169 cost

A side note on PB :angry:
I have been getting kicked since the PB last patch for " Disallowed Program/Driver [130827]  "
After some debugging - I discovered this is NOT for the compiled  AHK exe but for running Sapphire TRIXX.exe
PB telling me that  I CAN NOT overclock my video card is a bit overbearing I think . . .so  . . .
Rename Trixx.exe to  WeClockWhatWeWant.exe - Problem Solved



Ryix
  • Members
  • 12 posts
  • Last active: Apr 23 2014 11:34 AM
  • Joined: 03 Jan 2014

Is PB not smart enough to see through a rename of an exe? or a compiled script?