As everyone has said, there are lots of OSBot scripting / java tutorials out and about to learn from. Since it's a steep learning curve, don't expect it to come straight away! It's certainly not out of your reach though by any means. Just takes a little practice!
In answer to your query about example source code for scripts, I would suggest going around the local scripts section and decompiling (i.e "extracting" the source from a jar. I use quote marks as it's not exactly extracting since the source is not directly stored and rather the compiled bytecode is there, so the decompiler may not always be accurate but they normally do a decent job!) some scripts to look at the code. You should be able to find plenty of decompilers online!
That being said, there are definitely some local scripts out there that you shouldn't learn from!
Good luck!