Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved combat options

Joined
May 16, 2019
Messages
18
I haven't found if this was already implemented or if I had to do it from scratch.

It seems you can open the COMBAT_OPTIONS menu, but you can't select an attack mode or change it. For instance, change from "Stab" to "Slash" or "Defend" and such.

I was wondering if that was already implemented or if I had to do it myself. And if it's already implemented, where is it? I can't seem to find it in the documentation, but I'm not yet very familiar with it.

EDIT:

I've hacked a solution, though I'm far from sure that's how it's supposed to be done. Presuming I'm not supposed to change to the tab, scan through all the interface until I find the right button, and click it.
 
Last edited:
#1 Fabric Cleaner
Joined
Mar 18, 2017
Messages
393
I believe the there is no method within the API to change combat modes but you can implement a method very easily. Just use visual developer or interface explorer to see exactly what the interfaceconainer and interfacecomponent are and do it from there. You will have to deal with interfaces at one point so it might as well be now!
 
Joined
May 16, 2019
Messages
18
I believe the there is no method within the API to change combat modes but you can implement a method very easily. Just use visual developer or interface explorer to see exactly what the interfaceconainer and interfacecomponent are and do it from there. You will have to deal with interfaces at one point so it might as well be now!

Yeah, for now I did a very hacky thing that works, but because I'm not sure of how exactly it's being implemented on the API side, I'm not even sure if it's safe. I did that quick thing just to see if it worked - it did. But yeah, if I ever feel like it's very important, I'll re-visit it and make sure I'm doing it in a safer way if possible.



for(InterfaceComponent ic : Interfaces.getLoaded()){
if(ic.getText() != null){
String txt = ic.getText().trim().toLowerCase();
if(txt.equals(mode)){
System.out.println(mode+" FOUND");
ic.click();
break;​
}​
}​
}


PS: How do I write code in here without going through the pain of manually indenting it?
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
I have an API for the entire combat options tab that will be going in the xapi very soon.
 
Joined
May 16, 2019
Messages
18
I have an API for the entire combat options tab that will be going in the xapi very soon.

Awesome! Yeah, I dealt with it in the end using the Interface API. Ended up a learning experience anyways. Thank you!
 
Top