claybotter 23 Share Posted June 16, 2018 public void setAttackStyle() { getTabs().open(Tab.OPTIONS); sleep(1000); if (getWidgets().getWidget(261).getChild(1).getChild(6) != null) { getWidgets().getWidget(261).getChild(1).getChild(6).interact(); sleep(1000); } if (getWidgets().getWidget(261).getChild(70).getChild(4) != null) { getWidgets().getWidget(261).getChild(70).getChild(4).interact(); sleep(1000); } if (getWidgets().getWidget(261).getChild(86).getChild(3) != null) { getWidgets().getWidget(261).getChild(86).getChild(3).interact(); sleep(1000); } getTabs().open(Tab.INVENTORY); sleep(1000); } Link to comment Share on other sites More sharing options...
Nex 2542 Share Posted June 16, 2018 private enum AttackOption { DEPENDS_ON_COMBAT_LEVEL, ALWAYS_RIGHT_CLICK, LEFT_CLICK_WHERE_AVAILABLE, HIDDEN } private boolean isAttackOption(SettingType settingType, AttackOption attackOption) { return (getPlayerSettings().getConfig(settingType.getConfigValue()) & attackOption.ordinal()) == attackOption.ordinal(); } private enum SettingType { PLAYER(69, 85, 1107), NPC(70, 86, 1306); private int mainChildIndex, childIndex, configValue; SettingType(int mainChildIndex, int childIndex, int configValue) { this.mainChildIndex = mainChildIndex; this.childIndex = childIndex; this.configValue = configValue; } public int getMainChildIndex() { return mainChildIndex; } public int getChildIndex() { return childIndex; } public int getConfigValue() { return configValue; } } // Attack options private boolean openConfig() { return getTabs().isOpen(Tab.OPTIONS) || m.getTabs().open(Tab.OPTIONS); } private boolean openControls() { WidgetChild configChild = getWidgets().getWidgetChild(261, 1, 6); return configChild != null && (configChild.getTextureId() == 762 || configChild.interact("Controls")); } private boolean toggleAttackOption(SettingType settingType, AttackOption attackOption) { if (openConfig() && openControls()) { WidgetChild optionChild = getWidgets().getWidgetChild(261, settingType.getChildIndex(), (attackOption.ordinal() + 1)); if (optionChild != null && optionChild.isVisible()) { return optionChild.interact(); } else { WidgetChild comboBox = getWidgets().getWidgetChild(261, settingType.getMainChildIndex(), 0); return comboBox != null && comboBox.interact(); } } return false; } Credits to: @Dinh Link to comment Share on other sites More sharing options...
dQw4w9WgXcQ 184 Share Posted June 16, 2018 hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm Link to comment Share on other sites More sharing options...
claybotter 23 Author Share Posted June 17, 2018 11 hours ago, Nex said: private enum AttackOption { DEPENDS_ON_COMBAT_LEVEL, ALWAYS_RIGHT_CLICK, LEFT_CLICK_WHERE_AVAILABLE, HIDDEN } private boolean isAttackOption(SettingType settingType, AttackOption attackOption) { return (getPlayerSettings().getConfig(settingType.getConfigValue()) & attackOption.ordinal()) == attackOption.ordinal(); } private enum SettingType { PLAYER(69, 85, 1107), NPC(70, 86, 1306); private int mainChildIndex, childIndex, configValue; SettingType(int mainChildIndex, int childIndex, int configValue) { this.mainChildIndex = mainChildIndex; this.childIndex = childIndex; this.configValue = configValue; } public int getMainChildIndex() { return mainChildIndex; } public int getChildIndex() { return childIndex; } public int getConfigValue() { return configValue; } } // Attack options private boolean openConfig() { return getTabs().isOpen(Tab.OPTIONS) || m.getTabs().open(Tab.OPTIONS); } private boolean openControls() { WidgetChild configChild = getWidgets().getWidgetChild(261, 1, 6); return configChild != null && (configChild.getTextureId() == 762 || configChild.interact("Controls")); } private boolean toggleAttackOption(SettingType settingType, AttackOption attackOption) { if (openConfig() && openControls()) { WidgetChild optionChild = getWidgets().getWidgetChild(261, settingType.getChildIndex(), (attackOption.ordinal() + 1)); if (optionChild != null && optionChild.isVisible()) { return optionChild.interact(); } else { WidgetChild comboBox = getWidgets().getWidgetChild(261, settingType.getMainChildIndex(), 0); return comboBox != null && comboBox.interact(); } } return false; } Credits to: @Dinh gunna use this instead ty Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.