Here are the core requirements that you will need to install
Code:
keyboard==0.13.3
mouse==0.7.0
numpy==1.16.2
opencv-python==4.0.0.21
Pillow==5.4.1
pynput==1.4.2
pypiwin32==223
pywin32==224
six==1.12.0
Here are the some no recoil for a few guns (Testing, you can change values on your own to recalibrate)
I can't update the thread since I can't edit it :/ (no edit button)
You will need to manually change the code in gun_settings.py yourself
Directory is "ReduxAL/guns/gun_settings/gun_settings.py"
Flatline:
Code:
def pull_down_flatline(self, parent):
count = 0
sleep_time = 0.0005
# while the left mouse button is held
while parent.enabled:
print(self.enabled, 'flatline', end='\r', flush=True)
# do some weird delaying
count += 2
if count % 10 == 0:
sleep_time += 0.01
if 1 < count < 50:
threading.Thread(target=move_mouse, args=(1, 2,)).start()
if 50 < count < 70:
threading.Thread(target=move_mouse, args=(-1, 1,)).start()
if 70 < count < 90:
threading.Thread(target=move_mouse, args=(2, 3,)).start()
Alternator:
Code:
def pull_down_alternator(self, parent):
count = 0
sleep_time = 0.0005
# while the left mouse button is held
while parent.enabled:
print(self.enabled, 'Alternator', end='\r', flush=True)
# do some weird delaying
count += 1
if count % 10 == 0:
sleep_time += 0.0012
# spawn a threads call the function move mouse to move one pixel down
threading.Thread(target=move_mouse, args=(0, 1,)).start()
# sleep to delay
time.sleep(sleep_time)
R99:
Code:
def pull_down_r99(self, parent):
count = 0
sleep_time = 0.00001
# while the left mouse button is held
while parent.enabled:
print(self.enabled, 'r99', end='\r', flush=True)
# do some weird delaying
count += 1
if count % 10 == 0:
sleep_time += 0.0025
if 1 < count < 30:
# spawn a thread call the function move mouse going left by one pixel
threading.Thread(target=move_mouse, args=(0, 1,)).start()
if 30 < count < 50:
# spawn a thread call the function move mouse going left by one pixel
threading.Thread(target=move_mouse, args=(0, 1,)).start()
if 50 < count < 80:
# spawn a thread call the function move mouse going left by one pixel
threading.Thread(target=move_mouse, args=(0, 2,)).start()
# sleep to delay
time.sleep(sleep_time)
Also manually replace the codes in detect_gun.py with the code below
Directory is ReduxAL/guns/gun_detection/detect_gun.py
Code:
import numpy as np
from .win32_screen import grab_screen as grabby
class detect_gun:
def __init__(self, training_data=None):
self.training_data = training_data
def mse(self, image_a, image_b):
# the 'Mean Squared Error' between the two images is the
# sum of the squared difference between the two images;
# NOTE: the two images must have the same dimension
err = np.sum((image_a.astype("float") - image_b.astype("float")) ** 2)
err /= float(image_a.shape[0] * image_a.shape[1])
# return the MSE, the lower the error, the more "similar"
# the two images are
return err
def detect(self):
# grab our small screenshot for both primary and secondary weapons
primary = grabby(region=(1550, 1030, 1669, 1054))
secondary = grabby(region=(1700, 1030, 1819, 1054))
# set max MSE to be 500
min_ = 500
best_data = []
# iterate through calculate MSE on all images in DB, finding the best match O(N) time complexity
for im, data in self.training_data:
error = min(self.mse(primary, np.asarray(im)), self.mse(secondary, np.asarray(im)))
if error < min_:
min_ = error
best_data = data
print(min_, best_data)
return best_data[0] if len(best_data) > 0 else None
Bugs:
-Hooking libraries like to hang sometimes, so spawning threads mitigates this problem most of the time.
-Program hangs right after starting. Resolution: do not click within the command prompt or powershell window. Exit by pressing "L"