Page 1 of 1

Global variables/mouse clicking

Posted: 22 Oct 2012, 16:11
by al33
How would i create some global variables to work with in both code pieces and normal actions. For example, setting the variables using:

var mouse = new Mouse();
x = mouse.position().x;
y = mouse.position().y;

And after clicking this position not through code, but through normal actions. How can i do it?

Re: Global variables/mouse clicking

Posted: 23 Oct 2012, 12:34
by Jmgr
All variables are automatically global.

To use the value of a variable to click at a position, set the position field to code mode using the red triangle and write the name of the variable containing the position.

To do that you will have to store the position a one Point variable, not two numbers:

Code: Select all

var position = Mouse().position();

Re: Global variables/mouse clicking

Posted: 24 Oct 2012, 03:52
by al33
Thank you, it worked.