averaging numbers

Asked by arminius

this is the code I'm working with.
"ml = Env.getMouseLocation()
dragDrop(Env.getMouseLocation(),Location(ml.getX()+centerX\2,ml.getY()+centerY/2)) #Center is X607 Y548"

centerX = 607
so it should be whatever the number that comes from the mouses X location plus 607 divided by two.
currently it's adding them together but not dividing by two.
I've played around with the brackets, nothing seems to be working.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
arminius
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Is it a forward slash / or a backslash \ ?

What exactly do you want to do?
Drag an image from the mouse location half the ways to the screen center?
Then it is most probably
dragDrop(ml,Location( (ml.getX()+centerX)/2,(ml.getY()+centerY)/2) )

Revision history for this message
arminius (arminius75) said :
#2

thanks that worked great.
yes that is what I'm trying t do.