Compare commits

..

No commits in common. "1b415d50c5f2a5cb7ad954d80cd818a9dc3ae6a3" and "380930e8e7c8f48dd4bbef48ae5567f89bcc859a" have entirely different histories.

25
bot.py
View File

@ -5,27 +5,17 @@ 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: payload = {'x': cords[i][1] + yc, 'y': cords[i][0] + xc, 'color': color }
color = cords[i][2]
except:
pass
if str(gcolor(cords[i][1], cords[i][0])) != color: response = requests.post('http://pb.dmcraft.online', data=payload)
payload = {'x': cords[i][1] + yc, 'y': cords[i][0] + xc, 'color': color }
while str(response) != "<Response [200]>":
response = requests.post('http://pb.dmcraft.online', data=payload) response = requests.post('http://pb.dmcraft.online', data=payload)
print("Error, retrying...")
while str(response) != "<Response [200]>": sleep(0.1)
response = requests.post('http://pb.dmcraft.online', data=payload)
print("Error, retrying...")
sleep(0.1)
print("DONE!") print("DONE!")
def linex(y, x1, x2): def linex(y, x1, x2):
@ -50,9 +40,10 @@ def fill(xy1, xy2):
print(gcolor(0, 1)) #xc = 500
draw([[0,1, "red"]]) #yc = 500
draw(fill([26,0], [50, 85]),"white")
''' '''
#Russian flag #Russian flag