|
23 | 23 | #shoots if enemies are detected inside the crosshair
|
24 | 24 | trigger_key = 0x39
|
25 | 25 |
|
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 |
29 | 26 |
|
30 | 27 | # hitbox size for the triggerbots
|
31 | 28 | hitbox_size = 0.6
|
32 | 29 |
|
33 | 30 | # sleep for the triggerbots
|
34 |
| -sleep = 1 |
| 31 | +sleep = 0 |
35 | 32 |
|
36 | 33 | # aim assist on the triggerbot
|
37 | 34 | trigger_magnet = True
|
|
46 | 43 | shift_key = 0
|
47 | 44 | shift_magnet = False
|
48 | 45 |
|
49 |
| -Q_key = 0 |
50 |
| -Q_magnet = False |
51 | 46 |
|
52 | 47 | E_key = 0
|
53 | 48 | E_magnet = False
|
|
93 | 88 |
|
94 | 89 | Dababy = True
|
95 | 90 | PID = os.getpid()
|
96 |
| -#fps = 0 |
97 |
| -#start = time.time() |
| 91 | + |
98 | 92 |
|
99 | 93 | # main loop, processes new frames, if enemies are detected listens to hotkeys
|
100 | 94 | # to perform related features
|
101 | 95 | while True:
|
102 | 96 |
|
103 | 97 | 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) |
108 | 100 |
|
109 | 101 | if contours:
|
110 | 102 | rec, x, y = grabber.compute_centroid(contours)
|
|
119 | 111 | grabber.trigger()
|
120 | 112 |
|
121 | 113 |
|
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() |
127 | 119 |
|
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() |
134 | 120 |
|
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() |
141 | 127 |
|
142 | 128 |
|
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() |
161 | 134 |
|
162 | 135 |
|
163 | 136 |
|
|
0 commit comments