I advice you to download the
Official Scripting Documentation and read it... there you will find almost all the basic things to start scripting... and to visit the
Scripts DataBase (DB) and download some examples to study... practice a lot... and then you will able to do almost whatever you want... if you have any question you can SEARCH in the forums... and if you don't find the answer then open a thread with the question or problem you are having...
Regards and good luck