Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import ImageGrab
- import time
- import numpy as np
- import cv2
- import pyautogui
- from pynput import keyboard
- from pynput.keyboard import Key, Controller
- import ctypes
- import sys
- global blackList, ammo, shouldExit
- #ZOOM 175%%%%
- #Old screen cords 653, 585, 1142, 803 AND 259, 700, 1114, 1008 HACKER -> 396, 748, 1306, 1028
- screenCords = [469, 715, 1251, 993]
- time.sleep(3)
- ammo = 0
- shouldExit = False
- Keyboard = Controller()
- pyautogui.PAUSE = 0
- def on_release(key):
- if key == keyboard.Key.esc:
- global shouldExit
- shouldExit = True
- listener = keyboard.Listener(on_release=on_release)
- listener.start()
- def click(x, y):
- # convert to ctypes pixels
- # x = int(x * 0.666)
- # y = int(y * 0.666)
- ctypes.windll.user32.SetCursorPos(x, y)
- ctypes.windll.user32.mouse_event(2, 0, 0, 0, 0) # left down
- ctypes.windll.user32.mouse_event(4, 0, 0, 0, 0) # left up
- def grayPixelDetect(screenCord):
- img = cv2.imread('screenShotsGame/1.png')
- indicesa = np.where(np.all((img == (62,62,62)) | (img == (61,61,61)), axis=-1))
- print(indicesa)
- try:
- xCord = indicesa[1][0]
- yCord = indicesa[0][0]
- TrueXCorda = xCord + screenCords[0]
- TrueYCorda = yCord + screenCords[1]
- return TrueXCorda, TrueYCorda
- except:
- pass
- def screenGrab(screenCord):
- global TrueXCord
- global TrueYCord
- im = ImageGrab.grab(bbox=screenCords)
- im.save("ScreenShotsGame/1.png")
- #time.sleep(15)
- img = cv2.imread('screenShotsGame/1.png')
- #print(img.shape)
- indices = np.where(np.all(img == (255,255,255), axis=-1))
- #print(indices)
- #indices2 = np.where(np.all(img == (62,62,62), axis=-1))
- try:
- #print(indices)
- xCord = indices[1][0]
- yCord = indices[0][0]
- TrueXCord = xCord + screenCords[0] + 5
- TrueYCord = yCord + screenCords[1]
- #print(indices)
- #print("X : {}".format(xCord))
- #print("Y : {}".format(yCord))
- #print("True X : {}".format(TrueXCord))
- #print("True Y : {}".format(TrueYCord))
- return TrueXCord, TrueYCord
- except:
- pass
- def shootNigger(screenCords):
- global ammo
- try:
- #if ammo == 3:
- ammo = 0
- #print("DDD")
- #Keyboard.press(Key.space)
- #time.sleep(0.3)
- #Keyboard.release(Key.space)
- #else:
- xCord, yCord = screenGrab(screenCords)
- try:
- xCord1, yCord1 = grayPixelDetect(screenCords)
- click(int(xCord1),int(yCord1))
- except:
- pass
- #print(blackList)
- #print(xCord, yCord)
- click(int(xCord),int(yCord))
- #ammo += 1
- #print(ammo)
- except:
- pass
- while True:
- try:
- shootNigger(screenCords)
- #print(shouldExit)
- if shouldExit:
- print("Pressed Escape!")
- break
- except:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement