yetanotherbot 4 Posted April 2, 2020 Just a little one to get started. I couldn't see an obvious native method to disable aid. Hopefully I'm not reinventing the wheel. public void DisableAid(){ if((getPlayerSettings().getConfig(427) & 1) == 1){ getTabs().open(Tab.OPTIONS); WidgetChild aidToggle = getWidgets().getWidgetChild(261, 94); if(aidToggle != null){ log("DisableAid() >> Disabling Aid"); aidToggle.interact("Toggle Accept Aid"); sleep(600); } } } YAB
Hashtag 8955 Posted April 2, 2020 Nice to see a snippet from you! Have a look at my version I made from your's, perhaps you notice some neat things about our API. public boolean disableAid(){ if ((getPlayerSettings().getConfig(427) & 1) == 0) return true; if (!getTabs().open(Tab.OPTIONS)) return false; WidgetChild aidToggle = getWidgets().getWidgetChild(261, 94); return aidToggle != null && aidToggle.isVisible() && aidToggle.interact("Toggle Accept Aid") && sleepUntil(() -> (getPlayerSettings().getConfig(427) & 1) == 0, 2000); }
yetanotherbot 4 Author Posted April 2, 2020 Nice refinement. Thanks for taking the time to highlight those methods. PS I see you picked up on my C# naming conventions
Recommended Posts
Archived
This topic is now archived and is closed to further replies.