Compare commits

..

2 Commits

Author SHA1 Message Date
justuser31
c8c6b2f405 Merge branch 'main' of ssh://ssh.dmcraft.online:2222/justuser/pxl_oboard 2023-04-21 16:06:37 +03:00
justuser31
ae874feb75 Add x and y move in draw() 2023-04-21 16:06:24 +03:00

21
bot.py
View File

@ -2,9 +2,13 @@ import requests
from time import sleep from time import sleep
from tqdm import tqdm from tqdm import tqdm
global xc, yc
xc = 0 ; yc = 0
def draw(cords, color = "black"): def draw(cords, color = "black"):
global xc, yc
for i in tqdm(range(len(cords))): for i in tqdm(range(len(cords))):
payload = {'x': cords[i][1], 'y': cords[i][0], '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)
@ -33,6 +37,19 @@ def fill(xy1, xy2):
res.append( [x, y] ) res.append( [x, y] )
return res return res
draw(fill([150,100], [200,150]), "red")
xc = 200
yc = 300
#Russian flag
draw(fill([300,300], [330, 300]))
draw(fill([300,330], [330, 330]))
draw(fill([300,300], [300, 330]))
draw(fill([330,300], [330, 330]))
draw(fill([301,321], [329, 329]), "white")
draw(fill([301,310], [329, 320]), "blue")
draw(fill([301,301], [329, 310]), "red")