Jump to content

Dealing with clanchat helpp


GPSwap

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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