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

How to change the combat style?

Featured Replies

I understand that to obtain the current option is like this:

getConfigs().get(43)

Knowing that the ways to use are the following:

0 - Attack

1 - Strength

3 - Defense

How do I order the change of this configuration?

Many thanks to anyone who can help me.

Edited by trainux

So it seems like you've figured out that if that config is a certain value, you're currently using that attack style.

Now we check if we're currently using the attack style you want, and then we use widgets to change the attack style, for example:

if (needAttackStyle() && getConfigs().get(43) != 0) {
	open settings tab and interact with the required widget
}

 

  • Author
22 minutes ago, d0zza said:

So it seems like you've figured out that if that config is a certain value, you're currently using that attack style.

Now we check if we're currently using the attack style you want, and then we use widgets to change the attack style, for example:


if (needAttackStyle() && getConfigs().get(43) != 0) {
	open settings tab and interact with the required widget
}

 

Ok, I understand that changing the tab is simple:

getTabs().open(Tab.ATTACK);

The part that I do not understand is the "widget", so far I do not know how they are used for more than I look for examples, I do not know what I'm confusing.

1 minute ago, trainux said:

Ok, I understand that changing the tab is simple:


getTabs().open(Tab.ATTACK);

The part that I do not understand is the "widget", so far I do not know how they are used for more than I look for examples, I do not know what I'm confusing.

Go to the settings in osbot and tick widgets, you should get a good idea of what they are from experimenting with that.

  • Author
14 minutes ago, d0zza said:

Go to the settings in osbot and tick widgets, you should get a good idea of what they are from experimenting with that.

Now what do I do with that information?
I really apologize for my ignorance.

osbot widgets.jpg

  • Author
18 minutes ago, d0zza said:

Get the widget you want and interact with it using the widget api.

https://osbot.org/api/org/osbot/rs07/api/Widgets.html

Thanks.


int str = getSkills().getDynamic(Skill.STRENGTH);
RS2Widget modeStr = getWidgets().get(593,7);
int atk = getSkills().getDynamic(Skill.ATTACK);
RS2Widget modeAtk = getWidgets().get(593,3);
int def = getSkills().getDynamic(Skill.DEFENCE);
RS2Widget modeDef = getWidgets().get(593,15);

int config = getConfigs().get(43);

if(str < 13) {
    getTabs().open(Tab.ATTACK);
	sleep(1000);
	if(config!=1) {
		modeStr.interact("Slash");
		sleep(random(3000,7000));
	}
    getTabs().open(Tab.INVENTORY);
}else if(atk < 13) {
    getTabs().open(Tab.ATTACK);
	sleep(1000);
	if(config!=0) {
		modeAtk.interact("Chop");
		sleep(random(3000,7000));
	}
    getTabs().open(Tab.INVENTORY);
}else if(def < 13) {
    getTabs().open(Tab.ATTACK);
	sleep(1000);
	if(config!=3) {
		modeDef.interact("Block");
		sleep(random(3000,7000));
	}
    getTabs().open(Tab.INVENTORY);
}else {
    getTabs().open(Tab.ATTACK);
	sleep(1000);
	if(config!=1) {
		modeStr.interact("Slash");
		sleep(random(3000,7000));
	}
    getTabs().open(Tab.INVENTORY);
}

Declare widgets and interact with them.

7 hours ago, trainux said:

Thanks.



int str = getSkills().getDynamic(Skill.STRENGTH);
RS2Widget modeStr = getWidgets().get(593,7);
int atk = getSkills().getDynamic(Skill.ATTACK);
RS2Widget modeAtk = getWidgets().get(593,3);
int def = getSkills().getDynamic(Skill.DEFENCE);
RS2Widget modeDef = getWidgets().get(593,15);

int config = getConfigs().get(43);

if(str < 13) {
    getTabs().open(Tab.ATTACK);
	sleep(1000);
	if(config!=1) {
		modeStr.interact("Slash");
		sleep(random(3000,7000));
	}
    getTabs().open(Tab.INVENTORY);
}else if(atk < 13) {
    getTabs().open(Tab.ATTACK);
	sleep(1000);
	if(config!=0) {
		modeAtk.interact("Chop");
		sleep(random(3000,7000));
	}
    getTabs().open(Tab.INVENTORY);
}else if(def < 13) {
    getTabs().open(Tab.ATTACK);
	sleep(1000);
	if(config!=3) {
		modeDef.interact("Block");
		sleep(random(3000,7000));
	}
    getTabs().open(Tab.INVENTORY);
}else {
    getTabs().open(Tab.ATTACK);
	sleep(1000);
	if(config!=1) {
		modeStr.interact("Slash");
		sleep(random(3000,7000));
	}
    getTabs().open(Tab.INVENTORY);
}

Declare widgets and interact with them.

null checks

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

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.