#🔒 Game Music Bot

11 messages · Page 1 of 1 (latest)

high rock
#

Hey there! I was wondering if anyone could help me develop a bot for automating playing a instrument minigame. I've recreated the UI they use in-game with the correct measurements and colors shown in the image.

Gameplay Explanation

You can see that there are 5 snares/strings illustrated each occupying its own key/ letter. These letters will move along the strings starting from left and sliding too the right at a linear speed. When the keys pass the green section the key should be pressed depending on the which line/ letter is passing the green section. If you press it too early or too late it will count as a miss, if you click it at the start or end of the green section it will count as a good or great and when you hit the center it will be considered a perfect.

Keys

As mentioned before there are 5 strings
String 1. W key (requires the player too press W and only occupies the first string).
String 2. A key (requires the player too press A and only occupies the second string).
String 3. S key (requires the player too press S and only occupies the third string).
String 4. D key (requires the player too press D and only occupies the fourth string).
String 5. SPACE key (requires the player too press SPACE and only occupies the fifth string).

String 2 + 3 + 4. Mouse1 + Mouse2 buttons (requires the player too press Mouse1 + Mouse2 at the same time and occupies the second, third and fourth string).

rough runeBOT
#

@high rock

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

high rock
#

Current Code

I've already tried to get this too work myself for quite a while but just feel like I'm not quite experienced enough too figure this out on my own.

Here is the current code I've made over the past two days:

Code Link

This code tracks for each string the exact pixel at where it needs to be changed too black and if it changes too black it triggers the correct key press. This work 50% of the time and misses a lot of them and does not trigger the Mouse1 + Mouse2 most of the time.

End

If anyone knows a better options, I would love too hear your thoughts. And don't be afraid too shoot me a DM for better support!

Thanks a lot in advance!

idle arch
high rock
#

I've looked into it, but it seems too have a worse performance seeing as it needs too sometimes make some fast paste reactions. Otherwise it will just miss the notes. And I had problems with when multiple notes where visible at the same time that it kept checking the X cords for each one leading in sometimes missing them once they cross the green section leading too a miss. So I'm kinda at a loss here 😅

#

I've already tried too boost performance to do things like check all pixels at once and use the win32API instead of something like Keyboard but it still has around a loop time of 0.15 give or take 0.03 seconds which is for some reason too slow, or the pixel check is faulty and it just doesn't register the pixel turned black. Already checked by changing from pixel_values[(610, 935)] == 0 too pixel_values[(610, 935)] <= 3 but that didn't seem too make a difference.

idle arch
#

Using mss for screenshots will get you more performance, but you might need to do something fairly fancy which can schedule button presses to occur before actually seeing the note be at the target position.

high rock
#

I have already tried "double checking". basically putting notes in a sort of waitlist too be pressed and skipping the other notes being checked and focusing only on that note, but even then it sometimes acts buggy. Starting too feel like it might be the game messing around? Changing for instance Vsync on completely renders my script useless but when turning it off my script seems too work fine until you played a few songs and it starts to brake even more. No idea if thats a memory leak from my script or the game...

high rock
#

Have been logging the seconds per loop and it seems like sometimes for some reason it goes peaks then settles down and peeks again. I have no idea whats going on xD

--- 0.044390201568603516 seconds ---
--- 0.05330491065979004 seconds ---
--- 0.11827397346496582 seconds ---
--- 0.11604619026184082 seconds ---
--- 0.07856464385986328 seconds ---
--- 0.040817975997924805 seconds ---
--- 0.03954267501831055 seconds ---
--- 0.04685568809509277 seconds ---
--- 0.11852073669433594 seconds ---
--- 0.04512953758239746 seconds ---
--- 0.04957437515258789 seconds ---
--- 0.04497408866882324 seconds ---
--- 0.040051937103271484 seconds ---
--- 0.0413515567779541 seconds ---
--- 0.0410304069519043 seconds ---
--- 0.04303717613220215 seconds ---
--- 0.04179549217224121 seconds ---
--- 0.041040658950805664 seconds ---
--- 0.03603649139404297 seconds ---
--- 0.04247736930847168 seconds ---
--- 0.118522362369433594 seconds ---
--- 0.0371551513671875 seconds ---
--- 0.03807854652404785 seconds ---
--- 0.04555082321166992 seconds ---
--- 0.03603196144104004 seconds ---
--- 0.04158902168273926 seconds ---
--- 0.035533905029296875 seconds ---
--- 0.04154849052429199 seconds ---
--- 0.04163217544555664 seconds ---
--- 0.03854560852050781 seconds ---
--- 0.11852073669433594 seconds ---
--- 0.04295802116394043 seconds ---
--- 0.036530494689941406 seconds ---
--- 0.037554264068603516 seconds ---
--- 0.04461812973022461 seconds ---
--- 0.03836941719055176 seconds ---
--- 0.03895235061645508 seconds ---
--- 0.039862632751464844 seconds ---
--- 0.03854179382324219 seconds ---
--- 0.04555821418762207 seconds ---
--- 0.04453086853027344 seconds ---
--- 0.044539451599121094 seconds ---
--- 0.04220128059387207 seconds ---
--- 0.118632632669433594 seconds ---
--- 0.04103255271911621 seconds ---
--- 0.03764533996582031 seconds ---
rough runeBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.