masterking32 / MasterHamsterKombatBot

Master Hamster Kombat Bot is a Python-based automation tool specifically designed for the game Hamster Kombat. This bot is capable of performing all in-game tasks, including auto-tapping, cipher tasks, and purchasing the best cards on your behalf. It's a free and fully automated farming bot that enhances your Hamster Kombat gaming experience.
https://github.com/masterking32/MasterCryptoFarmBot
Apache License 2.0
281 stars 90 forks source link

Option for script to use our own keys #233

Closed CipherVasat closed 2 months ago

CipherVasat commented 2 months ago

so i have a lot of keys which is hard to add them in game 1 by one can u add a option to bulk add keys with script?

Fy0urM commented 2 months ago

you can throw these keys in the trash, the bot gets keys for games by itself, using third-party keys makes no sense.

CipherVasat commented 2 months ago

the problem is bot is giving me error [Master HamsterKombat Bot][ERROR] 2024-08-26 14:39:51 [Main] Status code is not 200 [Master HamsterKombat Bot][ERROR] 2024-08-26 14:39:51 [Main] Response: {"error_code":"TooManyIpRequest","error_message":"Too many login attempts from single ip"} [Master HamsterKombat Bot][ERROR] 2024-08-26 14:39:52 [Main] Unable to get Mud Racing key. [Master HamsterKombat Bot][INFO] 2024-08-26 14:39:53 [Main] Starting Train Miner Playground game... [Master HamsterKombat Bot][INFO] 2024-08-26 14:39:54 [Main] Getting Train Miner key... [Master HamsterKombat Bot][ERROR] 2024-08-26 14:39:55 [Main] Status code is not 200 [Master HamsterKombat Bot][ERROR] 2024-08-26 14:39:55 [Main] Response: {"error_code":"TooManyIpRequest","error_message":"Too many login attempts from single ip"} [Master HamsterKombat Bot][ERROR] 2024-08-26 14:39:56 [Main] Unable to get Train Miner key. [Master HamsterKombat Bot][INFO] 2024-08-26 14:39:56 [Main] Starting Twerk Race Playground game... [Master HamsterKombat Bot][INFO] 2024-08-26 14:39:57 [Main] Getting Twerk Race key... [Master HamsterKombat Bot][ERROR] 2024-08-26 14:39:58 [Main] Status code is not 200 [Master HamsterKombat Bot][ERROR] 2024-08-26 14:39:58 [Main] Response: {"error_code":"TooManyIpRequest","error_message":"Too many login attempts from single ip"} [Master HamsterKombat Bot][ERROR] 2024-08-26 14:39:59 [Main] Unable to get Twerk Race key.

which i'd like to use my own keys there are bots out there for free which generate keys at a very fast rate

Fy0urM commented 2 months ago

{"error_code":"TooManyIpRequest","error_message":"Too many login attempts from single ip"}

The reason for this can be seen with the naked eye, most likely you have reduced the timings in the settings, which causes ip blocking due to api rate limitation. what is the point of using bots for “very fast” key generation if you only need 4 keys per day per game

Fy0urM commented 2 months ago

or, if you have not changed the timings in the settings this error may be because you are running multiple instances of the bot but have not configured a proxy for each account and multiple accounts are making requests from 1 of your real ip addresses.

CipherVasat commented 2 months ago

changing ip address seems to fix the issue yet can i know what exaclt is happening here? is it trying to mimic the action of playing the real game? if yes how and where to change it to decrease the time

[Main] Registering event for Bike Ride 3D in Hamster FAM (This may take a while ~5-20 minutes)...

Fy0urM commented 2 months ago

changing ip address seems to fix the issue yet can i know what exaclt is happening here? is it trying to mimic the action of playing the real game? if yes how and where to change it to decrease the time

[Main] Registering event for Bike Ride 3D in Hamster FAM (This may take a while ~5-20 minutes)...

Yes, the bot tries to repeat web requests like a real game. why do you want to reduce timings? Reducing timings will lead either to unnatural suspicious activity when receiving the key, or another blocking, by the way it is not big, about 30-40 seconds in my tests, but I did not spam a lot of requests.

CipherVasat commented 2 months ago

13 mins passed and still stucked here that's why i want to know a way to either use my own keys so bot can buld add them or remove this mimic function, tnx for help in advance

Fy0urM commented 2 months ago

13 mins passed and still stucked here that's why i want to know a way to either use my own keys so bot can buld add them or remove this mimic function, tnx for help in advance

just wait until at least one cycle is over and don't panic, the bot doesn't hang, it just repeats requests to the server after the message This may take a while ~5-20 minutes without logging. it's just that the key is received not just on request, a real game sends a certain number of requests to the api before it will be given the key, and the bot does the same thing, just it's not logged most likely not to clog the console. if you know a little about the code you can study it and understand how everything works somewhere in this area https://github.com/masterking32/MasterHamsterKombatBot/blob/6323c888a0e00165f1dcd1fc7d367d813b

Fy0urM commented 2 months ago

if you want to see the activity while getting the key, you can find this code in main.py

            if response is None or not isinstance(response, dict):
                time.sleep(promoData["retry_delay"] + random.randint(1, 5))
                continue

            if not response.get("hasCode", False):
                time.sleep(promoData["retry_delay"] + random.randint(1, 5))
                continue

and replace it with this

            if response is None or not isinstance(response, dict):
                timeout = promoData["retry_delay"] + random.randint(1, 5)
                log.warning(f"[{self.account_name}] Event registration for {promoData['name']} failed, try again in {timeout} sec.")
                time.sleep(timeout)
                continue

            if not response.get("hasCode", False):
                timeout = promoData["retry_delay"] + random.randint(1, 5)
                log.warning(f"[{self.account_name}] Event registration for {promoData['name']} failed, try again in {timeout} sec.")
                time.sleep(timeout)
                continue

like I did, and you'll see the activity. the very construction of the message may not be quite correct, but it is clear to me. you can change the message to make it clearer to you.

Fy0urM commented 2 months ago

but either way, it's at your own risk.))

CipherVasat commented 2 months ago

yeah already ran the virus total, torjan kid.... ok so now can u help me with 2 things?

  1. [Master HamsterKombat Bot][WARNING] 2024-08-26 15:56:59 [Main] Event registration for Chain Cube 2024 failed, try again in 23 sec. how to reduce this timer
  2. [Master HamsterKombat Bot][INFO] 2024-08-26 15:56:33 [Main] Waiting for 23 seconds... how to reduce this timer

this will mostly solve my issue couse my net is unstable reducing timer can incresae my success rate. tnx

CipherVasat commented 2 months ago

timeout = promoData["retry_delay"] + random.randint(1, 5)

i believe it must be this line of code for the first matter yet i dont know where retry_delay is called from

Fy0urM commented 2 months ago
  1. [Master HamsterKombat Bot][WARNING] 2024-08-26 15:56:59 [Main] Event registration for Chain Cube 2024 failed, try again in 23 sec.

I will repeat, the message is constructed by me incorrectly. it is not an error message as such, but a message that you do not want to issue the code yet, to get the code you need to send a certain number of requests after which the promo api will provide the code for you to use.

Fy0urM commented 2 months ago

retry_delay

It is stored in promogames.py and is mostly individual for each game. I would not recommend reducing this value below 20-30.

Fy0urM commented 2 months ago
  1. [Master HamsterKombat Bot][WARNING] 2024-08-26 15:56:59 [Main] Event registration for Chain Cube 2024 failed, try again in 23 sec.

Once again, this is not an error message, it means that promo api will not give you the code at the moment. for each game the number of requests to get the key is individual, for some games give the key from the first request for some with 16

CipherVasat commented 2 months ago

i underestood very well thank to ur explanations i underestand the risks too, my probem is now fixed