jawikas / hamsterkombat

This is a bot that can help you to run hamsterkombat telegram bot which has quite complete features with auto upgrade (3 methods), auto complete combo & auto complete daily cipher/morse.
https://t.me/hamster_kombat_Bot/start?startapp=kentId1323733375
68 stars 24 forks source link

minigame #8

Open Pawansingh333 opened 1 month ago

Pawansingh333 commented 1 month ago

please add minigame auto solver

Timokaproka commented 1 month ago

Hello, while this function is not in the program, I suggest using my script. All you need to do is log into Hamster Kombat via a browser on your PC and get the authorization header. I am attaching a video tutorial on how to use my script. Link to the script: https://gist.github.com/Timokaproka/b9d9497a4618f7d658c3e0a564f4de51 Link to the guide: https://youtu.be/qyK_SbYjS3M

LiFeAiR commented 1 week ago
def _get_mini_game_cipher(self, mini_game: dict, one_point=False) -> str:
        minigame_cipher = ''
        try:
            if one_point:
                max_points = 1
            else:
                max_points = mini_game.get('maxPoints', 0)

            mini_game_id = mini_game.get('id')
            start_date = mini_game.get('startDate')
            user_id = self._get_telegram_user_id()

            unix_start_date = int(datetime.fromisoformat(start_date.replace("Z", "+00:00")).timestamp())
            number_len = len(str(unix_start_date))
            index = (unix_start_date % (number_len - 2)) + 1
            score_per_game = {"Candles": 500, "Tiles": random.randint(int(max_points * 0.1), max_points) if max_points > 200 else max_points}
            score = str(2 * (unix_start_date + score_per_game[mini_game_id]))

            cipher = ""
            for i in range(1, number_len + 1):
                if i == index:
                    cipher += "0"
                else:
                    cipher += str(randint(0, 9))

            sig = base64.b64encode(hashlib.sha256(f"{get_salt('salt_')}{score}{get_salt('_salt')}".encode()).digest()).decode()

            cipher_string = "|".join([cipher, user_id, mini_game_id, score, sig])
            minigame_cipher = base64.b64encode(cipher_string.encode()).decode()
            return minigame_cipher

https://github.com/OxFF00FF/Hamster_Mayhem/blob/master/Src/salt.json