As the topic says this is my first java script. I have been studying JAVA for a couple weeks and think I am starting to get it. That being said I know there are some really stupid things in my script and my intent is to post it here and you guys and gals can tell me how bad it is and how to improve as a programmer.
Saying I "wrote" this is fairly generous as I mostly looked at what other people did and made it work for what I wanted to do. I decided not to make a fisher or woodcutter because then I would just be copying some of the fine examples provided by this website, so in order to make sure I was learning not copying here is what this script does:
Goes to "Drogo dwarf", tries to buy Iron ore, if there isn't enough to fill inventory hop to a different world and when full go bank.
A couple of things that I know are done wrong:
The loop to buy the ore. I tried to get it to buy 27 but the docs indicate it wants it in forms of 1,5,or 10. I would think there would be a way to tell it to buy exactly 27, but I can't figure it out.
The other thing I am not happy with is the world hopper. Instead of going to a random f2p world I would rather keep them all in an array and tell it get the current world and then hop to the next, but that is beyond me as well.
This script doesn't make much money, it wasn't the intent, this was to learn. I will say I am having a blast learning and scripting, hopefully I can make some more complicated ones soon.
So here it is, let me know if I am on the right track and what I need to work on please!
(Oh, and I didn't steal this from someone named jubjub, that's another online nick I use!)
edit: Wow those code tags dont format well! Check the spoiler for my script.