Jump to content

How to change the combat style?


trainux

Recommended Posts

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
}

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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

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