Jump to content

Net fishing not working in my script


Soft Clay

Recommended Posts

Hi,

I'm trying to make a fishing script but my character isn't fishing the fishing spot. Can you guys help me? 

It doesn't log "Fishing.." so i guess it's not in the fishing STATE?

I'm trying to Net fish @ lumby

	private enum State {
		FISH, DROP, WAIT
	};

	private State getState() {
		if (!inventory.isEmpty())
			return State.DROP;
		if (!inventory.isFull())
			return State.FISH;
		return State.WAIT;
	}

	@Override
	public int onLoop() throws InterruptedException {
		NPC fishingSpot = npcs.closest("Fishing spot");
		switch (getState()) {
		case FISH:
			if (fishingSpot != null) {
				 if (fishingSpot.isVisible()) {
				fishingSpot.interact("Net");
				log("Fishing..");
				}
			}
			break;
		case DROP:
			inventory.dropAllExcept(303);
			break;
		case WAIT:
			sleep(random(500, 700));
			log("Waiting");
			break;
		}
		return random(200, 300);
	}

 

Edited by Soft Clay
Link to comment
Share on other sites

3 hours ago, KKona said:

if (!inventory.isEmpty())
	return State.DROP;

Should be 


if (inventory.isFull())
	return State.DROP;

 

What he said. If the net is in your inventory you tell the bot to drop (because inventory isn't empty) and in drop you say drop all but net. Endless loop of doing nothing.

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...