The help manual is your best friend, but I through something together fast for you.
SYNC ON
SYNC RATE 60
MAKE OBJECT CUBE 1, 5
POSITION OBJECT 1, 0, 0, 20
DO
TEXT 0, 0, "Mouse X: " + STR$(MOUSEX()) `Left and Right
TEXT 0, 10, "Mouse Y: " + STR$(MOUSEY()) `Up and Down
TEXT 0, 20, "Mouse Z: " + STR$(MOUSEZ()) `Scroll Wheel
TEXT 0, 30, "Mouse Button: " + STR$(MOUSECLICK()) `All buttons on your mouse (Press F1 to see them all)
IF MOUSECLICK() = 1 `Left Mouse Button
iObject = PICK OBJECT(MOUSEX(), MOUSEY(), 1, 1)
IF iObject = 1
COLOR OBJECT 1, RGB(255, 128, 0)
ENDIF
ELSE
COLOR OBJECT 1, RGB(128, 128, 128)
ENDIF
YROTATE OBJECT 1, WRAPVALUE(OBJECT ANGLE Y(1) + 1)
SYNC
LOOP
END
http://www.gamestack.org