Hey so I am trying to send the Orbs for Run Energy, Prayer, and HP. For some reason when I try and send them it crashes the server, I have the interface ids correct but I think my issue is that they need the correct tab index. Well anyways here are some details any help would be appreciated!
This is the Open tabs, and this gets called upon login, so I am trying to figure out what the slot id is for the orbs.
Code:
public void openDefaultTabs() {
player.getInterfaceManager().openWindowsPane(new Component(548));
WeaponInterface inter = player.getExtension(WeaponInterface.class);
if (inter == null) {
player.addExtension(WeaponInterface.class, inter = new WeaponInterface(player));
}
openTab(0, inter); // Attack
openTab(1, new Component(320)); // Skills
openTab(2, new Component(274)); // Quest
openTab(3, new Component(149)); // inventory
openTab(4, new Component(387)); // Equipment
openTab(5, new Component(271)); // Prayer
openTab(6, new Component(player.getSpellBookManager().getSpellBook())); // Magic
if (player.getFamiliarManager().hasFamiliar()) {
openTab(7, new Component(662)); // summoning.
}
openTab(8, new Component(550)); // Friends
openTab(9, new Component(551)); // Ignores
openTab(10, new Component(589)); // Clan chat
openTab(11, new Component(261)); // Settings
openTab(12, new Component(464)); // Emotes
openTab(13, new Component(187)); // Music
openTab(14, new Component(182)); // Logout
openTab(15, new Component(750));//Run orb
openTab(16, new Component(748)); // HP bar
openTab(17, new Component(749)); // Prayer bar
if (player.getProperties().getAutocastSpell() != null) {
inter.selectAutoSpell(inter.getAutospellId(player.getProperties().getAutocastSpell().getSpellId()), true);
}
}
Code:
public void openTab(int slot, Component component) {
if (component.getId() == 92 && !(component instanceof WeaponInterface)) {
throw new IllegalStateException("Attack tab can only be instanced as " + WeaponInterface.class.getCanonicalName() + "!");
}
if (component.getDefinition().getTabIndex() != slot) {
System.err.println("Set tab index to " + slot + " for component " + component.getId() + ", definition requires updating!");
component.getDefinition().setTabIndex(slot);
}
if (component.getDefinition().getType() != InterfaceType.TAB) {
System.err.println("Set interface type to TAB for component " + component.getId() + ", definition requires updating!");
component.getDefinition().setType(InterfaceType.TAB);
}
component.open(player);
tabs[slot] = component;
}
Thanks in advance!