Skip to content

Tool for zapping youself while playing games with death counter for live streaming.

Notifications You must be signed in to change notification settings

kubagp1/sekiro40v

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sekiro40v

Sekiro40v is a tool with two components. One part is a C# program installed on your computer, which detects in-game damage and deaths. It has a GUI for adjusting settings, which are saved in JSON files. It also tracks various statistics. The other part is on an Arduino-like device, such as a Raspberry Pi Pico, and it receives commands from the PC to control a shock collar. The tool was initially created for Sekiro™: Shadows Die Twice, hence its name.

Here's a more streamlined version of the instructions:

Getting Started

  1. Download the latest version of Sekiro40v from the official repository. Ensure you download the Sekiro40v.zip file.
  2. Extract the zip file to a secure location, ensuring all files are copied.
  3. Run Sekiro40v.exe. It will request administrator rights, which you must grant.
  4. If you're using it with Sekiro™: Shadows Die Twice, no further setup is required. For other games, navigate to the MemoryHook tab and update the Process name and Memory offset (more instructions below).
  5. To use the Death Counter, navigate to the Death Counter tab, click Copy URL, and paste it into your streaming software.
  6. Set up your Arduino-like device. This guide assumes you're using a Raspberry Pi Pico.
  7. Install the Arduino IDE. Open it and navigate to Tools -> Board -> Boards Manager. Search for and install your board.
  8. Visit this page and click the highlighted button to copy the raw contents of the file. Alternatively, you can manually copy the entire file.

Github screenshot

Continuing from the previous steps:

  1. Paste the copied content into the Arduino IDE.
  2. If necessary, modify the TX_PIN value. Then, click the Upload button (represented by a right-facing arrow).

Arduino IDE screenshot

  1. Wait some time for the upload to complete.
  2. Connect your RF transmitter to the device using appropriate cables. Connect GND to GND, VCC to VBUS, and ATAD(DATA) to the pin you set as TX_PIN. The default pin is 22.

If you encounter any issues or need further assistance, please open an issue. We can figure it out together :)

Understanding the options

General

General view of Sekiro40v

The WebServer port is the port that the local web server uses to serve the DeathCounter. If you change this setting, remember to update it wherever you're displaying the counter (e.g. OBS).

MemoryHook and PainSender integration section

The settings under the MemoryHook and PainSender integration section determine the shock settings (if any) to be used when in-game damage or death is detected.

  • Scale strength: The shock duration remains constant, but the strength varies based on the formula (damage taken / max HP) * max strength. For instance, if you have full HP (320 points) and take 32 points of damage, with a max shock strength set to 50 and a shock duration of 1000 ms, you would receive a shock of strength 5 for 1 second.
  • Scale duration: The shock strength remains constant, but the duration varies based on the damage received.
  • Scale both: Both the strength and duration of the shock vary based on the damage received.
  • Static both: Both the strength and duration of the shock remain constant, regardless of the damage received.

You can disable the shock on damage entirely by unchecking the Shock on damage checkbox. Similarly, you can disable the shock on death by unchecking the Shock on death checkbox.

The remaining buttons and options are fairly self-explanatory. However, if you have any questions or need further clarification, feel free to open an issue. I'm here to help! :)

MemoryHook

MemoryHook view of Sekiro40v

The MemoryHook section is dedicated to the settings related to reading the game's memory.

  • Process name: This is the name of the game process, which can be found in the Task Manager. The ".exe" extension is not required.
  • Max. reads per second: This setting determines how often MemoryHook should read the game's memory to detect damage. The minimum value is 1.
  • Memory offset: This is the location in the game's memory where your HP is stored. You can determine this using software like Cheat Engine. This is a "relative" address, meaning the base address is added automatically. If you need help finding this for your game, feel free to open an issue.

Here is a tutorial for Cheat Engine: https://book.hacktricks.xyz/reversing/reversing-tools-basic-methods/cheat-engine

The different statuses are as follows:

  • Searching: The program is looking for the process with the name you specified.
  • Ready: MemoryHook is attached to the process and scanning.
  • Starting: If you see this status, something isn't working. Please open an issue.

Note that you can manually change the Max. HP. MemoryHook will update it if it goes higher, but not lower.

If you die in the game, only the death event is triggered, not the damage event.

The rest of the statistics and statuses are fairly self-explanatory. However, if you have any questions or need further clarification, feel free to open an issue. I'm here to help! :)

DeathCounter

DeathCounter view of Sekiro40v

The DeathCounter allows you to modify the counter value by clicking the Decrement and Increment buttons, or by typing a number directly into the box. The counter also auto-increments each time MemoryHook detects a death.

To use it, copy the URL using the button in the bottom-right corner, then paste it into your browser or OBS. For OBS, it's recommended to make the display wider than it is tall, as the numbers try to fill all vertical space. If you want to change the default look, you can modify it directly on this tab and view the results in your browser or OBS without needing to refresh or save.

If you want to replace the displayed image, you need to replace the webserver_static/counter/image.png file. The webserver_static folder is located next to the sekiro40v.exe file. The file must have the exact name and extension (unless you want to edit the .html files also located there). The final step is to restart Sekiro40v and refresh your browser or OBS widget.

If you have any questions or need further clarification, feel free to open an issue. I'm here to help! :)

PainSender

PainSender view of Sekiro40v

The PainSender is tasked with establishing a connection to your Arduino-like device and transmitting simple commands.

Identifying Your Arduino-like Device

You have three options:

  1. (Recomended) Disconnect your Arduino-like device, click Refresh list, and note the listed devices. Reconnect your device, click Refresh List again, and identify the newly listed device.
  2. Navigate to Device Manager -> Ports (LPT and COM) -> USB Serial Device -> Properties -> Details -> Device description as reported by the bus. Check if the name matches your device and repeat for each device.
  3. Try each device randomly.

The Pair with collar button sends a request to the device to deliver a shock with a strength of 0 and a duration of 1000 ms. You can test the shocking functionality in the Testing section.

If there's anything else you'd like me to explain, feel free to open an issue. I'm here to help! :)

Troubleshooting

If Sekiro40v isn't working as expected, here are some steps you can take:

  • Ensure the application is launched as Administrator.
  • Try removing the settings.json and/or statistics.json files.
  • Download the latest version of the software.
  • Reflash your Arduino-like device.
  • Reconnect your Arduino-like device and RF transmitter.
  • Check that the batteries in the collar are charged.
  • Connect the Arduino-like device to a different USB port, preferably one with the highest power output.
  • Change the WebServer port.
  • Restart your PC, game, and Sekiro40v. In fact, try restarting everything!

If these steps don't resolve the issue, please open an issue.

Electric Collar

Picture of Petrainer shock collar

The script for the Arduino-like device is designed for the Petrainer PET998D collar. The communication part of the script was adapted from this source. You can find more information about how it works here. Another useful resource for "toy" communication protocols can be found here. Feel free to fork this project or make a pull request for other collars and devices.

Hidden Features

  • Clicking on the label in the bottom-left corner opens this site.
  • If you send a shock request before the last one has finished, the new one takes priority if it's longer than what's left of the old one.

Contributions

If you know how to generate .ef2 files for RP2040 (Pico) from Arduino IDE, your help would be appreciated. Suggestions, bug reports, and corrections are also welcome. This is my first C# project.