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
  • Check if interacted with a interactable object


    NoSpine

    Recommended Posts

    Hello, I am writing some quest bots. And Sometimes the cursor misses a GameObject. I want to make a method that does something like this.

    void interactGO(GameObject gameobject){
    
    Boolean interacted = true;
    	while(interacted){
    		gameobject.interact();
    		sleep(10000);
    		if(gameobject.hasBeenInteracted()){
    			interacted = false;
    		}
    	}
    }

     

    But I don't know how to check if my player has interacted with a object. I know I can check it the model of the object has changed or something like that. But I reckon that sooner or later I am going to stumble into some GameObject that will not change its state in any way.

     

    Any ideas?

    Link to comment
    Share on other sites

    actually the problem wasn't with the cursor missing but for some reason it opened a door with just interact() and the other time it wanted interact("open"), but I wouldn't mind the answer to the previous question :) 

    Link to comment
    Share on other sites

    Ok, now this is embarrassing, I am talking to myself, I didn't look in the docs well enough. I see that interact() returns true if the action was performed successfully so I can just build on that.  

    Link to comment
    Share on other sites

    As you stated above, right, I've seen people recommend often to do something like if(x.interact(...) { which will work for what you're trying to achieve.

    Link to comment
    Share on other sites

    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.