Python bot Piano Tiles 2 - Pyautogui

preview_player
Показать описание
En este vídeo veremos un bot hecho con python para jugar Piano Tiles de forma automatica.

Estaremos usando la biblioteca pyautogui y keyboard para la implementación del bot.

******************** CÓDIGO Y PÁGINA ********************
Рекомендации по теме
Комментарии
Автор

Podrías por fa detectar cuando un captcha se despliega en una web y cuando solo aparece la palomita en la web. Usando python gracias

CopyTopCerebritops
Автор

soy bastante nuevo en esto y no termino de entender cómo es que el programa identifica el color, si no hay ninguna linea de código que represente el color de las teclas del piano. por lo que entiendo colocaste las coordenadas de las columnas por las cuales decenderán las telas y me perdí es como se supone que identificará que es el color o no.

podrías subir otro ejemplo aplicando estás mismas librerias?.

AndresGarcia-dswn
Автор

is there any way to make it go past 4-500? I've tried making it click lower when it gets past 400, but then it glitches out when it gets to 60 and clicks near the top of the search bar. I also noticed that the normal and my code only works about half the time the other half when I open the piano tiles window I get this error

Traceback (most recent call last):
File non-game + saves/Piano-Tiles-master/to400andbeyond.py", line 13, in <module>
if pyautogui.pixel(x1, y)[0] < 20:
File "C:\Users\Gavin\AppData\Local\Programs\Python\Python38\lib\site-packages\pyscreeze\__init__.py", line 584, in pixel
return (r, g, b)
File "C:\Users\Gavin\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Users\Gavin\AppData\Local\Programs\Python\Python38\lib\site-packages\pyscreeze\__init__.py", line 113, in __win32_openDC
raise failed : return 0")
OSError: windll.user32.ReleaseDC failed : return 0

here is the code I made the breaks at 60

import pyautogui
import keyboard

z = 700
y = 700
x1 = 740
x2 = 888
x3 = 1020
x4 = 1166
score = 0

while not keyboard.is_pressed('q'):
if pyautogui.pixel(x1, y)[0] < 20:
pyautogui.click(x1, z)

if pyautogui.pixel(x2, y)[0] < 20:
pyautogui.click(x2, z)

if pyautogui.pixel(x3, y)[0] < 20:
pyautogui.click(x3, z)

if pyautogui.pixel(x4, y)[0] < 20:
pyautogui.click(x4, z)
score += 1
if score == 300:
z = 65

ceticx
Автор

Hola que tal, buen video, hay alguna manera de que el bot corra en segundo plano?

ancezdeox
Автор

Woau, esto el pyautogui esta muy bueno pero al yo intentarlo usarlo me da errores como al momento de ejecutar el ya sea desde el editor de codigo (usando el cmd) o desde el cmd usando python me tira el mismo mensage:
Traceback (most recent call last):
File "C:\Users\johan\Desktop\python\pyautogui.py", line 1, in <module>
import pyautogui as pg
File "C:\Users\johan\Desktop\python\pyautogui.py", line 3, in <module>
pg.dispayMousePosition
AttributeError: partially initialized module 'pyautogui' has no attribute 'dispayMousePosition' (most likely due to a circular import)"
Y no tengo ni la mas minima idea de que significa no se si me puedas ayudar

johansi
Автор

Como haces lo de saber la posicion con esa linea de codigo? a mi me sale error

_imjose