Code Monkey home page Code Monkey logo

pokebot-bizhawk's Introduction

⚠ This repo is no longer maintained, check out: PokéBot Gen3 for mGBA instead! ⚠

PokéBot for BizHawk

An automated shiny hunting bot for Pokémon Emerald

These scripts are currently being used to complete and stream a Prof. Oak living ✨shiny✨ dex challenge in Pokémon emerald on YouTube and Twitch. Feel free to join the Discord to discuss the stream and get support for this bot.

IMAGE ALT TEXT HERE

Supported games

Ruby Sapphire Emerald FireRed LeafGreen
English
Spanish
German
French
Italian
Japanese

Getting started

For a guide on how to download and run this bot, check out Wiki: Getting started.

Requirements

pokebot-bizhawk's People

Contributors

40cakes avatar alexm96 avatar alexthem8 avatar cvanbeck avatar d1firehail avatar dabomber60 avatar demorck avatar dragoon569 avatar frostedgeulleisia avatar jersh avatar knownteach616 avatar p8wer avatar pedroccrp avatar pekempy avatar vrdiy avatar wyanido avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pokebot-bizhawk's Issues

Unable to locate 'Webview2Loader.dll'

I am uncertain what is going wrong here. I have made certain that the prereqs were installed, as well as made sure everything is up and running as expected.

If im understanding things correctly, its unable to find something called 'WebView2Loader.dll' which i have verified does exist on my PC.

I am on Windows 11 if that matters.

Terminal text follows.


2023-06-01 07:33:50,264 - Running pokebot on Python 3.11
2023-06-01 07:33:50,761 -

Unable to initialize pokebot!
Please confirm that the Lua Console is open in BizHawk, and that it remains open while the bot is active.
It can be opened through 'Tools > Lua Console'.

Starting in dashboard-only mode...

Exception in thread Thread-1 (mem_pollScreenshot):
Traceback (most recent call last):
File "C:\Users\Carl\Desktop\Bizhawk\pokebot-bizhawk\pokebot-bizhawk-main\bot.py", line 191, in mem_pollScreenshot
screenshot = Image.open(io.BytesIO(shmem))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Carl\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\PIL\Image.py", line 3283, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x00000262DED0A390>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 975, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Carl\Desktop\Bizhawk\pokebot-bizhawk\pokebot-bizhawk-main\bot.py", line 195, in mem_pollScreenshot
if screenshot is not None:
^^^^^^^^^^
UnboundLocalError: cannot access local variable 'screenshot' where it is not associated with a value

  • Serving Flask app 'bot'
  • Debug mode: off
    [pywebview] WebView2 initialization failed with exception:
    Unable to load DLL 'WebView2Loader.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2EnvironmentWithOptions(String browserExecutableFolder, String userDataFolder, ICoreWebView2EnvironmentOptions options, ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environment_created_handler)
    at Microsoft.Web.WebView2.Core.CoreWebView2Environment.d__3.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Microsoft.Web.WebView2.WinForms.WebView2.d__25.MoveNext()
    2023-06-01 07:33:56,393 - WebView2 initialization failed with exception:
    Unable to load DLL 'WebView2Loader.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
    at Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateCoreWebView2EnvironmentWithOptions(String browserExecutableFolder, String userDataFolder, ICoreWebView2EnvironmentOptions options, ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler environment_created_handler)
    at Microsoft.Web.WebView2.Core.CoreWebView2Environment.d__3.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Microsoft.Web.WebView2.WinForms.WebView2.d__25.MoveNext()

Pokebot

hello. im all new to this so probably an easy fix but when i start the bot i dont get a dashboard. the window pops up but its completely white

Bug - Recent Encounters item not shown

image

What's the issue
Occasionally during an encounter, a Pokémon can be found holding an item.
This isn't stored in the encounters file correctly, so sometimes the item on Recent Encounters is empty.
Catching the Pokémon confirms that it is holding the item, so Current Encounter is correct

Strangely enough, sometimes it does work as expected, it's just hit and miss whether it will work or not.

Probably need to look into where the current encounter is stored into recent encounters and check the itemName is being passed correctly.

Numel may be a good pokemon to use to investigate as it has 100% chance to hold rawst berry, may be easier to see ones where it's not showing in encounters

Regarding Emerald with patched RNG

I was curious if there's support and or support could be made for Emerald that's been patched with a fix to its RNG?

Basically talking about for example the fixes that can be found here.

The bot is really great after playing with it quite a bit, and it has definitely interested me, but it would be amazing if this could work on Emerald where its RNG is fixed and if there's a particular patch that could work with it. That's because when you are doing anything that isn't a random encounter (static) then it's really not that exciting or as satisfactory as the bot is still effectively abusing the broken RNG by doing frame perfect inputs. It would be really nice to have more consistent randomness while using the bot with Emerald.

It's fine if you wouldn't care to support this, and I still look forward to support for the other generation 3 games that of course do not have broken RNG.

Keep up the great work, though!

pokemon moves index out of range

Exception thrown when accessing
move_list = json.loads(read_file("data/moves.json"))
using move from pokemon["moves"]
sometimes it's randomly a junk value way out of range.

Something Odd with the RNG

Sorry if this is a silly problem, but after I got everything set up and have begun soft resetting for starters, on several occasions I have the bot encountering the same exact pokemon down to the PID a few times. Most of the time it's about 2 of the same in a row, then after a couple encounters it may encounter the exact same one again. Is this just inevitable and unavoidable or am I doing something wrong? it does eventually go on to other PIDs after repeating a few times but I can't help but feel that it's very inefficient to have the bot encounter the same mudkip 3-4 times. Regardless, this bot is awesome

Pokémon Home

Is it safe to transfer Pokémon caught with the bot to home

Bug: bot_mode: fossil

On various speeds (100%,200%,400%) in BizHawk, I kept running into a small issue where the bot would lock up every so often after receiving the Anorith from the fossil. Once it gets to the 'Opening start menu entry: pokemon' entry in the command line, the script will keep mashing the 'B' input, thinking it's still in the dialogue with the researcher NPC / is trying to refuse to nickname the Pokemon.

I've found that pausing the script to manually open the menu and unpausing the script will make it function again, which saves closing and opening a new batch file. The script will then exit the menu and work perfectly fine anywhere between 10 mins to an hour before the process needs repeating.
I've only just tried fossil hunting for shiny Pokemon so I'm not sure if this is just me that this happens to or if it's an issue with the current build.

Unable to get pickup function to work

I have a party with my main pokemon and 5 zigzagoons and the config file threshold is set to the default amount of 2 but the bot wont check the party or take the items

Catch extremely high IV pokemon

If the pokemon's IV total is over 180 (or higher/lower depending on your prefrences) then the bot should try to catch it to preserve the pokemon

I find the stream very interesting, never witnessed a shiny live yet but I ocasionally come and watch it

Starter is selecting wrong pokemon and getting stuck

Sometimes when farming for Mudkip it will select Torchic and get stuck, other times it will select Torchic and battle.

If there are any logs I can provide please point me to them.

I searched the discord and found one other person with this issue but it was fixed. I am using the latest version as of this post

Doesn't appear to work on Linux/Debian

I'm currently unable to get the bot working on Debian 12 with Python 3.11.2 and Bizhawk 2.9.1 (also tested 2.9).

In the git clone'd pokebot directory, I created a virtual environment, then installed the dependencies there:

python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r ./requirements.txt

When I attempt to run the bot in the virtual environment, I get a traceback, with no feedback in the Lua console:

Traceback (most recent call last):
  File "/home/username/Games/Emulation/Emulators/Bots/pokebot-bizhawk/./bot.py", line 8, in <module>
    from modules.Inputs import ReleaseAllInputs, PressButton, WaitFrames
  File "/home/username/Games/Emulation/Emulators/Bots/pokebot-bizhawk/modules/Inputs.py", line 16, in <module>
    input_list_mmap = mmap.mmap(-1, 4096, tagname="bizhawk_input_list-" + config["bot_instance_id"],
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'tagname' is an invalid keyword argument for this function

The Linux version of Bizhawk is installed at /home/username/Games/Emulation/Emulators/Bizhawk (2.9.1), and the bot directory is symlinked in the ./Lua/GBA Bizhawk directory. This error happens regardless of whether or not I try to run the bot in the symlink.
I'm attempting to use the starter script. I haven't tested other scripts yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.