Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
Oleksandr Nemesh edited this page Apr 18, 2024 · 4 revisions

Welcome to OpenHack API Documentation

Table of Contents

  1. Introduction
  2. Including the API

Introduction

The OpenHack API is a simple way to interact with the OpenHack mod menu. It allows you to create custom menus, check current hack states, and more.

This API may be useful for developers who want to create custom mods that require some form of user interaction and don't wish to create their own implementation. It also may be useful as a way to debug or test your own mods, because you can easily edit your settings using OpenHack GUI system.

Including the API

Geode (Recommended)

There are two ways to include the API in your mod:

  1. Add the API as a dependency in your mod.json file. This way your mod will depend on OpenHack and won't work without it.
  2. Use dynamic symbol loading (comes included with the API) to find the API functions at runtime. This way your mod will work even if OpenHack is not installed.

1. Add as a dependency

To include the API in your mod, add the following to your mod.json (replace '2.2.2' with the latest version):

{
  // Your mod.json content
  // ...
  "dependencies": [
    {
      "id": "prevter.openhack",
      "version": ">=2.2.2",
      "platforms": ["windows"]
    }
  ]
}

2. Use dynamic symbol loading

You can use the API without adding it as a dependency by using dynamic symbol loading.
All you have to do is simply include the header file in your project (if you have Geode CLI installed, it will automatically include the header file for you).

#define OPENHACK_OPTIONAL // This flag will include the API without adding it as a dependency
#include <prevter.openhack/api/openhack.hpp>

Standalone

If you don't want to use Geode, you can download the API header file and include it in your project manually. Then just include it in your project like this:

#define OPENHACK_OPTIONAL // This flag will include the API with dynamic symbol loading
#include "path/to/openhack.hpp"

You can now proceed to the API Reference section to learn about which functions can be used.

Clone this wiki locally