2024-05-21 17:19:58 (edited by Zarvox 2024-05-23 13:44:56)

A few years ago I created a program with a GUI to automatically do the ufo catcher. Now I decided to build this small addon for the bk series, just for something to do. It does the following:

  • Solves number puzzles and passwords.

  • Allows for holding down the “z” key in bk 2 so you can walk faster with just the arrows.

  • Supports spamming the enter key to automatically collect and interact.

I’ll share both.

nvda addon

ufo catcher spammer

2024-05-21 17:27:19

nice, I found a working link for the UFO catcher script. thx.

2024-05-21 18:30:36

Should I use both or they are the same but one is for NVDA and one is stand alone version?

2024-05-21 19:04:18

The ufo catcher is stand alone. For some reason, NVDA doesn’t like the keyboard library that I use, so if I want to do arrow movement, I have to disable the scr. Not sure if it behaves the same way with other scr, but because of this, the ufo catcher wouldn’t work inside of an addon. But also I wanted people who don’t have NVDA active to have access to the utility.
Really the only thing that requires an addon is the number puzzles, and even then you can have it type the answer on command when you need it. But doing it in an addon is much easier.
If people would rather have this as  an application rather than an addon, I can try doing that, as well as adding the ufo catcher into the same app. But I’d want to recode the catcher from scratch.
I thought about doing a hybrid approach, using NVDA to complement an application. This way you can do it without the scr; and with the scr as a helper to do automatic string detection and things like that. But for now this is good enough adn I’m happy with hte code.

2024-05-21 19:51:57

Thank you for those utilities, really appreciate it

2024-05-21 20:01:45

Version 1.1 adds language switching support for bk 2 variants. Updated link in post 1.

2024-05-21 20:57:42

Nice. Now all we need is a feature to automatically cheat certain weapons/items which the user does not already have and therefore cannot simply modify the value of in cheat engine. I believe this is technically already doable from cheat engine itself, but I’ve yet to hear anyone provide a half coherent explanation on how it’s actually done.

2024-05-21 21:33:07

I'll tell you how I do it.
first, let's say that you have 10 clubs.
you open the process for bk 3, go to 4 bites, type 10, scan, throw a club, scan, tipe 9, scan until youhave one value.
now, add that value to the address list.
now, you can ignore everhing accept the last 3 or 4 values.

for example, let's say that the 4values from left to right are
1 3 5 c
before we get to cheeting, you need to know that the last value can be 0, 4, 8 and c, and represents one slot. the other values can be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f
if you get to c, you will need to increase the value left of it by 1, and then set the last value to 0 to change the next slot, because if the value remanes at c, you will change the forth or fith slot, not the next one.
let's say you want to cheat in the short sword. now that you know that the last 4 values are 1 3 5 c, you will need to increase 5 to 6, and set c to 0, because if you don't, you will be cheating in the plate launcher or the long sword, I don't remember.
here's one more example.

you have the needle launcher 10, but you want to cheat in 9.
the last values will be

4 9 5 0
the needel launcher 9 is one slot above the needle launcher 10. to cheat it in, you will need to replace 5 with a 4, and change the 0 to a c to cheat in the launcher, because if 0 isn't changed you will chea tin the 6th launcher because that's 4 slots above the launcher 10.
I hope this post doesn't sound like you're incompetent, but I feel like 2 examples are neaded.

2024-05-21 23:31:57

@8, thanks. I feel like I could eventually get the hang of this, but I do have one further question. What if I want to give myself a hole new weapon I did not previously have and which I cannot obtain at the current stage of the game, for instance the water master? In the past I got around this by loading my save into an older version which was hosted on Yukio's site back in the day, getting the water master and then loading it back into the regular program again, but no can do these days since the regular version hosted on his site is too new, and the version on the audiogames archive is too old.

As a side note, have you ever been able to get unavailable weapons like the psycho injector to work? I feel like I remember stories of people doing that or similar things before, but I may be misremembering.

2024-05-21 23:33:19

I understood nothing from that, I’m sorry ;-)

---
You know how people have creative signatures based on their rank?
Yeah, I’m too lazy for that, you get to see this for now, while I’m thinking.

2024-05-22 00:52:15

My friend has a super old save of bk 3 or bk 3 chaos with an item called enemy analyzer. It displays the hp value instead of percentage.

2024-05-22 02:45:49 (edited by nyanchan 2024-05-22 02:48:06)

Psycho injector doesn't work due to a simple fact: not implemented.

I don't speak as good as I write, and I don't listen as good as I speak.

2024-05-22 07:37:54

at 9, you do the same thing, but change the 60th, or maybe 70th value, maybe more. I forgot to tell you that when you change the address, you need to increase it's value because it's 0.
also, you can get the enemy analyzer through cheating by doing this, it's slot is 5, 6, above the last collection item you can get without cheating, I think that's the mysterious water pot. at 10, then ask an AI to help you, I can't explain it any better.
one more thing is that this method works for collection items, items shields , etc, and works for every game where an item has it's own slot, for  example the text games.

2024-05-23 00:18:44

This is off topic. I just figured out how to bypass the NVDA arrow keys restriction, but it’s not great. The keyboard library sends numpad commands instead of arrow keys to the scr. If you disable the handle keys from other applications option, it will send as normal arrows. However since they are no longer being handled by nvda, browse mode won’t move the scr cursor at all, and focus mode does move  the system carrot but the new position is not spoken.
Also this library apparently doesn’t like applications with angelscript. So that means all bgt games or nvgt games can not have arrow key simulation. This isn’t related to NVDA, it just doesn’t work at all. What a shame; there goes lazy party using arrow keys, unless I want to switch to another library that angelscript likes.
The bk series does work, I already tested it. This means instead of disabling nvda in the ufo catcher, I could have it just turn off that setting and back on instead. Or I could build the ufo catcher into the addon and silence the speech from menu to prevent spam. I can also just disable that setting while the bk window is active and enable it again when inactive.

2024-05-23 07:21:23

Hi. Just tested both utilities. Regarding the ufo catcher, it works well, but I've got a question. At which point should I be when starting the program in order to efficiently use all cycles? I mean, should I just go to the shop menu with the ufo catcher or maybe start the ufo machine for the first time? Regarding the BK helper, you should mention in the addon help that in BK2, before getting to a password field, you need to make sure that running with only arrow keys is disabled, otherwise the letter Z is being written as soon as you enter the field.
Other than that, you did an excellent work, keep it up.

2024-05-23 08:55:05

This is completely off topic, but @15, is your username a reference to doctor who by any chance? If so, then I admire your taste. That's wonderfully obscure.

2024-05-23 08:55:12

I didn’t test it with holding z, so didn’t know that bug existed, but the thought did cross my mind. Thanks for that. What I could do is have that gesture activate the enter key so the user can press it before entering the password and it can automatically deactivate and reactive the z key if it was held down before. Stage 23-1 wouldn’t be an issue either since pressing enter in a password field does nothing, but knowing me I’ll probably add a check for it anyway to make sure it only presses enter for the first password. Hell I might just have it wait out some timers and type all the passwords at once. If I make an options panel, that will be an option. But i think for now I’d have that enabled by default.

As for your question. Yes make sure you are in the shop menu already. It will go to the end of the menu, so you don’t need to be placed on a specific item. The ufo catcher window should be right next to the bk window because it will alt tab after disabling nvda. Unfortunately that version doesn’t allow you to adjust timers, so it might move too fast in some cases. Years ago i rewrote the program and never released that version. But honestly it was really confusing to know what the options meant, even for me, not to mention the code.
And no I can’t release that newer version anymore anyway because the code is so broken that as soon as you do anything it crashes. If people really like that utility and it is giving them problems, I can rewrite it in wx or something. But if it ain’t broke, don’t fix it.

2024-05-23 09:03:53

Can I suggest something. When we go to either 18.2 or 3 I forgot which one was it. The level that has secrets that items fall continuously. It is 35 tiles wide and we have to move left and right continuously. so if your add-on or application does something like that it will be amazing. Because if more than 178 items fall the number won't increase it will stay 178 or so. so you either have to go left or right so that you pick up items. This is just a suggestion. And thank you anyways

2024-05-23 13:39:09 (edited by Zarvox 2024-05-23 13:48:06)

Post 1 is updated with the link to 1.2. Please read the readme in full for greater detail.
Just like with enter, press control + Q to spam the space bar.
Added options for pressing enter before and after the password to interact with the door.
Walking and spamming cheats are disabled while entering a password, but it might still press z in the beginning if you don’t have before password enabled.
Stage 23-1 in bk 2 has an option to enter all passwords at once or just one at a time.
Since passwords and number puzzles are done, I’d like to gather some ideas of what to do next. I remember most of the puzzles in bk2 and 3, mostly 3. But apart from puzzles, what lse can we do with this?
The last post had an idea that isn’t a puzzle but still something that I could do. Bk 3 has mini games and extra stuff, so maybe I can do something with that.

2024-05-24 04:40:51

Hello
Exactly how do I use the NVDA Addon? I cannot find any settings in the NVDA Application to use the addon.

Phoenix

2024-05-24 06:58:46

Read the documentation from the addon store.

2024-05-24 07:23:54

@16 It's rather a reference to my first name, which is Marek. During my childhoot, I've been using more obvious nicknames for other platforms, like marek11, mareku and later marmarmar. Now I think mara suits me the best, but I'm marmarmar on Quentin C's playroom.

2024-05-24 22:05:47

Hi, just tested the new features. Great work, there's just one minor bug. The Initiate PW option doesn't work when entering the second password in 20-1 in BK2, meaning you still have to press enter manually to get to the password field before hitting ctrl+p. Also, when I first saw the "Puzzles" group, I thought this was referring to the puzzle at 23-3. If you've got knowledge about coding input boxes and validating input, I've got an idea on how to implement this:
1. The player needs to figure out the answer number to the puzzle. This can be done easily by selecting the first two numbers and validating them. Assuming the level doesn't finish immediately, the player should then sum up the first two numbers and the difference given. For example, if the first numbers were 8 and 12, which add up to 20 and the difference is 102, the answer is 122. The player should then unselect the numbers and be focused on the second number from left to right.
2. The player should press ctrl+p, making sure the puzzle category is selected. An input box should appear, where the player should input the answer number noted earlier.
3. The addon should then press the left arrow to read the first number, then right arrow to read the remaining numbers. These numbers should be stored in an array.
4. The addon should focus the first number again by pressing left arrow 11 times, then start working.
5. Make a loop that enumerates all the possible combinations of 2 numbers and sums them up. The loop should stop as soon as the answer number is found.
6. The addon should focus and select the appropriate numbers and hit enter to finish the level, assuming everything works correctly. If a solution cannot be found either because the puzzle is unsolvable (this should no longer be the case as of the most recent BK2 update) or the player entered the wrong answer number, they should be informed accordingly.

If you decide to implement this, then happy coding.

2024-05-24 23:29:50

The puzzles group is going to refer to any other puzzle. For example the screens in bk 3 where you turn it to the correct option. The number matching puzzles you described. And something like the puzzle for 24-3 in bk 3. As far as I remember, there isn’t any level that has 2 different types of puzzles, and even if there is, that shouldn’t be a problem. So I figured they could all go into the same category of misc. None of this is official yet since no other puzzles have been coded. So if you have a better way of categorizing these let me know. Also I have to somehow make the addon compatible with the number matching puzzles mini game in bk 3. Not sure if it has the exact same intro as puzzles found when playing in a level, so it can be triggered the same way.
Re: initiate pw bug. The code for passwords is quite confusing now, but I know what the issue is. It only presses enter for the first password in the level. How did I miss that? Well honestly I figured this might happen and if so someone could let me know lol. When you have a web of options like this it is hard to test all scenarios. I’ll fix that, shouldn’t be too difficult.
Regarding the number matching puzzle, honestly I was going to have it try every combination without optimization. I never payed attention to what to do for it, I just selected 2 numbers and kept going until it finished. I can certainly try your optimization method, thanks for the outline. If I understood this correctly, the addon can log all the necessary variables via speech without the user needing to input information.

2024-05-24 23:53:55

Ahahahahahahahaha. I just found out why that bug exists. I forgot to put the word not, so it checked if multi password was enabled instead of disabled. My objective was to prevent it from pressing enter when not necessary and it ended up doing the opposite! Ahahahahahaha. Well that was fun.