Jump to content

Detecting when the house loading screen has closed


Solzhenitsyn

Recommended Posts

The behaviour of the house loading screen appears to be different than regular loading screens. Even though you cannot see or interact with anything, everything has already been loaded into the game so checks like myPlayer.exists, UI widget checks (I tried inventory), and in-game object checks all return true, even though the game cannot be interfaced with.

 

Anyone got a solution? 

 

Current workaround are the normal checks, then when all the background objects have loaded I wait until run can be toggled on and off.

 

feels.png

Link to comment
Share on other sites

I don't have a member account ATM so can't try test anything, I assume you have, but if you haven't you should find what widget is the text saying "House loading" or whatever and just do .isVisible() on it? That should work providing osbot still shows widget id's when your loading houses (I don't see why it wouldn't).
 

I'd also use a conditonal sleep just because they are a nice failsafe if something odd happens.

Example code would I guess be

 

LSWR being LoadingScreenWidgetRoot

LSWC being LoadingScreenWidgetChild

LSWCC beign LoadingScreenWidgetChildChild (if applicable)
 

new ConditionalSleep(5000)
{
	@--Override // Remove --, forum was tagging a user lol
	public boolean condition() throws InterruptedException 
	{
			if(getWidgets().get(LSWR, LSWC, LSWCC).isVisible())
				return true;
			return false;
	}
					
}.sleep();

This is my best guess since you said that you have checked inventory and objects existing etc, and that it behaves different to other loading screens. But I can't think of a reason why OSBot would determine any widget in the loading screen is visible if it wasnt or vice versa. Let me know if it works!

Edited by venetox
Link to comment
Share on other sites

...

Without checking to see if the widget has been initialized, you are gonna get a shit load of NPEs. In any case, the house loading screen has no widgets.

 

 

Returns true when you are in the house (according to the map), but things cannot be interacted with yet.

Link to comment
Share on other sites

Without checking to see if the widget has been initialized, you are gonna get a shit load of NPEs. In any case, the house loading screen has no widgets.

 

 

Returns true when you are in the house (according to the map), but things cannot be interacted with yet.

 

Oh yeah, silly me, wrote that up whilst I wasn't home. Odd that it has no widgets. Hmmmm, perhaps you may have to resort to something like reading pixels or something which at least is better than having a long sleep or constantly checking if run can be toggled etc. Surely there has to be a nice way of doing it though.

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...