Skip to content

Commit 934b987

Browse files
committed
cleaned old version
1 parent 13965b6 commit 934b987

File tree

2 files changed

+20
-54
lines changed

2 files changed

+20
-54
lines changed

grabber.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,6 @@ def shift(self):
142142
def _shift(self):
143143
ud_mouse.simulate_shift()
144144
time.sleep(self.sleep)
145-
146-
def Q(self):
147-
threading.Thread(target= self._Q).start()
148-
149-
def _Q(self):
150-
ud_mouse.simulate_Q()
151-
time.sleep(self.sleep)
152145

153146
def E(self):
154147
threading.Thread(target= self._E).start()

main.py

Lines changed: 20 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@
2323
#shoots if enemies are detected inside the crosshair
2424
trigger_key = 0x39
2525

26-
# abilities trigger disabled until I fix fps issue, if you wanna use em uncomment
27-
# the lines inside the main loop corresponding to the ability you want trigger for
28-
# (dont uncomment em all it makes ur frames go bye
2926

3027
# hitbox size for the triggerbots
3128
hitbox_size = 0.6
3229

3330
# sleep for the triggerbots
34-
sleep = 1
31+
sleep = 0
3532

3633
# aim assist on the triggerbot
3734
trigger_magnet = True
@@ -46,8 +43,6 @@
4643
shift_key = 0
4744
shift_magnet = False
4845

49-
Q_key = 0
50-
Q_magnet = False
5146

5247
E_key = 0
5348
E_magnet = False
@@ -93,18 +88,15 @@
9388

9489
Dababy = True
9590
PID = os.getpid()
96-
#fps = 0
97-
#start = time.time()
91+
9892

9993
# main loop, processes new frames, if enemies are detected listens to hotkeys
10094
# to perform related features
10195
while True:
10296

10397
og = np.array(camera.get_latest_frame())
104-
if og is not None:
105-
#fps += 1
106-
frame = grabber.process_frame(og)
107-
contours = grabber.detect_contours(frame, 900)
98+
frame = grabber.process_frame(og)
99+
contours = grabber.detect_contours(frame, 900)
108100

109101
if contours:
110102
rec, x, y = grabber.compute_centroid(contours)
@@ -119,45 +111,26 @@
119111
grabber.trigger()
120112

121113

122-
#if grabber.is_activated(shift_key):
123-
# if shift_magnet:
124-
# grabber.move_mouse(x*magnet_accel, y*(magnet_accel/2))
125-
# if grabber.on_target(contours, hitbox_size):
126-
# grabber.shift()
114+
if grabber.is_activated(shift_key):
115+
if shift_magnet:
116+
grabber.move_mouse(x*magnet_accel, y*(magnet_accel/2))
117+
if grabber.on_target(contours, hitbox_size):
118+
grabber.shift()
127119

128-
129-
#if grabber.is_activated(Q_key):
130-
# if Q_magnet:
131-
# grabber.move_mouse(x*magnet_accel, y*(magnet_accel/2))
132-
# if grabber.on_target(contours, hitbox_size):
133-
# grabber.Q()
134120

135-
136-
#if grabber.is_activated(E_key):
137-
# if shift_magnet:
138-
# grabber.move_mouse(x*magnet_accel, y*(magnet_accel/2))
139-
# if grabber.on_target(contours, hitbox_size):
140-
# grabber.E()
121+
if grabber.is_activated(E_key):
122+
if shift_magnet:
123+
grabber.move_mouse(x*magnet_accel, y*(magnet_accel/2))
124+
125+
if grabber.on_target(contours, hitbox_size):
126+
grabber.E()
141127

142128

143-
#if grabber.is_activated(right_click_key):
144-
# if right_click_magnet:
145-
# grabber.move_mouse(x*magnet_accel, y*(magnet_accel/2))
146-
# if grabber.on_target(contours, hitbox_size):
147-
# grabber.mouse_right()
148-
149-
150-
cv2.drawContours(og, contours, -1, (0, 0, 0), 4)
151-
if rec:
152-
cv2.drawContours(og, rec, -1, (0, 255, 0), 4)
153-
154-
155-
# comment the 4 lines below to not show frame capture
156-
cv2.imshow('frame', og)
157-
if (cv2.waitKey(1) & 0x2D) == ord('q'):
158-
cv2.destroyAllWindows()
159-
exit()
160-
129+
if grabber.is_activated(right_click_key):
130+
if right_click_magnet:
131+
grabber.move_mouse(x*magnet_accel, y*(magnet_accel/2))
132+
if grabber.on_target(contours, hitbox_size):
133+
grabber.mouse_right()
161134

162135

163136

0 commit comments

Comments
 (0)