Stable version

main
none 11 months ago
parent c3dad58e41
commit 41f70c6cf2

@ -7,6 +7,7 @@ from listwork import *
# Easy debug # Easy debug
from icecream import ic from icecream import ic
ic.disable() # Disable debug
global server global server
#server = 'http://127.0.0.1:3333' #server = 'http://127.0.0.1:3333'
@ -45,7 +46,7 @@ def draw(pxls):
response = requests.post(server, i) response = requests.post(server, i)
sleep(0.1) sleep(0.1)
# cfill(0,0, 10,10) # cfill(0,0, 10,10) // Limit - 34x34
def cfill(x1,y1, x2,y2): def cfill(x1,y1, x2,y2):
pxls = [] pxls = []
for x in range(x1, x2+1): for x in range(x1, x2+1):
@ -58,15 +59,21 @@ def cfill(x1,y1, x2,y2):
def ccheck(packed): def ccheck(packed):
global server global server
response = requests.get(f'{server}/get_color={packed}') response = requests.get(f'{server}/get_color={packed}')
ic(response.text)
out = unpack(response.text) out = unpack(response.text)
return out return out
### EXAMPLE
# Draw random square 100x100 on 0,0
from random import randint as ri from random import randint as ri
#draw( fill(0,0, 100,100, [ri(0,255),ri(0,255),ri(0,255)]) ) draw( fill(0,0, 100,100, [ri(0,255),ri(0,255),ri(0,255)]) )
#draw( [[0,0, 100,100, 255,255,255]] )
#print(ccheck(pack([[0,0]]) )) # Check square 34x34 on 0,0
#print(ccheck(cfill(0,0, 10,10))) print(ccheck(cfill(0,0, 34,34)))
# Use extras, draw 1/2 random square 100x100 on 0,0
from bot_extras import * from bot_extras import *
draw(pas2( rand(0,0, 100,100) )) draw(pas2( rand(0,0, 100,100) ))

Loading…
Cancel
Save