How to use the cursor in scripting

I want to know how to execute commands that have something to do with the cursor. For example, character always facing the cursor or projectiles going towards the cursot etc. However i dont know how to use the cursor in scripting. thanks for your help

accessing mouse position :


look at a object :


check (mouse) input :


<< you need learn those documentation well , to doing that >>