Jump to content

Dealing with clanchat helpp


Recommended Posts

Posted (edited)
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

0699ae3f019fd39a315c3494f62b5caa.png

anyone know a way to fix this? :s

ea2f6b170461a7c53d4a852c4ff46f51.png

Edited by GPSwap
Posted (edited)
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 by GPSwap
Posted (edited)
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 by HeyImJamie
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...