aylsero Posted December 5, 2023 Posted December 5, 2023 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: Any help would be great. Thank you
Khaleesi Posted December 5, 2023 Posted December 5, 2023 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: Any help would be great. Thank you Settings class Example: script.getSettings().setSetting(Settings.AllSettingsTab.DISPLAY, "Hide roofs", true);
aylsero Posted December 5, 2023 Author Posted December 5, 2023 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? 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
Khaleesi Posted December 5, 2023 Posted December 5, 2023 (edited) 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? 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 Edited December 5, 2023 by Khaleesi
Czar Posted December 5, 2023 Posted December 5, 2023 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
aylsero Posted December 5, 2023 Author Posted December 5, 2023 (edited) 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 This is taking longer than I'd like to admit... This is what I currently have: 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 December 5, 2023 by aylsero
aylsero Posted December 5, 2023 Author Posted December 5, 2023 Ahh man.... It was because I had "World switcher confirmation" when it should have been "World Switcher confirmation". The lowercase s on switcher fucked it. I've been on this for about 2 hours.
yfoo Posted December 6, 2023 Posted December 6, 2023 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.
aylsero Posted December 6, 2023 Author Posted December 6, 2023 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. It probably would work, however I've already got it implemented now. Thank you regardless though