Within Inquisit's framework, it would be preferable to track mouse coordinates whenever an actual mouse event occurs (e.g. movement), not at specific intervals (e.g. every X frames). There are several ways to do this.
You can find one example here:
https://www.millisecond.com/forums/FindPost4421.aspx (scripts are in the attached ZIP archive).
Another way would be to use /isvalidresponse to append event times and coordinates to a global variable. Building on the example in
https://www.millisecond.com/forums/FindPost13217.aspx , I'm thinking of something along the following lines:
<expressions>
/ ismouseovera = (mouse.x > 0.05*display.width && mouse.x < 0.35*display.width && mouse.y > 0.35*display.height && mouse.y < 0.65*display.height)
/ ismouseoverb = (mouse.x > 0.65*display.width && mouse.x < 0.95*display.width && mouse.y > 0.35*display.height && mouse.y < 0.65*display.height)
</expressions>
<values>
/ times_and_coordinates = ""
</values>
<block myblock>
/ trials = [1-4=sequence(centermousetrial,mouseovertrial)]
</block>
<trial centermousetrial>
/ ontrialbegin = [values.times_and_coordinates = ""; ]
/ stimulusframes = [1=clickhere]
/ inputdevice = mouse
/ validresponse = (clickhere)
</trial>
<text clickhere>
/ items = ("Click here!")
/ position = (50%, 90%)
</text>
<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=a,b]
/ inputdevice = mouse
/ isvalidresponse = [if (trial.mouseovertrial.response == "mousemove") {
values.times_and_coordinates = concat(concat(concat(concat(concat(concat(values.times_and_coordinates, trial.mouseovertrial.latency), "ms:"), mouse.x), "|"), mouse.y), "; ");
false; } ;
expressions.ismouseovera || expressions.ismouseoverb]
</trial>
<text a>
/ items = ("A1", "A2", "A3", "A4")
/ txbgcolor = (red)
/ size = (30%,30%)
/ position = (20%,50%)
</text>
<text b>
/ items = ("B1", "B2", "B3", "B4")
/ txbgcolor = (green)
/ size = (30%,30%)
/ position = (80%,50%)
</text>
<data>
/ columns = [date time subject trialnum trialcode response latency expressions.ismouseovera expressions.ismouseoverb values.times_and_coordinates]
/ separatefiles = true
</data>