Autoclick script help

So I really tried to get this to work but I am a complete moron when it comes to coding things. I am trying to get a script that clicks with LMB for 50 seconds at 1 click per ms, clicks "h", and then loops. I want it to activate when i press f6 and stop when I click it again.