def extendPortable(portableKeyCoordinates, extendInterfaceLocation, tries = 0): (x, y, xT, yT) = portableKeyCoordinates (x, y, xT, yT) = (5 + x//2, 5 + y//2, -5 + xT//2, -5 + yT//2) if tries == 10: print("Failed to extend portable") return False def moveToPortableKey(): mouse.moveRect(x, y, xT, yT) sleepDuration = -1 while sleepDuration < 0: sleepDuration = np.random.normal(0.2, 0.01) sleep(sleepDuration) pyautogui.click(button='right') portableClickLocation = utils.Location() succ = utils.performAction(moveToPortableKey, utils.makeSuccess(portableClickLocation, portableClickInterfacePath, False)) if not succ: print("Failed to right click portable key, retrying") extendPortable(portableKeyCoordinates, extendInterfaceLocation, tries = tries + 1) sleep(3) (x, y, xT, yT) = utils.convert(portableClickLocation.getLoc()) (x, y, xT, yT) = (x//2, y//2, xT//2, yT//2) mouse.moveRect(x, y, xT, yT, teleportRandom=False) pyautogui.click() sleep(3) if not utils.checkLocation(extendInterfaceLocation, extendInterfacePath): print("Failed to open extend interface, retrying") extendPortable(portableKeyCoordinates, extendInterfaceLocation, tries = tries + 1) sleepDuration = -1 while sleepDuration < 0: sleepDuration = np.random.normal(0.2, 0.2) utils.spamPress('1') sleep(sleepDuration) utils.spamPress('enter') sleep(3) if utils.checkLocation(extendInterfaceLocation, extendInterfacePath): print("Failed to extend portable, retrying") extendPortable(portableKeyCoordinates, extendInterfaceLocation, tries = tries + 1) return True
def disassemble(itemLoc, logoLoc): if itemLoc.isEmpty(): newLoc = pyautogui.locateOnScreen(itemPath) if newLoc == None: return False print(newLoc) itemLoc.setLoc(newLoc) utils.spamPress(DA_KEY) sleep(1) x, y, size = getBox(itemLoc.getLoc()) mouse.move(x, y, size) pyautogui.click() if logoLoc.isEmpty(): newLoc = pyautogui.locateOnScreen(logoPath) if newLoc == None: return False print(newLoc) logoLoc.setLoc(newLoc) return not utils.checkLocation(logoLoc, logoPath) == None
def extend(silverhawkCoordinates, overloadCoordinates, aggressionCoordinates): x, y, xT, yT = silverhawkCoordinates mouse.moveRect(x, y, xT, yT) pyautogui.click() sleep(getSleep(1, 0.3)) x, y, xT, yT = overloadCoordinates mouse.moveRect(x, y, xT, yT) pyautogui.click() sleep(getSleep(1, 0.3)) x, y, xT, yT = aggressionCoordinates mouse.moveRect(x, y, xT, yT) pyautogui.click() sleep(getSleep(1, 0.3)) for _ in range(10): ovlLoc = utils.Location() if utils.checkLocation(ovlLoc, overloadPath): return True return False
def success(): present = utils.checkLocation(loc, target) return not present if negative else present
def success(): present = utils.checkLocation(loc, target) print(f"{present} at {loc.getLoc()}") return not present if negative else present