Jump to content

Help with Hosidius Favour


Avoided

Recommended Posts

Hello All,

I am currently trying to do some hosidius favour and I had a few questions some people probably have answers to,

How do I check current percentage of hosidius favour?

Pushing the plough is no problem but how would I check if I am on the correct side to push to plough in the correct direction as well as check state to repair?

Thank you in advance to anyone that is able to provide me with any information,

Avoided :)

Link to comment
Share on other sites

3 minutes ago, Avoided said:

Hello All,

I am currently trying to do some hosidius favour and I had a few questions some people probably have answers to,

How do I check current percentage of hosidius favour?

Pushing the plough is no problem but how would I check if I am on the correct side to push to plough in the correct direction as well as check state to repair?

Thank you in advance to anyone that is able to provide me with any information,

Avoided :)

There isn't a method specifically for this, so what you'd have to do, is make a functions that compares the state/position of the selected plough, track its location and once it reaches a position on the edge of the farm, walk to the other side and repeat.

This works if the character starts on the correct side, you'd have to make a separate start method for this 

  • Like 1
Link to comment
Share on other sites

9 minutes ago, Protoprize said:

There isn't a method specifically for this, so what you'd have to do, is make a functions that compares the state/position of the selected plough, track its location and once it reaches a position on the edge of the farm, walk to the other side and repeat.

This works if the character starts on the correct side, you'd have to make a separate start method for this 

I assumed that would be the method to do so, thank you for the help, any idea on how to check hosidius favour?

Link to comment
Share on other sites

How to check Hosidious favour:

float favour = getFavour().getFavour(Favour.House.HOSIDIUS);

This is a method from my script Extra House Favour that I use to push the plough.

private NPC plough = null;

private void pushPlough() {
	if (!myPlayer().isAnimating()) {
		if (plough == null) {
			plough = getNpcs().closest(o -> o.getId() == 6924);
		}
		if (plough != null) {
			log("Plough Position X:" + plough.getPosition().getX() + " Y: " + plough.getPosition().getY());
			boolean infront = myPosition().equals(plough.getPosition().translate(3, 1));
			boolean behind = myPosition().equals(plough.getPosition().translate(-1, 1));
			if ((infront && plough.getPosition().getX() != 1763) || (behind && plough.getPosition().getX() != 1777)) {
				if (plough.hasAction("Repair")) {
					if (plough.interact("Repair")) {
						new ConditionalSleep(1000, 3000) {
							@Override
							public boolean condition() throws InterruptedException {
								return myPlayer().isAnimating();
							}
						}.sleep();
					}
				} else {
					if (plough.interact("Push")) {
						new ConditionalSleep(1000, 3000) {
							@Override
							public boolean condition() throws InterruptedException {
								return myPlayer().isAnimating();
							}
						}.sleep();
					}
				}
			} else {
				int front = plough.getPosition().distance(new Position(1777, plough.getY(), 0));
				Position frontPos = plough.getPosition().translate(3, 1);
				int back = plough.getPosition().distance(new Position(1763, plough.getY(), 0));
				Position backPos = plough.getPosition().translate(-1, 1);
				if (front > back) {
					getWalking().walk(backPos);
				} else {
					getWalking().walk(frontPos);
				}
			}
		} else {
			log("Plough is null!");
		}
	} else {
		log("Pushing the plough");
	}
}

EDIT: You also need to be in this area or it wont work. You can make it work for the other plough areas, but you'll have the replace the front and back coordinates.

private Area farm = new Area(1762, 3557, 1780, 3543);

 

Edited by ExtraBotz
Added the area the player needs to be in
  • Heart 1
Link to comment
Share on other sites

9 minutes ago, ExtraBotz said:

How to check Hosidious favour:


float favour = methods.getFavour().getFavour(Favour.House.HOSIDIUS);

This is a method from my script Extra House Favour that I use to push the plough.


private NPC plough = null;

private void pushPlough() {
	if (!myPlayer().isAnimating()) {
		if (plough == null) {
			plough = getNpcs().closest(o -> o.getId() == 6924);
		}
		if (plough != null) {
			log("Plough Position X:" + plough.getPosition().getX() + " Y: " + plough.getPosition().getY());
			boolean infront = myPosition().equals(plough.getPosition().translate(3, 1));
			boolean behind = myPosition().equals(plough.getPosition().translate(-1, 1));
			if ((infront && plough.getPosition().getX() != 1763) || (behind && plough.getPosition().getX() != 1777)) {
				if (plough.hasAction("Repair")) {
					if (plough.interact("Repair")) {
						new ConditionalSleep(1000, 3000) {
							@Override
							public boolean condition() throws InterruptedException {
								return myPlayer().isAnimating();
							}
						}.sleep();
					}
				} else {
					if (plough.interact("Push")) {
						new ConditionalSleep(1000, 3000) {
							@Override
							public boolean condition() throws InterruptedException {
								return myPlayer().isAnimating();
							}
						}.sleep();
					}
				}
			} else {
				int front = plough.getPosition().distance(new Position(1777, plough.getY(), 0));
				Position frontPos = plough.getPosition().translate(3, 1);
				int back = plough.getPosition().distance(new Position(1763, plough.getY(), 0));
				Position backPos = plough.getPosition().translate(-1, 1);
				if (front > back) {
					getWalking().walk(backPos);
				} else {
					getWalking().walk(frontPos);
				}
			}
		} else {
			log("Plough is null!");
		}
	} else {
		log("Pushing the plough");
	}
}

 

Oh wow I cant thank you enough, this is amazing ! 

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