Jump to content

Interacting with the settings menu


aylsero

Recommended Posts

19 minutes ago, aylsero said:

Hey everyone,

 

I'm looking for information regarding interacting with the settings menu. There's some stuff I'd like to change when my bot first initializes but I can't find much information on it.

For context, I mean this settings menu:

cUiyp16uTMq80SqIcx2YYQ.png

 

Any help would be great. Thank you

Settings class :)
 

Example:

script.getSettings().setSetting(Settings.AllSettingsTab.DISPLAY, "Hide roofs", true);

 

Link to comment
Share on other sites

Thank you. Not sure if this works great for me though. It Doesn't seem to be able to navigate the menu properly however if I pause the script it will make the changes?

ZdwKlVPbTriZVM83XCOnhg.png

A clip in action: https://streamable.com/fvp1zt

 

Sometimes it cannot find the settings I've set to change, sometimes it does. Normally it gets stuck at the menu screen after looking at "display"

 

Is it possible to debug the code when it's launched in Osbot? New to Java and IntelliJ as I'm a C# programmer.

 

Thank you

Link to comment
Share on other sites

1 hour ago, aylsero said:

Thank you. Not sure if this works great for me though. It Doesn't seem to be able to navigate the menu properly however if I pause the script it will make the changes?

ZdwKlVPbTriZVM83XCOnhg.png

A clip in action: https://streamable.com/fvp1zt

 

Sometimes it cannot find the settings I've set to change, sometimes it does. Normally it gets stuck at the menu screen after looking at "display"

 

Is it possible to debug the code when it's launched in Osbot? New to Java and IntelliJ as I'm a C# programmer.

 

Thank you

Well that's because your are doing 5 things in a row ... You should only be doing 1 every loop cycle for a stable result :)
Place some debug logs :D

Edited by Khaleesi
Link to comment
Share on other sites

In onloop you can maybe try something like

if (!didSetAttackOptions) {
//settings.setSetting(blahblah)

didSetAttackOptions = true;

}
 

Just be careful try not to put everything in onStart, and always account for the worst case scenario e.g. dialogue is open, which doesn’t let you open settings tab. I personally try getWidgets().closeOpenInterface(); before even touching settings, and in some cases I walk to my current tile just to cancel anything including selected items etc. Maybe am just paranoid :doge: 

Link to comment
Share on other sites

19 minutes ago, Czar said:

In onloop you can maybe try something like

if (!didSetAttackOptions) {
//settings.setSetting(blahblah)

didSetAttackOptions = true;

}
 

Just be careful try not to put everything in onStart, and always account for the worst case scenario e.g. dialogue is open, which doesn’t let you open settings tab. I personally try getWidgets().closeOpenInterface(); before even touching settings, and in some cases I walk to my current tile just to cancel anything including selected items etc. Maybe am just paranoid :doge: 

This is taking longer than I'd like to admit...

 

This is what I currently have:

RNBgLXVeToO-mf-NB_TUTg.png

My client still seems to get stuck on setWorldSwitcherConfirmation. It selects the Warnings tab, but doesn't scroll or select the setting to change. It's just stuck there.

Streamable link: https://streamable.com/w6x6s8

As Khal said, it should be done every loop. Since this is stuck in place, it can't be a timeout issue right?

Edited by aylsero
Link to comment
Share on other sites

I don't think you need to put it in onloop. But you do need to space out the setting changes as they cannot all resolve in one pass.
Have you tried doing one then sleeping?
 

setHideRoofs()
sleep(1000)
setWorldSwitch()
sleep(1000)
...


Putting them all in onloop means those conditions need to be checked over the script's run session to only run once, minimal impact sure but avoidable nonetheless.  

Link to comment
Share on other sites

2 hours ago, yfoo said:

I don't think you need to put it in onloop. But you do need to space out the setting changes as they cannot all resolve in one pass.
Have you tried doing one then sleeping?

setHideRoofs()
sleep(1000)
setWorldSwitch()
sleep(1000)
...


Putting them all in onloop means those conditions need to be checked over the script's run session to only run once, minimal impact sure but avoidable nonetheless.  

I did do that yes but it didn't work at the time as my grammar was wrong.

31m7d9aDSoipxS0m7Ei7TQ.png

It probably would work, however I've already got it implemented now.

Thank you regardless 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...