PurpleChalk 0 Posted June 22, 2017 private boolean cookAll() {return getWidgets().getWidgetContainingText("Raw shrimps").interact("Cook All");}private boolean howManyToCook() {return getWidgets().getWidgetContainingText("How many would you like to cook?") != null;}I have these two lines of code from a previous botting client.I've managed to achieve the first method of code using: private boolean cookAll() { return getWidgets().getWidgetChild(162,30).interact("Cook All");} Second method:private boolean howManyToCook() {return getWidgets().getWidgetChildrenContainingText("How many would you like to cook?") != null;}Some reason doesn't work?
PurpleChalk 0 Author Posted June 22, 2017 example usage I'm not the greatest coder, without comments this doesn't really mean much to me I'm afraid, is there no way to get widgets by text displayed on this bot? I've scoured the API.
Manly 879 Posted June 22, 2017 Its because the widget you are fetching is not correct. The widgets to cook all dont have text IIRC. You are better off getting the IDs.
PurpleChalk 0 Author Posted June 22, 2017 Its because the widget you are fetching is not correct. The widgets to cook all dont have text IIRC. You are better off getting the IDs. The interact with cook all works fine. What I'm trying is, IF the screen where you can select cook all exists(showing), then proceed to cook all,
Manly 879 Posted June 22, 2017 The interact with cook all works fine. What I'm trying is, IF the screen where you can select cook all exists(showing), then proceed to cook all, Oh. Its because the widget doesnt have to be null to not be there. I found it can still be visible whilst being null. Maybe try #isVisible.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.