NoSpine 0 Posted October 22, 2021 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?
NoSpine 0 Author Posted October 22, 2021 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
NoSpine 0 Author Posted October 22, 2021 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.
trtl 2 Posted October 22, 2021 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.