Jump to content

Requesting feedback on my first major script


dynamicninja

Recommended Posts

This is my first major script and I feel like I'm being a little ambitious but I would really like some feedback on if there are some things that I should/shouldn't be doing.

This is my first time using java, and a first project other than tutorials using object orientation.

As a side, just want to say thanks Explv. Your tutorial was an awesome introduction :)

FishingData.java

FishingHandle.java

Handler.java

Main.java

Banking.java

Link to comment
Share on other sites

You can do quite a lot more with enumerators in Java than that:

import org.osbot.rs07.api.map.Area;

public enum FishingData2 {

	SHRIMP(new Area(new int[][] {
		{ 3087, 3226 }, { 3085, 3228 },
		{ 3085, 3231 }, { 3085, 3232 },
		{ 3083, 3235 }, { 3085, 3235 },
		{ 3088, 3232 }, { 3089, 3227 }
		}), new String[] {"Small fishing net"}, new String[] {"Net", "Bait"}),
	
	SARDINE(new Area(new int[][]{
		{ 3087, 3226 }, { 3085, 3228 },
		{ 3085, 3231 }, { 3085, 3232 },
		{ 3083, 3235 }, { 3085, 3235 },
		{ 3088, 3232 }, { 3089, 3227 }
		}), new String[] {"Fishing rod", "Fishing bait"}, new String[] {"Bait", "Net"}),
	;
	
	private final Area fishingZone;
	private final String[] equipment;
	private final String[] npcOptions;
	
	private FishingData2(Area fishingZone, String[] equipment, String[] npcOptions) {
		this.fishingZone = fishingZone;
		this.equipment = equipment;
		this.npcOptions = npcOptions;
	}
	
	public Area getFishingZone() {
		return fishingZone;
	}
	
	public String[] getEquipment() {
		return equipment;
	}
	
	public String[] getNpcOptions() {
		return npcOptions;
	}
}

Then you can do:

FishingData2.SARDINE.getEquipment()

 

Also, perhaps read my most recent tutorial. It might help!

 

Edited by liverare
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...