August 4, 20178 yr kick = widgets.getWidgetContainingText(7, user); log(kick); if(kick.interact("Kick user " + user)){ sleep(5000); } when running this because of how ccs work(both leftclick and rightclick just open the "rightclick"dropdown menu) it thinks the action was sucessfull but it wasn't it just opens the options menu anyone know a way to fix this? Edited August 4, 20178 yr by GPSwap
August 4, 20178 yr Try an InteractionEvent maybe although I'm not sure it'll make a difference, otherwise just use a right click and the menu API although that's a bodge fix IMO
August 4, 20178 yr Author 5 minutes ago, HeyImJamie said: Try an InteractionEvent maybe although I'm not sure it'll make a difference, otherwise just use a right click and the menu API although that's a bodge fix IMO InteractionEvent didnt work, but menu api did, it takes a couple trys but it works, thankyou Edited August 4, 20178 yr by GPSwap
August 4, 20178 yr 13 minutes ago, GPSwap said: InteractionEvent didnt work, but menu api did, it takes a couple trys but it works, thankyou Why's it take a few tries? Haven't tested but something like this should work ;o private boolean kickPlayer(String username){ if (getMenuAPI().isOpen()){ if (getMenuAPI().selectAction("Kick user")){ return true; } } else { RS2Widget userWidget = getWidgets().getWidgetContainingText(7, username); if (userWidget != null){ if (userWidget.interact()){ new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return getMenuAPI().isOpen(); } }.sleep(); } } } return false; } } Edited August 4, 20178 yr by HeyImJamie
Create an account or sign in to comment