Pass colored pixels
This commit is contained in:
parent
df06ca94a3
commit
4f5e14e131
15
bot.py
15
bot.py
@ -5,9 +5,19 @@ from tqdm import tqdm
|
|||||||
global xc, yc
|
global xc, yc
|
||||||
xc = 0 ; yc = 0
|
xc = 0 ; yc = 0
|
||||||
|
|
||||||
|
def gcolor(x, y):
|
||||||
|
response = requests.get(f'http://pb.dmcraft.online/?get_color={x},{y}')
|
||||||
|
return response.text
|
||||||
|
|
||||||
def draw(cords, color = "black"):
|
def draw(cords, color = "black"):
|
||||||
global xc, yc
|
global xc, yc
|
||||||
for i in tqdm(range(len(cords))):
|
for i in tqdm(range(len(cords))):
|
||||||
|
try:
|
||||||
|
color = cords[i][2]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if str(gcolor(cords[i][1], cords[i][0])) != color:
|
||||||
payload = {'x': cords[i][1] + yc, 'y': cords[i][0] + xc, 'color': color }
|
payload = {'x': cords[i][1] + yc, 'y': cords[i][0] + xc, 'color': color }
|
||||||
|
|
||||||
response = requests.post('http://pb.dmcraft.online', data=payload)
|
response = requests.post('http://pb.dmcraft.online', data=payload)
|
||||||
@ -40,10 +50,9 @@ def fill(xy1, xy2):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#xc = 500
|
print(gcolor(0, 1))
|
||||||
#yc = 500
|
draw([[0,1, "red"]])
|
||||||
|
|
||||||
draw(fill([26,0], [50, 85]),"white")
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
#Russian flag
|
#Russian flag
|
||||||
|
Loading…
Reference in New Issue
Block a user