averaging numbers

Asked by arminius on 2017-07-07

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:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
arminius
Solved:
2017-07-08
Last query:
2017-07-08
Last reply:
2017-07-07
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) )

arminius (arminius75) said : #2

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