Fix method

This commit is contained in:
Maxim Stewart 2020-11-22 22:46:55 -06:00
parent 62c678ff68
commit 5d0aaea98b
1 changed files with 19 additions and 11 deletions

View File

@ -65,17 +65,25 @@ def pressBack(eve = None):
return "" return ""
@app.route('/update-coords/xy/<message>/<message2>') @app.route('/update-coords/xy/<m1>/<m2>')
@socketio.on('update_coords', namespace='/socket.io') @socketio.on('update_coords', namespace='/socket.io')
def updateCoords(message = None, message2 = None): def updateCoords(m1 = None, m2 = None):
try: if not m2:
parts = message.split(",") try:
x = float( parts[0] ) parts = m1.split(",")
y = float( parts[1] ) x = float( parts[0] )
# print(str(x) + "," + str(y)) y = float( parts[1] )
pyautogui.moveRel(x, y); # print(str(x) + "," + str(y))
return "" pyautogui.moveRel(x, y);
except Exception as e: except Exception as e:
pass pass
else:
try:
x = float( m1 )
y = float( m2 )
# print(str(x) + "," + str(y))
pyautogui.moveRel(x, y);
except Exception as e:
pass
return "" return ""