MehulKhanna / PokeGrinder

An Auto-Grinding Bot for PokéMeow with Slash Commands! With a free Captcha Solver!
MIT License
12 stars 7 forks source link

issue with starting #63

Closed TestUser5643 closed 3 months ago

TestUser5643 commented 3 months ago

it keeps having errors with the main.py

File "/Users//Documents/GitHub/PokeGrinder/main.py", line 94, in asyncio.run(start()) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users//Documents/GitHub/PokeGrinder/main.py", line 91, in start await asyncio.gather(*[start_bots(token) for token in list(config.keys())[5:]]) File "/Users//Documents/GitHub/PokeGrinder/main.py", line 29, in start_bots or config[token]["HuntingChannel"] == 1


KeyError: 'HuntingChannel'
TestUser5643 commented 3 months ago

@lufy20106 im using your collab now but keep getting this error

2024-04-06 08:59:17 WARNING discord.client PyNaCl is not installed, voice will NOT be supported. Traceback (most recent call last): File "/content/PokeGrinder-hm-/main.py", line 94, in asyncio.run(start()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/content/PokeGrinder-hm-/main.py", line 91, in start await asyncio.gather(*[start_bots(token) for token in list(config.keys())[5:]]) File "/content/PokeGrinder-hm-/main.py", line 29, in start_bots or config[token]["HuntingChannel"] == 0 KeyError: 'HuntingChannel'

This is whats in my main.py

import json import asyncio from time import time from typing import List from datetime import datetime

import discord from discord.ext.commands import Bot

from cogs.fishing import Fishing from cogs.captcha import Captcha from cogs.hunting import Hunting from modules.logging import logger from cogs.startup import Startup, Config

start_time = datetime.now() discord.utils.setup_logging() config = json.load(open("config.json")) bots: List[Bot] = []

async def log_function(): logger(bots, start_time, config["ClearConsole"])

async def start_bots(token: str) -> None: if ( token == "Token Ofc" or config[token]["HuntingChannel"] == 1225988704221270141 and config[token]["FishingChannel"] == 0 ): return

bot = Bot(command_prefix=token)
bot.log = log_function
bot.hunting_status = ""
bot.fishing_status = ""
bot.config = Config(
    config[token]["HuntingChannel"],
    config[token]["FishingChannel"],
    config[token]["ExceptionBalls"],
    config[token]["Balls"],
    config[token]["FishBalls"],
    config[token]["AutoBuy"],
    config[token]["AutoReleaseDuplicates"],
    config["Cooldowns"]["RetryCooldown"],
    config["Cooldowns"]["HuntingCooldown"],
    config["Cooldowns"]["FishingCooldown"],
    config["CaptchaRetries"],
    config["CaptchaSolver"],
    config["SuspicionAvoidance"],
)

(
    bot.encounters,
    bot.catches,
    bot.fish_encounters,
    bot.fish_catches,
    bot.coins_earned,
    bot.duplicates,
    bot.last_hunt,
    bot.last_fish,
    bot.auto_buy_queued,
    bot.limit,
) = (0, 0, 0, 0, 0, 0, time(), time(), False, False)

bots.append(bot)
await bot.add_cog(Startup(bot))

if bot.config.fishing_channel_id != 0:
    bot.fishing_status = "Starting..."
    await bot.log()
    await bot.add_cog(Fishing(bot))
else:
    bot.fishing_status = "Disabled"

if bot.config.hunting_channel_id != 0:
    bot.hunting_status = "Starting..."
    await bot.log()
    await bot.add_cog(Hunting(bot))
else:
    bot.hunting_status = "Disabled"

if bot.config.captcha_solver:
    await bot.add_cog(Captcha(bot))

await bot.start(token=token)

async def start() -> None: await asyncio.gather(*[start_bots(token) for token in list(config.keys())[5:]])

asyncio.run(start())

MehulKhanna commented 3 months ago

@lufy20106 im using your collab now but keep getting this error

2024-04-06 08:59:17 WARNING discord.client PyNaCl is not installed, voice will NOT be supported. Traceback (most recent call last): File "/content/PokeGrinder-hm-/main.py", line 94, in asyncio.run(start()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/content/PokeGrinder-hm-/main.py", line 91, in start await asyncio.gather(*[start_bots(token) for token in list(config.keys())[5:]]) File "/content/PokeGrinder-hm-/main.py", line 29, in start_bots or config[token]["HuntingChannel"] == 0 KeyError: 'HuntingChannel'

This is whats in my main.py

import json import asyncio from time import time from typing import List from datetime import datetime

import discord from discord.ext.commands import Bot

from cogs.fishing import Fishing from cogs.captcha import Captcha from cogs.hunting import Hunting from modules.logging import logger from cogs.startup import Startup, Config

start_time = datetime.now() discord.utils.setup_logging() config = json.load(open("config.json")) bots: List[Bot] = []

async def log_function(): logger(bots, start_time, config["ClearConsole"])

async def start_bots(token: str) -> None: if ( token == "Token Ofc" or config[token]["HuntingChannel"] == 1225988704221270141 and config[token]["FishingChannel"] == 0 ): return

bot = Bot(command_prefix=token)
bot.log = log_function
bot.hunting_status = ""
bot.fishing_status = ""
bot.config = Config(
    config[token]["HuntingChannel"],
    config[token]["FishingChannel"],
    config[token]["ExceptionBalls"],
    config[token]["Balls"],
    config[token]["FishBalls"],
    config[token]["AutoBuy"],
    config[token]["AutoReleaseDuplicates"],
    config["Cooldowns"]["RetryCooldown"],
    config["Cooldowns"]["HuntingCooldown"],
    config["Cooldowns"]["FishingCooldown"],
    config["CaptchaRetries"],
    config["CaptchaSolver"],
    config["SuspicionAvoidance"],
)

(
    bot.encounters,
    bot.catches,
    bot.fish_encounters,
    bot.fish_catches,
    bot.coins_earned,
    bot.duplicates,
    bot.last_hunt,
    bot.last_fish,
    bot.auto_buy_queued,
    bot.limit,
) = (0, 0, 0, 0, 0, 0, time(), time(), False, False)

bots.append(bot)
await bot.add_cog(Startup(bot))

if bot.config.fishing_channel_id != 0:
    bot.fishing_status = "Starting..."
    await bot.log()
    await bot.add_cog(Fishing(bot))
else:
    bot.fishing_status = "Disabled"

if bot.config.hunting_channel_id != 0:
    bot.hunting_status = "Starting..."
    await bot.log()
    await bot.add_cog(Hunting(bot))
else:
    bot.hunting_status = "Disabled"

if bot.config.captcha_solver:
    await bot.add_cog(Captcha(bot))

await bot.start(token=token)

async def start() -> None: await asyncio.gather(*[start_bots(token) for token in list(config.keys())[5:]])

asyncio.run(start())

You don't have to make changes to any file which has ".py" at the end of its name. You have to put your token and channel ids in the "config.json" file.

TestUser5643 commented 3 months ago

alright i fixed the main.py but i still get an error when i run in luffys collab

Traceback (most recent call last): File "/content/PokeGrinder-hm-/main.py", line 94, in asyncio.run(start()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/content/PokeGrinder-hm-/main.py", line 91, in start await asyncio.gather(*[start_bots(token) for token in list(config.keys())[5:]]) File "/content/PokeGrinder-hm-/main.py", line 29, in start_bots or config[token]["HuntingChannel"] == 0 KeyError: 'HuntingChannel'

TestUser5643 commented 3 months ago

2024-04-06 14:56:40 INFO discord.client Logging in using static token. 2024-04-06 14:56:41 INFO discord.utils Info API temporarily down. Falling back to manual retrieval... 2024-04-06 14:56:41 CRITICAL discord.utils Could not retrieve client build number. Falling back to hardcoded value... 2024-04-06 14:56:42 CRITICAL discord.utils Could not retrieve browser version. Falling back to hardcoded value... 2024-04-06 14:56:42 INFO discord.http Found user agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.1 Safari/537.36, build number 9999. Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 1113, in create_connection transport, protocol = await self._create_connection_transport( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 1146, in _create_connection_transport await waiter File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/sslproto.py", line 578, in _on_handshake_complete raise handshake_exc File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/sslproto.py", line 560, in _do_handshake self._sslobj.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 979, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Users//PokeGrinder/main.py", line 94, in asyncio.run(start()) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users//PokeGrinder/main.py", line 91, in start await asyncio.gather(*[start_bots(token) for token in list(config.keys())[5:]]) File "/Users//PokeGrinder/main.py", line 87, in start_bots await bot.start(token=token) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/client.py", line 1025, in start await self.login(token) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/client.py", line 867, in login data = await state.http.static_login(token.strip()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/http.py", line 1058, in static_login data = await self.get_me() ^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/http.py", line 799, in request async with self.session.request(method, url, **kwargs) as response: File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client.py", line 1194, in aenter__ self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client.py", line 578, in _request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 544, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 911, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 1235, in _create_direct_connection raise last_exc File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection transp, proto = await self._wrap_create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/connector.py", line 994, in _wrap_create_connection raise ClientConnectorCertificateError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host discord.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')]

this is the error i get then i run in terminal

MehulKhanna commented 3 months ago

alright i fixed the main.py but i still get an error when i run in luffys collab

Traceback (most recent call last): File "/content/PokeGrinder-hm-/main.py", line 94, in asyncio.run(start()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/content/PokeGrinder-hm-/main.py", line 91, in start await asyncio.gather(*[start_bots(token) for token in list(config.keys())[5:]]) File "/content/PokeGrinder-hm-/main.py", line 29, in start_bots or config[token]["HuntingChannel"] == 0 KeyError: 'HuntingChannel'

Paste your config here

lufy20106 commented 3 months ago

Dude. Why people keep calling me “luffy” There only 1 “f” in my name😔 And again. Config issue

TestUser5643 commented 3 months ago

{ "CaptchaRetries": 3, "ClearConsole": true, "CaptchaSolver": true, "SuspicionAvoidance": 250, "Cooldowns": { "RetryCooldown": 1, "HuntingCooldown": 8.8, "FishingCooldown": 22.4 }, "token ofc": { "HuntingChannel": 1225988704221270141, "FishingChannel": 0, "ExceptionBalls": { "Crystal Onix": "mb" }, "Balls": { "Common": "pb", "Uncommon": "pb", "Rare": "gb", "Super Rare": "ub", "Legendary": "mb", "Shiny": "mb", "Shiny Event": "mb", "Shiny Full-odds": "prb" }, "FishBalls": { "Common": "pb", "Uncommon": "gb", "Rare": "ub", "Super Rare": "ub", "Legendary": "db", "Shiny": "mb", "Golden": "mb" }, "AutoBuy": { "pb": 100, "gb": 50, "ub": 5, "mb": 1 }, "AutoReleaseDuplicates": 100 }, "token ofc": { "HuntingChannel": 1225988704221270141, "FishingChannel": 0, "ExceptionBalls": { "Crystal Onix": "mb" }, "Balls": { "Common": "pb", "Uncommon": "pb", "Rare": "gb", "Super Rare": "ub", "Legendary": "mb", "Shiny": "mb", "Shiny Event": "mb", "Shiny Full-odds": "prb" }, "FishBalls": { "Common": "pb", "Uncommon": "gb", "Rare": "ub", "Super Rare": "ub", "Legendary": "db", "Shiny": "mb", "Golden": "mb" }, "AutoBuy": { "pb": 50, "gb": 25, "ub": 5, "mb": 1 }, "AutoReleaseDuplicates": 100 } }

TestUser5643 commented 3 months ago

ive tried replacing "huntingchannel" with my channel id too and that didnt work either idk whats wrong honestly

TestUser5643 commented 3 months ago

Dude. Why people keep calling me “luffy” There only 1 “f” in my name😔 And again. Config issue

my fault

MehulKhanna commented 3 months ago

Dude. Why people keep calling me “luffy” There only 1 “f” in my name😔 And again. Config issue

my fault

Try

ive tried replacing "huntingchannel" with my channel id too and that didnt work either idk whats wrong honestly

Try using the colab given in this repo

TestUser5643 commented 3 months ago

Dude. Why people keep calling me “luffy” There only 1 “f” in my name😔 And again. Config issue

my fault

Try

ive tried replacing "huntingchannel" with my channel id too and that didnt work either idk whats wrong honestly

Try using the colab given in this repo

I have an the same issue happens

TestUser5643 commented 3 months ago

Dude. Why people keep calling me “luffy” There only 1 “f” in my name😔 And again. Config issue

my fault

Try

ive tried replacing "huntingchannel" with my channel id too and that didnt work either idk whats wrong honestly

Try using the colab given in this repo

i tried again and all of a sudden its working. thank you!!