def reelRodState(): #993,53/55/57 pix1 = pyscreeze.pixel(993,53) pix2 = pyscreeze.pixel(993,57) if ((isGold(pix1) <= 10) and (isGold(pix2) <= 10)): return True
def castRodState(): #766,53/55/57 pix1 = pyscreeze.pixel(766,53) pix2 = pyscreeze.pixel(766,57) if ((isGold(pix1) <= 10) and (isGold(pix2) <= 10)): return True
def reelRodState(): #993,53/55/57 pix1 = pyscreeze.pixel(993, 53) pix2 = pyscreeze.pixel(993, 57) #print(pix1) #print(pix2) #apparently is (255,255,-1) after 35 mins if ((isGold(pix1) <= 10) and (isGold(pix2) <= 10)): return True
def reelIn(): #const 1000, 405, 1090, 424 pressSpace() #find the bar while True: if (findbar() == True): break #press space at the right time while True: pix = pyscreeze.pixel(983, 407) #default is 1030 if (isred(pix) <= 30): pressSpace() break #pause before captcha shows up time.sleep(3.2) captchaProcess() time.sleep(2) checkLoot() time.sleep(1) #leave here for testing purposes
m = PyMouse() k = PyKeyboard() # x_dim, y_dim = m.screen_size() # Set x and y screen sizes # m.move(x_dim/2, y_dim/2) # Move mouse to location # Give the user 3 seconds to get the window positioned for the attack button # time.sleep(3) #mouseX, mouseY = m.position() attackX = int(m.position()[0]) attackY = int(m.position()[1]) # Take a screenshot to define RGB of attack location im = pyscreeze.screenshot() attackR = pyscreeze.pixel(attackX * 2, attackY * 2)[0] attackG = pyscreeze.pixel(attackX * 2, attackY * 2)[1] attackB = pyscreeze.pixel(attackX * 2, attackY * 2)[2] #m.click(int(mouseX), int(mouseY), 1) #pyscreeze.pixel(m.position()[0], m.position()[1]) print("Starting") reps = 0 while reps in range(0, 3): # Take a fresh screenshot for analysis im = pyscreeze.screenshot() # If there's white text at the attack site, click 'attack' and continue
def record_frames(): x, y = win32api.GetCursorPos() print(x) print(y) print(pyscreeze.pixel(x, y))
def pixelMatch(x, y, r, g, b): pyscreeze.pixel(x, y) == (r, g, b)
def color_from_mouse(): mouse_x, mouse_y = pyautogui.position() color = pyscreeze.pixel(mouse_x, mouse_y) return color
def findbar(): pix1 = pyscreeze.pixel(849, 368) pix2 = pyscreeze.pixel(849, 372) if ((isWhite(pix1) <= 10) and (isWhite(pix2) <= 10)): return True