Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    wyvern1990's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    132
    Reputation
    10
    Thanks
    1,846

    Post Universal Recoil V3 AHK

    Hi All!!

    i "made" a anti recoil script with save function!

    Most o the code i used is from an other script, wich i did modify to my likings.

    Just copy the code below in AHK and you are ready to go!

    I changed the "delay" with RPM (Rounds Per Minute)

    Ex: RPM = 800
    3600000/RPM/60
    RPS = 75 milliseconds

    So every 75 millisecond the mouse is pulled X pixels

    Cheers!



    __________________________________________________ ________


    Code:
    ;-------------------------------------------------------------------------------
    ;	GENERAL SETTINGS
    ;-------------------------------------------------------------------------------
    
    #NoEnv
    #SingleInstance force
    #maxthreadsperhotkey 5
    #InstallKeybdHook
    #InstallMouseHook
    
    
    SendMode Input
    SetKeyDelay, 0
    SetMouseDelay, 0
    
    ;SetWorkingDir %A_ScriptDir%
    ;ScriptName := A_ScriptName
    ;StringReplace, ScriptName, ScriptName, .ahk,, All
    ;StringReplace, ScriptName, ScriptName, .exe,, All
    
    ;-------------------------------------------------------------------------------
    ;	Vars
    ;-------------------------------------------------------------------------------
    
    rpm = 800
    NoRecoil = 0
    enough = 0
    period = 6000
    ;xhair = 0
    
    
    PixelUp = pgup
    PixelDown = pgdn
    PixelLeft = del
    PixelRight = end
    ToggleNoRecoil = NumpadMult
    DelayUp = NumpadAdd
    DelayDown = NumpadSub
    PeriodUp = 
    PeriodDown = 
    LargeRecoilPreset = Numpad0
    SmallRecoilPreset = Numpad1 
    MoveY = LButton
    
    
    ;-------------------------------------------------------------------------------
    ;	Hotkeys
    ;-------------------------------------------------------------------------------
    
    Hotkey, ~*$%PixelLeft%, DoPixelLeft
    Hotkey, ~*$%PixelRight%, DoPixelRight
    Hotkey, ~*$%PixelUp%, DoPixelUp
    Hotkey, ~*$%PixelDown%, DoPixelDown
    HotKey, ~*$%ToggleNoRecoil%, DoToggleNoRecoil
    HotKey, ~*$%DelayUp%, DoDelayUp
    HotKey, ~*$%DelayDown%, DoDelayDown
    HotKey, ~*$%PeriodUp%, DoPeriodUp
    HotKey, ~*$%PeriodDown%, DoPeriodDown
    HotKey, ~*$%LargeRecoilPreset%, GetFromINI
    HotKey, ~*$%SmallRecoilPreset%, SaveToINI
    HotKey, ~*$%MoveY%, DoMoveY
    
    
    ;-------------------------------------------------------------------------------
    ;	Functions
    ;-------------------------------------------------------------------------------
    
    
    TipRPS(PopupText)
    {
    	Gui, Destroy
    	Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
    	Gui, Color, 000000
    	WinSet, Transparent, 100
    	Gui, Font, s8, norm, Verdana
    	Gui, Add, Text, x5 y5 c00ff00, %PopupText%
    	Gui, Show, NoActivate X0 Y36
    	
    }
    
    
    TipOn(PopupText)
    {   
    	Gui, Destroy
    	Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
    	Gui, Color, 000000
    	WinSet, Transparent, 100
    	Gui, Font, s8, norm, Verdana
    	Gui, Add, Text, x5 y5 c00ff00, %PopupText%
    	Gui, Show, NoActivate X0 Y18
    }
    
    TipOff(PopupText)
    {
    	Gui, Destroy 
    	Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
    	Gui, Color, 000000
    	WinSet, Transparent, 100
    	Gui, Font, s8, norm, Verdana
    	Gui, Add, Text, x5 y5 cff0000, %PopupText%
    	Gui, Show, NoActivate X0 Y54
    }
    
    
    ;-------------------------------------------------------------------------------
    ;	Hotkey labels
    ;-------------------------------------------------------------------------------
    
    TipClear:
    	loop
    	{
    		Gui, Destroy
    		sleep 5000
    	}
    return
    
    DoToggleNoRecoil:
    	if NoRecoil < 1
    	{
    		NoRecoil += 1
    		if NoRecoil = 1
    		{
    			SoundBeep, 800, 200
    			TipOn("ON")
    		}
    	}
    	else
    	{
    		NoRecoil := 0
    		SoundBeep, 200, 100
    		SoundBeep, 200, 100
    		TipOff("OFF")
    	}
    	return
    
    DoPixelLeft:
            if pixelx < 10
                     pixelx += 1
            TipOn("Pixel X Is " pixelX)
            return
    
    DoPixelRight:
            if pixelx > -10
                     pixelx -= 1
            TipOn("Pixel X Is " pixelX)
            return
    
    DoPixelUp:
    	if pixely < 50
    		pixely += 1
    	TipOn("Pixel Y Is " pixelY)
    	return
    
    DoPixelDown:
    	if pixely > 0
    		pixely -= 1
    	TipOn("Pixel Y Is " pixelY)
    	return
    
    DoDelayUp:
    	if rpm > 500
    		rpm -= 10
    	TipRPS("RPM: " rpm "  " "RPS:"  f(rpm)) 
    	return
    
    DoDelayDown:
    	if rpm < 1500
    		rpm += 10
    	TipRPS("RPM: " rpm "  " "RPS:"  f(rpm) )
    	return
    
    DoPeriodUp:
    	if period > 100
    		period -= 100
    	TipOn("PERIOD IS " period)
    	return
    
    DoPeriodDown:
    	if period < 6000
    		period += 100
    	TipOn("PERIOD IS " period)
    	return
    
    GetFromINI:
    {
    InputBox, WeaponCall, WeaponCall, , Show, 200, 100
    if ErrorLevel	
    	
    return
    
    else
    IniRead,pixely,%A_WorkingDir%\config.ini,%WeaponCall%,Y
    IniRead,pixelx,%A_WorkingDir%\config.ini,%WeaponCall%,X
    IniRead,rpm,%A_WorkingDir%\config.ini,%WeaponCall%,rpm
    TipRPS(" Loaded!!    Weapon : " WeaponCall " " "Y : "pixely "  " "X : "pixelx "  "  "RPM : " rpm) 
    }
    sleep 4000
    Gui, destroy
    return
    ;put in name of weapon before write to INI, every preset can be saved seperate.
    
    SaveToINI:   
    {
    
    InputBox, WeaponSend, WeaponSend, , Show, 200, 100,
    if ErrorLevel	
    	
    return
    
    else
    IniWrite,%pixely%,%A_WorkingDir%\config.ini,%WeaponSend%,Y
    IniWrite,%pixelx%,%A_WorkingDir%\config.ini,%WeaponSend%,X
    IniWrite,%rpm%,%A_WorkingDir%\config.ini,%WeaponSend%,rpm
    TipRPS(" Saved!!    Weapon :" WeaponSend " " "Y :" pixely "  " "X : " pixelx "  "  "RPM :" rpm)
    }
    sleep 4000
    Gui, Destroy
    return
    
    
    
    
    DoMoveY: 
    	if NoRecoil = 1	
    		{
    			xhair = 0
    			enough = 0
    			GetKeyState, state, LButton, P
    			if state = U
    				return
    		    sleep % f(rpm)
    				loop
    				{
    					GetKeyState, state2, LButton, P
    					if state2 = U
    						break
    					if enough = 1
    						break
    					DllCall("mouse_event", uint, 1, int, pixelx, int, pixely, uint, 0, int, 0)
    					f(n)
                        {
    				
    					   return Round(3600000/n/60)
    					}
    					   sleep % f(rpm)	
    				}
    		}
    	return
    
    Interrupt:
    enough = 1
    	return
    Last edited by Mayion; 02-09-2015 at 10:18 PM.

  2. #2
    waynomat's Avatar
    Join Date
    Dec 2012
    Gender
    female
    Posts
    92
    Reputation
    10
    Thanks
    301
    works nicely, but seriously needs a "first shot" compensation, else the recoil kicks in after the first bullet with the biggest recoil value (instead of compensating it).
    step two would be a more userfriendly interface for saving/loading weapons. right now, you have to type in the template name you saved before instead of chosing from a dropdown list.

  3. #3
    Yellow 13's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    1,443
    Reputation
    96
    Thanks
    4,443
    Quote Originally Posted by wyvern1990 View Post
    Hi All!!

    i "made" a anti recoil script with save function!

    Most o the code i used is from an other script, wich i did modify to my likings.

    Just copy the code below in AHK and you are ready to go!

    I changed the "delay" with RPM (Rounds Per Minute)

    Ex: RPM = 800
    3600000/RPM/60
    RPS = 75 milliseconds

    So every 75 millisecond the mouse is pulled X pixels

    Cheers!



    __________________________________________________ ________


    Code:
    ;-------------------------------------------------------------------------------
    ;	GENERAL SETTINGS
    ;-------------------------------------------------------------------------------
    
    #NoEnv
    #SingleInstance force
    #maxthreadsperhotkey 5
    #InstallKeybdHook
    #InstallMouseHook
    
    
    SendMode Input
    SetKeyDelay, 0
    SetMouseDelay, 0
    
    ;SetWorkingDir %A_ScriptDir%
    ;ScriptName := A_ScriptName
    ;StringReplace, ScriptName, ScriptName, .ahk,, All
    ;StringReplace, ScriptName, ScriptName, .exe,, All
    
    ;-------------------------------------------------------------------------------
    ;	Vars
    ;-------------------------------------------------------------------------------
    
    rpm = 800
    NoRecoil = 0
    enough = 0
    period = 6000
    ;xhair = 0
    
    
    PixelUp = pgup
    PixelDown = pgdn
    PixelLeft = del
    PixelRight = end
    ToggleNoRecoil = NumpadMult
    DelayUp = NumpadAdd
    DelayDown = NumpadSub
    PeriodUp = 
    PeriodDown = 
    LargeRecoilPreset = Numpad0
    SmallRecoilPreset = Numpad1 
    MoveY = LButton
    
    
    ;-------------------------------------------------------------------------------
    ;	Hotkeys
    ;-------------------------------------------------------------------------------
    
    Hotkey, ~*$%PixelLeft%, DoPixelLeft
    Hotkey, ~*$%PixelRight%, DoPixelRight
    Hotkey, ~*$%PixelUp%, DoPixelUp
    Hotkey, ~*$%PixelDown%, DoPixelDown
    HotKey, ~*$%ToggleNoRecoil%, DoToggleNoRecoil
    HotKey, ~*$%DelayUp%, DoDelayUp
    HotKey, ~*$%DelayDown%, DoDelayDown
    HotKey, ~*$%PeriodUp%, DoPeriodUp
    HotKey, ~*$%PeriodDown%, DoPeriodDown
    HotKey, ~*$%LargeRecoilPreset%, GetFromINI
    HotKey, ~*$%SmallRecoilPreset%, SaveToINI
    HotKey, ~*$%MoveY%, DoMoveY
    
    
    ;-------------------------------------------------------------------------------
    ;	Functions
    ;-------------------------------------------------------------------------------
    
    
    TipRPS(PopupText)
    {
    	Gui, Destroy
    	Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
    	Gui, Color, 000000
    	WinSet, Transparent, 100
    	Gui, Font, s8, norm, Verdana
    	Gui, Add, Text, x5 y5 c00ff00, %PopupText%
    	Gui, Show, NoActivate X0 Y36
    	
    }
    
    
    TipOn(PopupText)
    {   
    	Gui, Destroy
    	Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
    	Gui, Color, 000000
    	WinSet, Transparent, 100
    	Gui, Font, s8, norm, Verdana
    	Gui, Add, Text, x5 y5 c00ff00, %PopupText%
    	Gui, Show, NoActivate X0 Y18
    }
    
    TipOff(PopupText)
    {
    	Gui, Destroy 
    	Gui, +AlwaysOnTop +ToolWindow -SysMenu -Caption
    	Gui, Color, 000000
    	WinSet, Transparent, 100
    	Gui, Font, s8, norm, Verdana
    	Gui, Add, Text, x5 y5 cff0000, %PopupText%
    	Gui, Show, NoActivate X0 Y54
    }
    
    
    ;-------------------------------------------------------------------------------
    ;	Hotkey labels
    ;-------------------------------------------------------------------------------
    
    TipClear:
    	loop
    	{
    		Gui, Destroy
    		sleep 5000
    	}
    return
    
    DoToggleNoRecoil:
    	if NoRecoil < 1
    	{
    		NoRecoil += 1
    		if NoRecoil = 1
    		{
    			SoundBeep, 800, 200
    			TipOn("ON")
    		}
    	}
    	else
    	{
    		NoRecoil := 0
    		SoundBeep, 200, 100
    		SoundBeep, 200, 100
    		TipOff("OFF")
    	}
    	return
    
    DoPixelLeft:
            if pixelx < 10
                     pixelx += 1
            TipOn("Pixel X Is " pixelX)
            return
    
    DoPixelRight:
            if pixelx > -10
                     pixelx -= 1
            TipOn("Pixel X Is " pixelX)
            return
    
    DoPixelUp:
    	if pixely < 50
    		pixely += 1
    	TipOn("Pixel Y Is " pixelY)
    	return
    
    DoPixelDown:
    	if pixely > 0
    		pixely -= 1
    	TipOn("Pixel Y Is " pixelY)
    	return
    
    DoDelayUp:
    	if rpm > 500
    		rpm -= 10
    	TipRPS("RPM: " rpm "  " "RPS:"  f(rpm)) 
    	return
    
    DoDelayDown:
    	if rpm < 1500
    		rpm += 10
    	TipRPS("RPM: " rpm "  " "RPS:"  f(rpm) )
    	return
    
    DoPeriodUp:
    	if period > 100
    		period -= 100
    	TipOn("PERIOD IS " period)
    	return
    
    DoPeriodDown:
    	if period < 6000
    		period += 100
    	TipOn("PERIOD IS " period)
    	return
    
    GetFromINI:
    {
    InputBox, WeaponCall, WeaponCall, , Show, 200, 100
    if ErrorLevel	
    	
    return
    
    else
    IniRead,pixely,%A_WorkingDir%\config.ini,%WeaponCall%,Y
    IniRead,pixelx,%A_WorkingDir%\config.ini,%WeaponCall%,X
    IniRead,rpm,%A_WorkingDir%\config.ini,%WeaponCall%,rpm
    TipRPS(" Loaded!!    Weapon : " WeaponCall " " "Y : "pixely "  " "X : "pixelx "  "  "RPM : " rpm) 
    }
    sleep 4000
    Gui, destroy
    return
    ;put in name of weapon before write to INI, every preset can be saved seperate.
    
    SaveToINI:   
    {
    
    InputBox, WeaponSend, WeaponSend, , Show, 200, 100,
    if ErrorLevel	
    	
    return
    
    else
    IniWrite,%pixely%,%A_WorkingDir%\config.ini,%WeaponSend%,Y
    IniWrite,%pixelx%,%A_WorkingDir%\config.ini,%WeaponSend%,X
    IniWrite,%rpm%,%A_WorkingDir%\config.ini,%WeaponSend%,rpm
    TipRPS(" Saved!!    Weapon :" WeaponSend " " "Y :" pixely "  " "X : " pixelx "  "  "RPM :" rpm)
    }
    sleep 4000
    Gui, Destroy
    return
    
    
    
    
    DoMoveY: 
    	if NoRecoil = 1	
    		{
    			xhair = 0
    			enough = 0
    			GetKeyState, state, LButton, P
    			if state = U
    				return
    		    sleep % f(rpm)
    				loop
    				{
    					GetKeyState, state2, LButton, P
    					if state2 = U
    						break
    					if enough = 1
    						break
    					DllCall("mouse_event", uint, 1, int, pixelx, int, pixely, uint, 0, int, 0)
    					f(n)
                        {
    				
    					   return Round(3600000/n/60)
    					}
    					   sleep % f(rpm)	
    				}
    		}
    	return
    
    Interrupt:
    enough = 1
    	return
    AHK cannot be used in BF4 due to PB/FF blacklisting the app.
    Last edited by Mayion; 02-11-2015 at 03:52 AM.

  4. #4
    1nsanety's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    I used AHK for about 2 matches today with no problems... maybe was luck xD

  5. #5
    wyvern1990's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    132
    Reputation
    10
    Thanks
    1,846
    yea i use it to all of the time no problems here.

    yellow13 then convert it to an exe
    waynomat, already thinking about it. Just got into scripting for 5 days. But im somewhat setisfied and thought to share it.
    Maybe more updates in the future, for now it is As Is.

  6. #6
    afxtwn's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Posts
    11
    Reputation
    10
    Thanks
    0
    Is there a how to for these?

  7. #7
    wyvern1990's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    132
    Reputation
    10
    Thanks
    1,846
    Read the OP 1 more time and the VAR section
    Last edited by wyvern1990; 02-09-2015 at 09:02 PM.

  8. #8
    Yellow 13's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    1,443
    Reputation
    96
    Thanks
    4,443
    Quote Originally Posted by wyvern1990 View Post
    Read the OP 1 more time and the VAR section
    You have to remember that most people in the BF4 section is dumb as a rock, can't even read the first post. Then after you instruct them to read the OP, they give up and come crying back bitching how you should do it for them lol.

    Just an advice.
    Rig | 5820K - 16G 2400 - GTX1080 AMP - 850EVO 1TB - W7U
    Laptop | Alienware 15R3 | 6820HK - 16G 2666 - GTX1070 - 512NVME - W10P
    Laptop | MacBook Pro 2016 | 6920HQ - 16G 2133 - RP460 4GB - 2TB NVME - OSX

  9. #9
    1nsanety's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    when I try to copy paste the code I get this: ' Error at line 188.The following variable contains an illegal character :"WeaponCa ll". The program will exit. ' Any1 know the cause and possible solution to it? Thx

  10. #10
    waynomat's Avatar
    Join Date
    Dec 2012
    Gender
    female
    Posts
    92
    Reputation
    10
    Thanks
    301
    Quote Originally Posted by 1nsanety View Post
    when I try to copy paste the code I get this: ' Error at line 188.The following variable contains an illegal character :"WeaponCa ll". The program will exit. ' Any1 know the cause and possible solution to it? Thx
    Remove the empty spaces in the commands here "WeaponCall". There are quite a few commands with empty spaces (copy&paste formatting error i guess) - the script will work after successfully removing them.

  11. #11
    1nsanety's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    tried a few more times to copy paste and it works now but whatever way I edit the rpm when I save it it always say 800...

    LE : Nvm seems fine now

    - - - Updated - - -

    what can be done when I try to save ,load or edit a weapon script that AHK wont minimize the BF4 window ? as is kinda annoying doing anything to it and get your game minimzed all the time ... Thx in advance
    Last edited by 1nsanety; 02-10-2015 at 11:35 AM.

  12. #12
    wyvern1990's Avatar
    Join Date
    Jun 2012
    Gender
    male
    Posts
    132
    Reputation
    10
    Thanks
    1,846
    Quote Originally Posted by 1nsanety View Post
    tried a few more times to copy paste and it works now but whatever way I edit the rpm when I save it it always say 800...

    LE : Nvm seems fine now

    - - - Updated - - -

    what can be done when I try to save ,load or edit a weapon script that AHK wont minimize the BF4 window ? as is kinda annoying doing anything to it and get your game minimzed all the time ... Thx in advance
    I use this script with games in "Borderless Window" mode.
    that is the only fix atm.

  13. #13
    1nsanety's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    thx wyvern

  14. #14
    kenny5710's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Location
    France
    Posts
    24
    Reputation
    10
    Thanks
    0
    thanks for the cheat

  15. #15
    manish_ranger's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    0
    thnx dude gr8 job

Page 1 of 2 12 LastLast

Similar Threads

  1. [Help] How to fix this Recoil Reducer AHK script?
    By Feroztier in forum Counter Strike: Global Offensive Coding & Resources
    Replies: 1
    Last Post: 03-20-2015, 04:03 AM
  2. [Release] Counter Strike: GO Recoil Reducer AHK
    By Kylux in forum Counter Strike: Global Offensive Coding & Resources
    Replies: 40
    Last Post: 02-08-2015, 01:52 PM
  3. [Release] Universal Recoil Reducer v1.0
    By 63OR63 in forum CounterStrike: Global Offensive Hacks
    Replies: 37
    Last Post: 07-08-2014, 09:02 PM
  4. [Release] Universal Recoil Reducer v2.0
    By 63OR63 in forum CounterStrike: Global Offensive Hacks
    Replies: 346
    Last Post: 03-04-2014, 04:21 PM
  5. universal recoil reducer
    By sht2theheart in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 29
    Last Post: 04-27-2010, 12:35 PM

Tags for this Thread