Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • interact() missclicks constantly + closest() doesnt find the object


    dreww

    Recommended Posts

    Posted

    As the title says, the interact() function missclicks as such: https://i.imgur.com/6MjpeDc.gifv

    GameObject rope = getGameObjects().getTopObjectOnTile(new Tile(2141, 4239, 3));
    if(rope != null){
        log("found rope");
        rope.interact("Climb");
    }

    furthermore, if I replace the first line with following, the object is never found

    GameObject rope = getGameObjects().closest("Rope");
    
    Posted

    Edit: Every time I try to post something, I get roasted so del. this comment. Thx.

     

    Seriously: If you're a scripter, and you don't agree with a suggestion I make/it's not the right suggestion:

     

    Why don't you just educate everyone on the thread how to do things properly? Rather than just responding "LOL" or harassing me for months over something stupid like dropping the black axe in my first script.

    Posted

    Try making rope into a private static final:

     

    Private Static Final String ROPE = "Rope"

     

    May or may not work, worth a shot.

     

    LOL what would this do

    Posted

    LOL what would this do

    You're the one with rank, you should be giving advice, not trying to roast me.

    "May or may not work"

     

    Why don't you go ahead and tell us what to do then Man16, educate us. I mean after all you're the one with more knowledge, so share it instead of coming at me like that. Because personally, I find your comment pretty useless?

     

    Edit: At I least took the effort to make a suggestion instead of making a 5 word post that is completely and entirely useless.

    Posted

    Have you tried using the id of the object? When you use GameObject rope = getGameObjects().closest("Rope"); is it returning null or just not interacting with the rope?

    Posted

    The interaction isn't misclicking, something in the menu is not matching up correctly.

    You could go through each of the objects on the tile, rather than just grabbing the first.

    Or you could use the game debugger and see what that shows when you check game objects.

    You can also use entity hover to make sure the rope is what you think it should be.

    Posted

    Seem like the default action is what u need so may aswell just click the object ^.^

    GameObject rope = m.getGameObjects().getTopObjectOnTile(new Tile(2141, 4239, 3));
    
    if (rope != null) {
    	getMouse().click(rope);
    	// sleep.. 
    }
    
    			
    
    
    Posted

    Have you tried using the id of the object? When you use GameObject rope = getGameObjects().closest("Rope"); is it returning null or just not interacting with the rope?

     

    Returns null when I use this.

     

     

    Seem like the default action is what u need so may aswell just click the object ^.^

    GameObject rope = m.getGameObjects().getTopObjectOnTile(new Tile(2141, 4239, 3));
    
    if (rope != null) {
    	getMouse().click(rope);
    	// sleep.. 
    }
    

    This works but occasionally it'll missclick other objects cause the camera is angled oddly, so I would love to find a solution to the issue as well.

     

    Thanks.

    The interaction isn't misclicking, something in the menu is not matching up correctly.

    You could go through each of the objects on the tile, rather than just grabbing the first.

    Or you could use the game debugger and see what that shows when you check game objects.

    You can also use entity hover to make sure the rope is what you think it should be.

     

    Tried the following, which logged a couple dozen null's. This seems like something that shouldn't be happening :P

    for(int i = 0; i<getGameObjects().all().size(); i++) {
        log(getGameObjects().all().get(i).getName());
    }
    
    Posted

     

    Returns null when I use this.

     

     

     

    Tried the following, which logged a couple dozen null's. This seems like something that shouldn't be happening :P

    for(int i = 0; i<getGameObjects().all().size(); i++) {
        log(getGameObjects().all().get(i).getName());
    }
    

    getName can return null. For example, there are misc gameobjects near the gnome agility course which are still gameobjects but arent given a name.

    Posted

    getName can return null. For example, there are misc gameobjects near the gnome agility course which are still gameobjects but arent given a name.

     

    They ALL return null though, which seems odd.

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.