Use code tags or no one is even going to try to read your code.
What part specifically do you want help with? You have to be a lot more specific than just help you write your scripts for you. It looks like this is just an outline of code with a bunch of comments telling you what you should be doing. Have you tried doing what any of the comments say to do? If so, how did that go?