Ejemplo n.º 1
0
def findBank():
	global chestLocs
	print("Searching for bank")
	rawPoints = detectImage.getNLocations("Fletching/Bank Images/vals.txt", size, code, N = 5)
	cleanPoints = []

	for x, y in rawPoints:
		cleanPoints.append((x//4, y//4))

	chestLocs = cleanPoints
	print("Found bank")
	return
Ejemplo n.º 2
0
def clickOnAnimica():
    if locs == []:
        rawLocs = detectImage.getNLocations(animicaPath, 50, 5)
        for loc in rawLocs:
            x, y = loc
            locs.append((x // 4, y // 4))

    ind = np.random.geometric(0.1)
    while ind >= len(locs):
        ind = np.random.geometric(0.1)

    x, y = locs[ind]
    print(f"Clicking at {x},{y}")
    mouse.move(x, y, 50, teleportRandom=True)
    pyautogui.click()
Ejemplo n.º 3
0
def getDistribution(vals,
                    size=detectImage.BOX_SIZE_SMALL,
                    code=detectImage.IMAGE_FULL,
                    N=5):
    print("Searching...")
    rawPoints = detectImage.getNLocations(vals, size=size, code=code, N=N)
    cleanPoints = []

    for x, y in rawPoints:
        cleanPoints.append((x // 4, y // 4))

    def drawFromLocs():
        index = np.random.exponential(N / 10)
        while index >= N:
            index = np.random.expoential(N / 10)
        return cleanPoints[int(index)]

    return drawFromLocs