If you just want to track the current cursor location (i.e. if you don't need a view to follow the cursor), create a couple of new global variables in your Main.sc:
gTrackMouse = TRUE
gMouseX
gMouseY
Then add the following method in the Script class (Obj.sc):
(method (trackMouse)
(var nullEvent, mouseX, mouseY)
= nullEvent (Event:new(evNULL))
= gMouseX (send nullEvent:x)
= gMouseY (send nullEvent:y)
(send nullEvent:dispose())
)
and modify the doit() method for the Script class as well:
(method (doit)
(var theTime)
(if (== gTrackMouse TRUE)
(self:trackMouse())
)
...
You can now check the current position of the mouse anywhere in your game by referencing the gMouseX and gMouseY global variables. Additionally, you can toggle tracking the mouse movement with the gTrackMouse variable in the Main.sc by setting it TRUE or FALSE, so it can be disabled when you don't need it.