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,16 +65,24 @@ 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):
if not m2:
try: try:
parts = message.split(",") parts = m1.split(",")
x = float( parts[0] ) x = float( parts[0] )
y = float( parts[1] ) y = float( parts[1] )
# print(str(x) + "," + str(y)) # print(str(x) + "," + str(y))
pyautogui.moveRel(x, y); pyautogui.moveRel(x, y);
return "" except Exception as e:
pass
else:
try:
x = float( m1 )
y = float( m2 )
# print(str(x) + "," + str(y))
pyautogui.moveRel(x, y);
except Exception as e: except Exception as e:
pass pass