My Pokemon shiny raid seed checker https://cute.berichan.net/ which is essentially a dudu bot clone runs on a Raspberry Pi 4 so I thought I'd write down how I compiled an arm-64 optimized version of SysBot.NET/Pokemon.
This guide assumes you have a working and 64-bit compatible Raspberry Pi with the 64-bit version of Raspbian installed and have at least a basic understanding of how to use Raspbian/Linux. If you can't get this set up, you should ask for help in the official Raspberry Pi forums. Note, the 64-bit OS is only installable on the Pi 3 and Pi 4 (and onwards) devices. 32-bit compilation (not covered) is easier but significantly slower for a variety of things SysBot.NET uses, so I don't recommend it.
Make sure your pi is up-to-date by running sudo apt-get update
then sudo apt-get dist-upgrade
.
Note, This guide also assumes you have already used (with success) SysBot.NET at least once and are able to copy over your config.json from the Windows application. We will only be compiling the Console Application where you get no control to run as an "always on" bot.
You will need to install the following development tools and runtimes:
- You should have the lastest version of Visual Studio and the .NET Core SDK installed on your desktop where you will be compiling SysBot.NET.
- You will also need the
ARM64
runtime (or instead, I recommend to install the SDK) of .NET Core installed on your Raspberry Pi. At the time of writing, this is dotnet7.0 but will eventually change. - You will need Python installed on your desktop (with unchanged/correct environment variables)
These all have a significant number of guides on the internet so won't be covered here.
- Download and unzip the SysBot.NET source
- Download and unzip the latest version of Z3
- In the SysBot.NET-master folder, open SysBot.Net.sln with Visual Studio.
- Click on the SysBot.Pokemon.Z3 project to open SysBot.Pokemon.Z3.csproj, or alternatively search for this file in your file explorer and open it with whatever IDE you'd like, or even notepad.
- Delete everything between the
<Choose> ... </Choose>
tags, including the tags themselves. These are the Z3 libs that only work with intel CPUs, we'll be compiling Z3 for dotnet-safe execution. - Open a command prompt window. On Windows this is cmd and on Mac this is terminal, unless you are using another CLI.
- cd to wherever you've downloaded and unzipped Z3. On my device, I entered
cd C:\Users\Berichan\Downloads\z3-master
but this will be different for you unless you are also berichan. - Run
python scripts\mk_make.py --dotnet
or*path/to/python.exe* scripts\mk_make.py --dotnet
depending on how you've set up python. Wait for it to generate the makefile. - The output window will end with something like this.
To build Z3, open a [Visual Studio Command Prompt], then type 'cd C:\Users\Berichan\Downloads\z3-master\build && nmake'
- Go back to Visual Studio, open the Developer CLI by going to Tools > Command Line > Developer Command Prompt and enter the command the Z3 output window asked you to enter. In my case, I entered
cd C:\Users\Berichan\Downloads\z3-master\build && nmake
. Do the next step while you are waiting for Z3 to compile on your desktop.
- Download and install git and Python if you haven't already done so. My Raspbian already had these installed but I don't know if it will change one day.
- Clone the Z3 source to your pi
git clone https://github.com/Z3Prover/z3.git
then cd into the newly made folder where the z3 source resides. - Follow the steps on the Z3 page to compile and install Z3 using gcc (gcc comes with Raspbian but is easily installed with apt if not). Make sure you also run
sudo make install
at the end! It's only 4 commands so I haven't bothered going into detail or copying the guide here.
Building Z3 on your pi will take a while so do the next few steps while this is happening.
- Once Z3 has finished building the dotnet version on your desktop, close the Visual Studio Command Prompt.
- Right-click the SysBot.Pokemon.Z3 project and Select "Manage NuGet Packages"
- In the top-right corner of the NuGet Package Manager, select the gear to open NuGet options, click the green "+" button to add a new package source, click the ... button and select the folder where z3 was built, for me this was
C:\Users\Berichan\Downloads\z3-master\build
then click Update in the options window, followed by OK. - In the NuGet window again, in the top-right dropdown where it says "Package source" select the new Package source we just created (should just be called
Package source
in the dropdown if this in your only one) - Hit Browse in the top left. You should see "Microsoft.Z3", click it, then in the right window hit "Install" and press OK on any warnings.
- Right-click the SysBot.Pokemon.Z3 project and Select "build". It should build the SysBot.Pokemon.Z3 library without any issues.
- Open a command prompt window again and cd to wherever SysBot.Pokemon.ConsoleApp is located. On my pc this is
cd C:\Users\Berichan\Downloads\SysBot.NET-master\SysBot.NET-master\SysBot.Pokemon.ConsoleApp
- Run the following commands:
dotnet clean
followed bydotnet restore
followed bydotnet publish --configuration release --framework net7.0 --runtime linux-arm64
The "net7.0" runtime can be changed if a later version of the SDK has been released and you are using that instead. - Navigate to the newly created publish folder, on my pc this is
C:\Users\Berichan\Downloads\SysBot.NET-master\SysBot.NET-master\SysBot.Pokemon.ConsoleApp\bin\release\net7.0\linux-arm64\publish
- Copy the config.json for your bot(s) setup from your usual SysBot.NET application folder into the publish folder, then copy over the entire publish folder to your Raspberry Pi. I usually use vsftpd to transfer things via ftp to my Pi but do whatever you usually do.
- Open a terminal, cd to wherever your publish folder is located and run
dotnet SysBot.Pokemon.ConsoleApp.dll
. It should now be running!
great! Thank you!! You mention building a 32-bit version of this. I have been attempting this with no luck. Everything works but the seedchecker. Any recommendations/tips?