why not consult the mteasploit manual....do not forget that metasploit is a very complicated tool but yet fun to work with so i advice you consult your manual for detailed explanations
for your programming question:
I'd advise you to check this out http://www.catb.org/~esr/faqs/hacker-howto.html#skills1 and take it seriously...
Also what languages did you try to code/script in? This might be the problem with you not manging to get into this seriously...