Jump to content

Requesting feedback on my first major script


Recommended Posts

Posted

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

Posted (edited)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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