import cv2
import time
import numpy
import ctypes
import win32api
import threading
import dxcam
from multiprocessing import Pipe, Process
from ctypes import windll
from concurrent.futures import ThreadPoolExecutor
def bypass(pipe):
keybd_event = windll.user32.keybd_event
while True:
try:
key = pipe.recv()
if key == b'\x01':
keybd_event(0x4F, 0, 0, 0) # Press "O" key
keybd_event(0x4F, 0, 2, 0) # Release "O" key
except EOFError:
break
def send_key_multiprocessing(pipe):
pipe.send(b'\x01')
class Triggerbot:
def __init__(self, pipe):
user32 = windll.user32
self.WIDTH, self.HEIGHT = user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)
self.size = 5 # Size of the FOV (Field of View) for detecting color
# Setting up FOV dimensions
self.Fov = (
int(self.WIDTH / 2 - self.size),
int(self.HEIGHT / 2 - self.size),
int(self.WIDTH / 2 + self.size),
int(self.HEIGHT / 2 + self.size),
)
# Initialize camera using DXcam
self.camera = dxcam.create(output_idx=0, region=self.Fov)
# Initialize frame to None
self.frame = None
# HSV range for red color detection
self.cmin = (0, 150, 150) # Minimum HSV values for red
self.cmax = (10, 255, 255) # Maximum HSV values for red
# Store the pipe for sending key press signals
self.pipe = pipe
def Capture(self):
while True:
self.frame = self.camera.grab()
time.sleep(0.008) # Sleep to maintain 120 FPS
def Color(self):
if self.frame is not None:
# Convert frame from RGB to HSV color space
hsv = cv2.cvtColor(self.frame, cv2.COLOR_RGB2HSV)
# Create a mask based on HSV range
mask = cv2.inRange(hsv, self.cmin, self.cmax)
# Check if any pixel within the mask is in the specified range
return numpy.any(mask)
return False
def Main(self):
while True:
# Check if the right mouse button is held down and color is detected
if win32api.GetAsyncKeyState(0x06) < 0 and self.Color():
# Signal the bypass process to simulate the key press
send_key_multiprocessing(self.pipe)
time.sleep(0.005) # Slight delay for the main loop
def dummy_code(self):
# This function does nothing useful and is included to mislead anti-cheat systems
for i in range(1000):
_ = i ** 2 + i ** 3 - i ** 4
def more_dummy_code(self):
# Another dummy method that performs some computations with no actual effect
result = 0
for j in range(100):
for k in range(100):
result += j * k
return result
if __name__ == "__main__":
# Create a Pipe for inter-process communication
parent_conn, child_conn = Pipe()
# Start the bypass process
p = Process(target=bypass, args=(child_conn,))
p.start()
# Initialize the Triggerbot with the parent connection
triggerbot = Triggerbot(parent_conn)
# Start threads for capturing frames and running the main logic
with ThreadPoolExecutor(max_workers=3) as executor:
executor.submit(triggerbot.Capture)
executor.submit(triggerbot.Main)
executor.submit(triggerbot.dummy_code) # Running dummy code to add noise
# Wait for the bypass process to finish
p.join()