The RPM is function is used to calculate when to pull the mosue down.
like: RPM = 800 would be 60000(ms)/800 = 75ms so every 75MS the mouse is pulled down bij X# of pixels.
Have fun and play with it.
(Need iniLib to save settings)
HOW TO USE:
1. Open Game(Windowed-Borderless)
2. Open Anti-Recoil.
3. Make settings
4. Save.
Shots before Y Down = Ins
Shots before Y UP = Home
Pixels up/down/left/right
PixelUp = pgup
PixelDown = pgdn
PixelLeft = del
PixelRight = end
Toggle Anti-Recoil = NumpadMult
Tap Firing = NumPad6
Skip First Shot = NumPad1
IF SFS is ON can use FSM
First Shot Multipliers = NumPad2
rpm + = NumpadAdd
rpm - = NumpadSub
;Save and Load Function
Load and Save = Numpad0
use Anti Recoil = R + L MouseButton
#NoEnv
#SingleInstance force
;#InstallKeybdHook
;#InstallMouseHook
#include IniLib1.0.ahk
SetBatchLines, -1
SetTitleMatchMode, 3
SetTitleMatchMode, Fast
#MaxThreadsPerHotkey 3
;-------------------------------------------------------------------------------
; Vars
;-------------------------------------------------------------------------------
PorS = 1
Both = 1
FSM = 1.00
SFS = 1
ReadWin = 0
Tap = 0
SH = 1
pixelx = 0
pixely = 0
rpm = 800
NoRecoil = 0
enough = 0
;xhair = 00
Wheel_Count = 1
; X shots before to go Left/Right
SHDown = Ins
SHUP = Home
;Pixels up/down/left/right
PixelUp = pgup
PixelDown = pgdn
PixelLeft = del
PixelRight = end
;On/OFF
ToggleNoRecoil = NumpadMult
;RPM
DelayUp = NumpadAdd
DelayDown = NumpadSub
;Save and Load Function
BothButtons = LButton
;-------------------------------------------------------------------------------
; Hotkeys
;-------------------------------------------------------------------------------
Hotkey, ~*$%SHDown%, DoSHDown
Hotkey, ~*$%SHUp%, DoSHUp
Hotkey, ~*$%PixelLeft%, DoPixelLeft
Hotkey, ~*$%PixelRight%, DoPixelRight
Hotkey, ~*$%PixelUp%, DoPixelUp
Hotkey, ~*$%PixelDown%, DoPixelDown
HotKey, ~*$%ToggleNoRecoil%, DoToggleNoRecoil
HotKey, ~*$%DelayUp%, DoDelayUp
HotKey, ~*$%DelayDown%, DoDelayDown
Hotkey, ~*$%BothButtons%, BothButtons
Hotkey ~*WheelUp, WheelCount_Up, On B0 T20
Hotkey ~*WheelDown, WheelCount_Down, On B0 T20
SetTimer,CheckActiveWin, 500
;-------------------------------------------------------------------------------
; Functions
;-------------------------------------------------------------------------------
TipRPS(PopupText)
{
Gui,2: Destroy
Gui,2: +AlwaysOnTop +ToolWindow -SysMenu -Caption
Gui,2: Color, 000000
;WinSet, Transparent, 100
Gui,2: Font, s8, norm, Verdana
Gui,2: Add, Text, x5 y5 c00ff00, %PopupText%
Gui,2: Show, NoActivate X0 Y36
}
TipOn(PopupText)
{
Gui,2: Destroy
Gui,2: +AlwaysOnTop +ToolWindow -SysMenu -Caption
Gui,2: Color, 000000
;gui, 2: WinSet, Transparent, 100
Gui,2: Font, s8, norm, Verdana
Gui,2: Add, Text, x5 y5 c00ff00, %PopupText%
Gui,2: Show, NoActivate X0 Y18
}
TipOff(PopupText)
{
Gui,2: Destroy
Gui,2: +AlwaysOnTop +ToolWindow -SysMenu -Caption
Gui,2: Color, 000000
;Gui, 2: WinSet, Transparent, 100
Gui,2: Font, s8, norm, Verdana
Gui,2: Add, Text, x5 y5 cff0000, %PopupText%
Gui,2: Show, NoActivate X0 Y54
}
TipClear:
{
SetTimer,TipClear, 2000
Gui,2: destroy
}
return
;-------------------------------------------------------------------------------
; Hotkey labels
;-------------------------------------------------------------------------------
^F3::
Suspend, Permit
if getkeystate("F3", "P") = 1
{
SetTimer, CheckActiveWin, Off
WinGetActiveTitle, CurrentWindow
WinGet, ActiveADD, ProcessName, %CurrentWindow%
IniWrite, %ActiveADD%, AllowedGames.ini,Games,%CurrentWindow% ;Writes ProcessName to ini as "ActiveWindow=ProcessName"
MsgBox, Added %ActiveADD%
SetTimer, CheckActiveWin, On
}
return
CheckActiveWin:
suspend, permit
WinGetActiveTitle, WinTitle
WinGet,ProcesName, ProcessName, %WinTitle%
loop,1
{
;tooltip, | %Pors% | %PorsW% ,0,0
IniRead,Allowed,AllowedGames.ini,Games,%WinTitle%, ; checks if current window is in AllowdGames.ini, returns ERROR if (Key=WinTitle Value=ProcesName) is not found.
if Allowed = Error ;Suspend All Hotkeys
{
Count := 2
AllSuspend := 1
Suspend, On
}
else
{
Count := 1
AllSuspend := 2
Suspend, Off
}
}
return
WheelCount_Down:
if WheelCount = 1
WheelCount -= 1
WeaponLoad = %SecundairyWeapon%
gosub, LoadFromIni
Return
WheelCount_Up:
if WheelCount = 0
WheelCount += 1
WeaponLoad = %PrimairyWeapon%
Gosub, LoadFromIni
Return
PorST:
if PorS = 1
{
PorS -= 1
if PorS = 0
{
PorSW = Secundairy
}
}
else
{
PorS = 1
if PorS = 1
{
PorSW = Primairy
}
}
GuiControl ,, Button4, Save As %PorSW%
Return
Numpad3::
BothB:
if Both = 1
{
Both -=1
TipOn(" LMouseButton")
}
else
{
Both = 1
TipOff("L+R MouseButton")
}
return
Numpad2::
if FSM <= 3.0
{
FSM += 0.1
TipOn("Fisrt Shot Multi = "Round(FSM,1) " X =" Round(FSM*pixelY,1))
}
else ;FSM = 2.00
{
FSM := 1.0
TipOn("First Shot Multi = " FSM)
}
return
NumPad1::
if SFS = 1
{
SFS += 1
TipOn("Skip 1st Shot = ON")
}
else
{
SFS -= 1
TipOn("Skip 1st Shot = OFF")
}
Return
Numpad6::
If Tap = 0
{
Tap +=1
TipOn("Tap = ON")
}
else
{
Tap -= 1
TipOn("Tap = OFF")
}
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
DoSHDown:
If SH > 1
SH -= 1
SHK = 0
TipOn("SH = " SH)
return
DoSHUp:
If SH <20
SH += 1
SHK = 0
TipOn("SH = " SH)
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 > 400
rpm -= 10
TipRPS("RPM: " rpm " " "RPS:" f(rpm))
return
DoDelayDown:
if rpm < 4000
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
;----------------------------------------------SAVE, LOAD, DELETE, FUNC-------------------------------------------------------------------
;-----------------------------------------------------------------------------------------------------------------------------------------
;Pulls up Listview of Saved Weapon for easy picking.
Numpad0::
GetFromIni:
SetTimer, Update, 100
SetTimer, TipClear, Off
FileRead, iniWeapons, %title%.ini ; reads .ini for the game you are playing
FileRead, iniPriSec, %title%PriSec.ini
Sort, PriSec,D[]
Sort, iniWeapons,D[]
;NoRecoil = 0
PorS = 1
SetTimer,CheckActiveWin, Off
NoRecoil = 0
PorS = 1
if ReadWin = 0
{
ReadWin = 1
WinGetTitle, title, A
}
; Create the ListView with 4 columns:0
Gui,Destroy
Gui, Add, Checkbox, checked%Both% gBothB, Press L + R Mousekey to Activate
gui, add, text, W150 H20 R1, Save To INI
Gui, Add, Edit, W150 H20 R1 vWeaponSend
Gui, Add, Button, W150 H20 R1 gSaveToIni, Save To Ini
Gui, Add, Checkbox, W150 H20 Check%PorS% gPorST ,Checked is Secundary
Gui, Add, Button, W150 H20 vPorSW gLoadFromIni, Save As %PorSW%
Gui, Add, Button, W150 H20 gDelete, Delete
Gui,Add, Text, W300 H20 ,Settings from %title%.ini
gui, add, text,W300 H20 ,Double Click to LOAD from INI
Gui, Add, ListView,vLV1 r20 h150 w480 gMyWeaponView, Name|SH|X|Y|RPM|TAP|SFS|FSM
Gosub,FillWeaponList
Gui, Add, Text, W300 H20, Settings From %title%PriSec.ini
Gui, Add, Edit, W150 H20 r1 vSetSend
Gui, Add, Button, W150 H20 gSaveToClass, Save Class to Ini
;Gui, Add, Button, W150 H20 gDelete2, Delete
Gui, Add, ListView,vLV2 r20 h150 w480 gMyClassView, Class|Primary|Secundary
Gosub,FillClassList
Gui, Show, x100 y100 h650 w500
return
FillWeaponList:
Gui, ListView, LV1
Weapons := ini_getAllSectionNames(iniWeapons)
Loop, Parse, Weapons, `,
{
LV_Add("", A_LoopField, ini_getValue(iniWeapons, A_LoopField, "SH"),ini_getValue(iniWeapons, A_LoopField, "X"),ini_getValue(iniWeapons,A_LoopField, "Y"), ini_getValue(iniWeapons, A_LoopField, "rpm"), ini_GetValue(iniWeapons, A_LoopField, "TAP"),ini_GetValue(iniWeapons, A_LoopField, "SFS"),ini_GetValue(iniWeapons, A_LoopField, "FSM"))
}
LV_ModifyCol(20) ; Auto-size each column to fit its contents.
LV_ModifyCol() ; For sorting purposes.
return
FillClassList:
Gui, Listview, LV2
PriSec := ini_getAllSectionNames(iniPriSec)
loop, Parse, PriSec, `,
{
LV_Add("", A_LoopField, ini_getValue(iniPriSec, A_LoopField, "PrimairyWeapon"),ini_getValue(iniPriSec, A_LoopField, "SecundairyWeapon"))
}
LV_ModifyCol(20) ; Auto-size each column to fit its contents.
LV_ModifyCol() ; For sorting purposes.
; Display the window and return. The script will be notified whenever the user double clicks a row.
return
Update:
GuiControlGet,focused,FocusV
if A_GuiEvent =
loop
{
if focused = LV1
RowNumber = 0
Loop,1
; This causes the first loop iteration to start the search at the top of the list.
{
Gui,ListView, LV1
RowNumber := LV_GetNext(0,"focused") ; Resume the search at the row after that found by the previous iteration.
if not RowNumber ; The above returned zero, so there are no more selected rows.
break
LV_GetText(Delete, RowNumber)
GuiControl,, WeaponSend, %Delete%
}
if focused = LV2
RowNumber = 0
loop,1
; This causes the first loop iteration to start the search at the top of the list.
{
Gui, ListView, LV2
RowNumber := LV_GetNext(0,"focused") ; Resume the search at the row after that found by the previous iteration.
if not RowNumber ; The above returned zero, so there are no more selected rows.
break
LV_GetText(set, RowNumber)
GuiControl,, SetSend, %set%
}
Sleep,20
}
return
Delete:
GuiControlGet, focused2,FocusV
{
if focused = LV1
RowNumber = 0
Loop
{
Gui,ListView, LV1
RowNumber := LV_GetNext(0,"focused2")
if not RowNumber
break
LV_GetText(Delete, RowNumber)
IniDelete,%title%.ini,%Delete%
gosub,GetFromIni
}
if focused = LV2
RowNumber = 0
loop
{
Gui, ListView, LV2
RowNumber := LV_GetNext(0,"focused2")
if not RowNumber
break
LV_GetText(set, RowNumber)
IniDelete,%title%PriSec.ini,%set%
gosub,GetFromIni
}
}
return
MyClassView:
Gui,ListView, LV2
if A_GuiEvent = DoubleClick
{
LV_GetText(Class, A_EventInfo)
LV_GetText(PrimairyWeapon, A_EventInfo, 2) ; Get the text from the row's first field.
LV_GetText(SecundairyWeapon, A_EventInfo, 3)
TipRPS(" Loaded!! Sec = "SecundairyWeapon " Pri = " PrimairyWeapon)
}
Gosub, GuiClose
return
MyWeaponView:
Gui,ListView, LV1
if A_GuiEvent = DoubleClick
{
WeaponLoad = %Delete%
if PorS = 1
{
PrimairyWeapon = %WeaponLoad%
}
else
{
SecundairyWeapon = %WeaponLoad%
}
}
LV_GetText(Delete, A_EventInfo)
LV_GetText(SH, A_EventInfo, 2) ; Get the text from the row's first field.
LV_GetText(pixelx, A_EventInfo, 3)
LV_GetText(pixely, A_EventInfo, 4)
LV_GetText(rpm, A_EventInfo, 5)
LV_GetText(Tap, A_EventInfo, 6)
LV_GetText(SFS, A_eventInfo, 7)
LV_GetText(FSM, A_eventInfo, 8)
TipRPS(" Loaded!! Weapon : " WeaponCall " " "Y : "pixely " " "X : "pixelx " " "RPM : " rpm " "" SH" " " SH " "" TAP" TAP)
Gosub, GuiClose
return
LoadFromIni:
If ReadWin = 1
{
GoSub, Update
WeaponLoad = %Delete%
if PorS = 1
{
PrimairyWeapon = %WeaponLoad%
}
else
{
SecundairyWeapon = %WeaponLoad%
}
}
IniRead, SH, %a_workingDir%\%title%.ini, %WeaponLoad%, SH
IniRead, pixely, %a_workingDir%\%title%.ini, %WeaponLoad%, Y
IniRead, pixelx, %a_workingDir%\%title%.ini, %WeaponLoad%, X
IniRead, rpm, %a_workingDir%\%title%.ini, %WeaponLoad%, rpm
IniRead, TAP, %a_workingDir%\%title%.ini, %WeaponLoad%, TAP
IniRead, SFS, %a_workingDir%\%title%.ini, %WeaponLoad%, SFS
IniRead, FSM, %a_workingDir%\%title%.ini, %WeaponLoad%, FSM
return
SaveToClass:
{
Gui,Submit, Nohide
;IniDelete, %A_WorkingDir%\%title%PriSec.ini, %SetSend%
IniWrite,%PrimairyWeapon%,%A_WorkingDir%\%title%PriSec.ini,%SetSend%,PrimairyWeapon
IniWrite,%SecundairyWeapon%,%A_WorkingDir%\%title%PriSec.ini,%SetSend%,SecundairyWeapon
TipRPS(" Saved!! ")
}
gosub,GuiCLose
return
SaveToINI:
{
Gui,Submit, Nohide
IniDelete, %A_WorkingDir%\%title%.ini, %WeaponSend%
IniWrite,%SH%,%A_WorkingDir%\%title%.ini,%WeaponSend%,SH
IniWrite,%pixely%,%A_WorkingDir%\%title%.ini,%WeaponSend%,Y
IniWrite,%pixelx%,%A_WorkingDir%\%title%.ini,%WeaponSend%,X
IniWrite,%rpm%,%A_WorkingDir%\%title%.ini,%WeaponSend%,rpm
IniWrite,%TAP%,%A_WorkingDir%\%title%.ini,%WeaponSend%, Tap
IniWrite,%SFS%,%A_WorkingDir%\%title%.ini,%WeaponSend%, SFS
IniWrite,%FSM%,%A_WorkingDir%\%title%.ini,%WeaponSend%, FSM
TipRPS(" Saved!! Weapon :" WeaponSend " " "Y :" pixely " " "X : " pixelx " " "RPM :" rpm " ""SH" " " SH " " "TAP" TAP)
Gosub, GuiClose
}
return
ExitApp:
GuiClose:
SetTimer,CheckActiveWin, On
SetTimer,Update, Off
Settimer, TipClear, 2000
Gui, Destroy
ReadWin = 0
NoRecoil = 1
return
;------------------------------------------------------------------------------------------------------------
;------------------------------------------------------------------------------------------------------------
BothButtons:
if NoRecoil = 1
{
if Both = 1
{
GetKeyState, state, RButton, P ; RButton must me held down to use the LButton(Mouse)
if state = U
return
}
loop
{
GetKeyState, state2, LButton, P
if state2 = U
break
if Tap = 1
{
MouseClick, Left,,,,,D
MouseClick, Left,,,,,U
}
if getkeystate("LButton", "P") = 1
{
If A_Index >= %SFS%
{
if FSM >= 1.00
{
if A_Index <= 1
{
Floor(FSMY := pixely * FSM)
DllCall("mouse_event", "uint",1 , "Uint", 0,"Uint", FSMY)
}
else
{
DllCall("mouse_event", "uint",1 , "Uint", 0,"Uint", pixely)
SHK += 1
}
If SH = %SHK% ; If equals then x
{
SHK := 0 ; Resets Counter
DllCall("mouse_event", "uint",1 , "Uint", pixelx,"Uint", 0)
}
if Tap = 1
{
SetMouseDelay, f(rpm)
}
else
{
sleep, f(rpm)
}
if getKeystate("LButton", "P") = 0
{
DllCall("mouse_event", "uint",1 , "Uint", 0,"Uint", -pixely)
break
}
}
}
}
}
}
return
;-------------------------------interval per shot in Miliseconds----------------------------------------
f(n)
{
Return Round(60000/n)
}
return