mirror of
https://github.com/Sneed-Group/RobloxPotatoes
synced 2025-01-09 17:33:37 +00:00
Fortnite
This commit is contained in:
parent
d0c32c4d9a
commit
447a830e84
1 changed files with 11 additions and 4 deletions
15
aimbot.py
15
aimbot.py
|
@ -13,13 +13,14 @@ size_scale = 3
|
||||||
while True:
|
while True:
|
||||||
# Get rect of Window
|
# Get rect of Window
|
||||||
hwnd = win32gui.FindWindow(None, 'Counter-Strike: Global Offensive')
|
hwnd = win32gui.FindWindow(None, 'Counter-Strike: Global Offensive')
|
||||||
|
#hwnd = win32gui.FindWindow("UnrealWindow", None) # Fortnite
|
||||||
rect = win32gui.GetWindowRect(hwnd)
|
rect = win32gui.GetWindowRect(hwnd)
|
||||||
region = rect[0], rect[1], rect[2] - rect[0], rect[3] - rect[1]
|
region = rect[0], rect[1], rect[2] - rect[0], rect[3] - rect[1]
|
||||||
|
|
||||||
# Get image of screen
|
# Get image of screen
|
||||||
image = np.array(pyautogui.screenshot(region=region))
|
ori_img = np.array(pyautogui.screenshot(region=region))
|
||||||
image = cv2.resize(image, (image.shape[1] // size_scale, image.shape[0] // size_scale))
|
ori_img = cv2.resize(ori_img, (ori_img.shape[1] // size_scale, ori_img.shape[0] // size_scale))
|
||||||
image = np.expand_dims(image, 0)
|
image = np.expand_dims(ori_img, 0)
|
||||||
img_w, img_h = image.shape[2], image.shape[1]
|
img_w, img_h = image.shape[2], image.shape[1]
|
||||||
|
|
||||||
# Detection
|
# Detection
|
||||||
|
@ -35,10 +36,12 @@ while True:
|
||||||
# Choose only person(class:1)
|
# Choose only person(class:1)
|
||||||
if classes[i] == 1 and scores[i] >= 0.5:
|
if classes[i] == 1 and scores[i] >= 0.5:
|
||||||
ymin, xmin, ymax, xmax = tuple(box)
|
ymin, xmin, ymax, xmax = tuple(box)
|
||||||
if ymin > 0.5 and ymax > 0.8:
|
if ymin > 0.5 and ymax > 0.8: # CS:Go
|
||||||
|
#if int(xmin * img_w * 3) < 450: # Fortnite
|
||||||
continue
|
continue
|
||||||
left, right, top, bottom = int(xmin * img_w), int(xmax * img_w), int(ymin * img_h), int(ymax * img_h)
|
left, right, top, bottom = int(xmin * img_w), int(xmax * img_w), int(ymin * img_h), int(ymax * img_h)
|
||||||
detected_boxes.append((left, right, top, bottom))
|
detected_boxes.append((left, right, top, bottom))
|
||||||
|
#cv2.rectangle(ori_img, (left, top), (right, bottom), (255, 255, 0), 2)
|
||||||
|
|
||||||
print("Detected:", len(detected_boxes))
|
print("Detected:", len(detected_boxes))
|
||||||
|
|
||||||
|
@ -71,4 +74,8 @@ while True:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)
|
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)
|
||||||
|
|
||||||
|
#ori_img = cv2.cvtColor(ori_img, cv2.COLOR_BGR2RGB)
|
||||||
|
#cv2.imshow("ori_img", ori_img)
|
||||||
|
#cv2.waitKey(1)
|
||||||
|
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
Loading…
Reference in a new issue