Skip to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Checking prayer and hp?

Featured Replies

Hello all, had a big break from scripting and getting back into it again.

Simply, how would I check the players prayer & hp? Just working on a personal NMZ bot to pot up when prayer falls below a certain parameter, then to use overload when HP is above a certain parameter.

Cheers :)

getSkills.getStatic to get non boosted level

getskills.getDynamic to get a skill that is changing (boosted or stas r weakend etc)

  • Author
27 minutes ago, Chris said:

getSkills.getStatic to get non boosted level

getskills.getDynamic to get a skill that is changing (boosted or stas r weakend etc)

Cheers mate. Just thrown this quick script together but it doesn't interact with anything. Maybe I'm missing something?

 

import org.osbot.rs07.api.GrandExchange;
import org.osbot.rs07.api.Prayer;
import org.osbot.rs07.api.Bank.BankMode;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;


import java.awt.*;

@ScriptManifest(name = "Skeleton", author = "Alek", version = 1.0, info = "", logo = "") 

public class main extends Script {
	
    @Override
  
    public void onStart() {

        //Code here will execute before the loop is started

    }
    
    private enum State {
		PRAYERPOT, OVERLOAD, WAIT
	};

   
	private State getState() {
		
		if (getSkills().getDynamic(Skill.PRAYER) < 20)
		{
			return State.PRAYERPOT;
		}
		if (getSkills().getDynamic(Skill.HITPOINTS) > 51)
		{
			return State.OVERLOAD;
		}	
		return State.WAIT;
	}
    
	public int onLoop() throws InterruptedException {
		switch (getState()) {
		
		case PRAYERPOT:
			if (getInventory().contains("Prayer potion(4)"))
			{
				inventory.getItem("Prayer potion(4)");
				mouse.click(false);
			}
			else if (getInventory().contains("Prayer potion(3)"))
			{
				inventory.getItem("Prayer potion(3)");
				mouse.click(false);
			}
			else if (getInventory().contains("Prayer potion(2)"))
			{
				inventory.getItem("Prayer potion(2)");
				mouse.click(false);
			}
			else if (getInventory().contains("Prayer potion(1)"))
			{
				inventory.getItem("Prayer potion(1)");
				mouse.click(false);
			}
			
			break;
			
		case OVERLOAD:
			if (getInventory().contains("Overload (4)"))
			{
				inventory.getItem("Overload (4)");
				mouse.click(false);
			}
			else if (getInventory().contains("Overload (3)"))
			{
				inventory.getItem("Overload (3)");
				mouse.click(false);
			}
			else if (getInventory().contains("Overload (2)"))
			{
				inventory.getItem("Overload (2)");
				mouse.click(false);
			}
			else if (getInventory().contains("Overload (1)"))
			{
				inventory.getItem("Overload (1)");
				mouse.click(false);
			}
			break;
			
		case WAIT:
			sleep(3000);
			break;
		}
		return random(200, 300);
	}
			

    @Override

    public void onExit() {

        //Code here will execute after the script ends

    }

 

    public void onPaint(Graphics2D g) {

        //This is where you will put your code for paint(s)

    }

}

 

4 minutes ago, uyfgfarOS said:

Cheers mate. Just thrown this quick script together but it doesn't interact with anything. Maybe I'm missing something?

 


import org.osbot.rs07.api.GrandExchange;
import org.osbot.rs07.api.Prayer;
import org.osbot.rs07.api.Bank.BankMode;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;


import java.awt.*;

@ScriptManifest(name = "Skeleton", author = "Alek", version = 1.0, info = "", logo = "") 

public class main extends Script {
	
    @Override
  
    public void onStart() {

        //Code here will execute before the loop is started

    }
    
    private enum State {
		PRAYERPOT, OVERLOAD, WAIT
	};

   
	private State getState() {
		
		if (getSkills().getDynamic(Skill.PRAYER) < 20)
		{
			return State.PRAYERPOT;
		}
		if (getSkills().getDynamic(Skill.HITPOINTS) > 51)
		{
			return State.OVERLOAD;
		}	
		return State.WAIT;
	}
    
	public int onLoop() throws InterruptedException {
		switch (getState()) {
		
		case PRAYERPOT:
			if (getInventory().contains("Prayer potion(4)"))
			{
				inventory.getItem("Prayer potion(4)");
				mouse.click(false);
			}
			else if (getInventory().contains("Prayer potion(3)"))
			{
				inventory.getItem("Prayer potion(3)");
				mouse.click(false);
			}
			else if (getInventory().contains("Prayer potion(2)"))
			{
				inventory.getItem("Prayer potion(2)");
				mouse.click(false);
			}
			else if (getInventory().contains("Prayer potion(1)"))
			{
				inventory.getItem("Prayer potion(1)");
				mouse.click(false);
			}
			
			break;
			
		case OVERLOAD:
			if (getInventory().contains("Overload (4)"))
			{
				inventory.getItem("Overload (4)");
				mouse.click(false);
			}
			else if (getInventory().contains("Overload (3)"))
			{
				inventory.getItem("Overload (3)");
				mouse.click(false);
			}
			else if (getInventory().contains("Overload (2)"))
			{
				inventory.getItem("Overload (2)");
				mouse.click(false);
			}
			else if (getInventory().contains("Overload (1)"))
			{
				inventory.getItem("Overload (1)");
				mouse.click(false);
			}
			break;
			
		case WAIT:
			sleep(3000);
			break;
		}
		return random(200, 300);
	}
			

    @Override

    public void onExit() {

        //Code here will execute after the script ends

    }

 

    public void onPaint(Graphics2D g) {

        //This is where you will put your code for paint(s)

    }

}

 

You have to call interact(interaction name) on the item returned by getItem

Edited by Explv

  • Author
7 minutes ago, Explv said:

You have to call interact(interaction name) on the item returned by getItem

Thanks Explv, could you perhaps show me how it's used? I used my above method in a previous herb cleaning script and it worked fine!

 

maybe this?

	
				int slot = getInventory().getSlot("Prayer potion(4)");
		        getMouse().click(new InventorySlotDestination(getBot(), slot));

 

Edited by uyfgfarOS

3 minutes ago, uyfgfarOS said:

Thanks Explv, could you perhaps show me how it's used? I used my above method in a previous herb cleaning script and it worked fine!

getInventory().getItem("Bronze pickaxe").interact("Use"); Although just doing getInventory().interact("Use", "Bronze pickaxe"); works.

2 minutes ago, uyfgfarOS said:

Thanks Explv, could you perhaps show me how it's used? I used my above method in a previous herb cleaning script and it worked fine!

getInventory().interactWithNameThatContains("Drink", "potion");

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.