Jump to content
Reminiscence

Get Boned [250k xp/hour]

Recommended Posts

Edit: Added script source again. Seems like someone edited my post and removed it.

Here we go. Didn't see any other prayer scripts on the first page, so that was enough to just write one out.
Be sure to edit your hosts accordingly. Some code may be ugly and ghetto because I could not get widgets to work. (weird considering they always worked for me before)

Here's a proggy.
Paint was redone after initial testing.
CHG1XRX.png2qXoc7R.png

1rXVRyI.jpg

import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.ui.Message;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.awt.*;

@ScriptManifest(name = "Get Boned", author = "Sony", version = 1.0, info = "", logo = "") 

public class GetBoned extends Script {

	public boolean hasSetHost1 = false, hasSetHost2 = false, hasSetHost3 = false, 
			useHost1 = true, useHost2 = false, useHost3 = false;

	private long startTime, runTime;
	public String 
			bone = "Wyvern bones", coins = "Coins", state, 
			host = "parte", host2 = "jokcy", host3 = "the 420 cc", 
			curHost;

	Position phialsPos = new Position(2949, 3213, 0);
	Position portalPos = new Position(2953, 3224, 0);

	@Override
	public void onStart() {
		experienceTracker.startAll();
		startTime = System.currentTimeMillis();
	}

	public boolean isAnimating() throws InterruptedException{
		for(int i = 0; i < 5; i++){
			if(myPlayer().isAnimating() || players.myPlayer().isMoving())
				return true;
			else
				sleep(100);
		}
		return false;
	}

	public enum State {
		unnoting, entering, praying, exiting, idle, exit
	}

	private State getState() throws InterruptedException {
		if (inventory.contains(inventory.getItem(bone).getNotedId()) && !inventory.contains(inventory.getItem(bone).getUnnotedId()) && npcs.closest("Phials") == null) {
			state = "Exiting";
			return State.exiting;
		}

		if (inventory.contains(inventory.getItem(bone).getNotedId()) && !inventory.contains(inventory.getItem(bone).getUnnotedId()) && npcs.closest("Phials") != null) {
			state = "Unnoting";
			return State.unnoting;
		}

		if (inventory.contains(inventory.getItem(bone).getUnnotedId()) && objects.closest("Incense burner") == null) {
			state = "Entering house";
			return State.entering;
		}

		if (inventory.contains(inventory.getItem(bone).getUnnotedId()) && objects.closest("Incense burner") != null && !isAnimating()) {
			state = "Praying";
			return State.praying;
		}
		if (isAnimating() && inventory.contains(inventory.getItem(bone).getUnnotedId())) {
			state = "Idling...";
			return State.idle;
		}
		state = "Idling...";
		return State.idle;
	}


	@Override
	public int onLoop() throws InterruptedException {
		if (!inventory.contains(bone)) {
			stop();
		}
		switch (getState()) {			
		case unnoting:
			if (map.distance(npcs.closest("Phials")) > 8) {
				walking.webWalk(phialsPos);
				new ConditionalSleep(10000) {
					@Override
					public boolean condition() throws InterruptedException {
						return map.distance(npcs.closest("Phials")) < 8;
					}
				}.sleep();
			}

			if (map.distance(npcs.closest("Phials")) < 8) {
				if (inventory.contains(inventory.getItem(bone).getNotedId())) {
					inventory.getItem(inventory.getItem(bone).getNotedId()).interact("Use");
					if (inventory.isItemSelected()) {
						npcs.closest("Phials").interact("Use");
						new ConditionalSleep(5000) {
							@Override
							public boolean condition() throws InterruptedException {
								return dialogues.isPendingOption();
							}
						}.sleep();
					}
					if (dialogues.isPendingOption()) {
						sleep(random(600, 1800));
						if (inventory.getItem(inventory.getItem(bone).getNotedId()).getAmount() > 1 ) {
							dialogues.selectOption(3);
						} else {
							dialogues.selectOption(1);
						}
						new ConditionalSleep(5000) {
							@Override
							public boolean condition() throws InterruptedException {
								return inventory.contains(inventory.getItem(bone).getUnnotedId());
							}
						}.sleep();
					}
				}
			}

			break;

		case entering:
			if (objects.closest("Portal") != null) {
				if (map.distance(objects.closest("Portal")) > 5) {
					walking.webWalk(portalPos);
					new ConditionalSleep(10000) {
						@Override
						public boolean condition() throws InterruptedException {
							return map.distance(objects.closest("Portal")) < 5;
						}
					}.sleep();
				}

				if (map.distance(objects.closest("Portal")) < 5) {
					if (widgets.get(162, 33, 0) == null) {
						objects.closest("Portal").interact("Friend's house");
						new ConditionalSleep(8000) {
							@Override
							public boolean condition() throws InterruptedException {
								return widgets.get(162, 33, 0) != null;
							}
						}.sleep();
					}
					
					sleep(random(1200, 1500));

					if (useHost1) {
						curHost = host;
						if (!hasSetHost1) {
							keyboard.typeString(host, true);
							hasSetHost1 = true;
						} else {
							keyboard.typeEnter();
						}
					}
					
					if (useHost2) {
						curHost = host2;
						if (!hasSetHost2) {
							keyboard.typeString(host2, true);
							hasSetHost2 = true;
						} else {
							keyboard.typeEnter();
						}
					}
					
					if (useHost3) {
						curHost = host3;
						if (!hasSetHost3) {
							keyboard.typeString(host3, true);
							hasSetHost3 = true;
						} else {
							keyboard.typeEnter();
						}
					}
					
					new ConditionalSleep(15000) {
						@Override
						public boolean condition() throws InterruptedException {
							return objects.closest("Incense burner") != null;
						}
					}.sleep();
				}
			}
			break;

		case exiting:
			if (!isAnimating() && objects.closest("Altar") != null) {
				objects.closest("Portal").interact("Enter");
				new ConditionalSleep(10000) {

					@Override
					public boolean condition() throws InterruptedException {
						return objects.closest("Incense burner") == null;
					}
				}.sleep();
			}
			break;

		case praying:
			if (!isAnimating() && objects.closest("Incense burner") != null) {
				inventory.getItem(inventory.getItem(bone).getUnnotedId()).interact("Use");
				new ConditionalSleep(5000) {
					@Override
					public boolean condition() throws InterruptedException {
						return inventory.isItemSelected();
					}
				}.sleep();
				
				objects.closest("Altar").interact("Use");

				new ConditionalSleep(50000) {
					@Override
					public boolean condition() throws InterruptedException {
						return !inventory.contains(inventory.getItem(bone).getUnnotedId()) || dialogues.isPendingContinuation() || !isAnimating();
					}
				}.sleep();
			}
			break;

		case idle:
			new ConditionalSleep(2500) {
				@Override
				public boolean condition() throws InterruptedException {
					return !isAnimating() || dialogues.isPendingContinuation();
				}
			}.sleep();
			break;

		default:
			break;
		}
		return 600;
	}

	private final RenderingHints antialiasing = new RenderingHints(
			RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    private final Color color1 = new Color(0, 0, 0, 192);
    private final Color color2 = new Color(0, 0, 0);
    private final Color color3 = new Color(255, 255, 255);

    private final BasicStroke stroke1 = new BasicStroke(1);

    private final Font font1 = new Font("Arial", 0, 14);
    private final Font font2 = new Font("Arial", 0, 12);



	public final String formatTime(final long ms){
		long s = ms / 1000, m = s / 60, h = m / 60;
		s %= 60; m %= 60; h %= 24;
		return String.format("%02d:%02d:%02d", h, m, s);
	}

	 public void onMessage(Message message) throws java.lang.InterruptedException {
			if(message.getType() == Message.MessageType.GAME) {
					if (message.getMessage().contains("player is offline") && useHost1) {
						log("host 1 is offline");
						log("checking if host 2 is online");
						log("");
						useHost1 = false;
						useHost2 = true;
						useHost3 = false;
						return;
					}
					
					if (message.getMessage().contains("player is offline") && useHost2) {
						log("host 2 is offline");
						log("checking if host 3 is online");
						log("");
						useHost1 = false;
						useHost2 = false;
						useHost3 = true;
						return;
					}
					
					if (message.getMessage().contains("player is offline") && useHost3) {
						runTime = System.currentTimeMillis() - startTime;
						log("all three hosts offline, exiting");
						log("");
						log("Runtime: " + formatTime(runTime));
						log("XP Gained: " + experienceTracker.getGainedXP(Skill.PRAYER));
						stop();
					}
				}
		    }

	@Override
	public void onPaint(Graphics2D g) {
		g.setRenderingHints(antialiasing);
		runTime = System.currentTimeMillis() - startTime;
		
		g.setColor(color1);
        g.fillRect(563, 219, 156, 179);
        g.setColor(color2);
        g.setStroke(stroke1);
        g.drawRect(563, 219, 156, 179);
        g.setFont(font1);
        g.setColor(color3);
        g.drawString("Get Boned", 606, 240);
        g.drawLine(575, 246, 700, 246);
        g.setFont(font2);
        g.setColor(color3);
        
		g.drawString("Host: " + curHost, 570, 260);
		g.drawString("State: " + state, 570, 275);
		g.drawString("Runtime: " + formatTime(runTime), 570, 290);
		g.drawString("Exp gained: " + experienceTracker.getGainedXP(Skill.PRAYER), 570, 305);
		g.drawString("Exp/Hour: " + experienceTracker.getGainedXPPerHour(Skill.PRAYER), 570, 320);
		g.drawString("Levels gained: " + experienceTracker.getGainedLevels(Skill.PRAYER), 570, 335);

	}

}

 

Edited by Sonysi
  • Like 1
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.

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