Home - RSKrakenCommunity/CommunityAPI GitHub Wiki

Alt Text Alt Text

# Project Setup

Kraken Community uses Gradle as a dependency framework. The Kraken Community has developed a Gradle plugin to ease the development of Kraken Scripts.

Setting up the Kraken Gradle Plugin

Within the settings.gradle declare the plugin management DSL and add the respected repositories and resolution strategies as shown

Kotlin Script

pluginManagement {
    repositories {
        gradlePluginPortal()
        maven("https://jitpack.io")
    }
    resolutionStrategy {
        eachPlugin {
            if(this.requested.id.id == "kraken.community.plugin") {
                useModule("com.github.RSKrakenCommunity:Kraken-Gradle-Plugin:master-SNAPSHOT")
            }
        }
    }
}

rootProject.name = "KrakenExampleBot"

Groovy Script

pluginManagement {
    repositories {
        gradlePluginPortal()
        maven {
            url 'https://jitpack.io'
        }
    }
    resolutionStrategy {
        eachPlugin {
            if(requested.id.id == 'kraken.community.plugin') {
                useModule('com.github.RSKrakenCommunity:Kraken-Gradle-Plugin:master-SNAPSHOT')
            }
        }
    }
}

rootProject.name = 'GroovyKrakenExample'

Configuring Kraken

Within the build.gradle declare the plugin in the plugins DSL

Kotlin Script

plugins {
    //other plugins
    id("kraken.community.plugin")
    //other plugins
}

Groovy Script

plugins {
    ...
    id 'kraken.community.plugin'
    ...
}

Configuring Kraken Plugin

The Kraken Community Gradle plugin eases the development of Kraken Scripts by automating common tasks such as generating the plugins.ini file and copying your compiled jar to the Kraken Plugin Directory.

Kraken Modules

  • kraken-api - Provides Krakens' default API
  • community-api - Provides the Community API
  • imgui - Provides the Community Wrapper for Krakens' ImGui API
  • filesystem - Provides a way to read from the rs3 game cache
  • definitions - Provides a way to read rs3 game definitions which are stored in the rs3 game cache
  • utilities - Provides Utilities for development of kraken scripts

Kraken Plugin DSL

The Kraken Plugin DSL is used to configure the automation of tasks.

Kotlin Script

kraken {
    pluginClass.set("com.rshub.example.ExampleBot")
    krakenPluginLocation.set("C:\\Users\\bob\\OneDrive\\Documents\\Kraken")
    modules("kraken-api")
}

Groovy Script

kraken {
    pluginClass = 'com.rshub.example.ExampleBot'
    krakenPluginLocation = 'C:\\Users\\bob\\OneDrive\\Documents\\Kraken'
    modules('kraken-api')
}

SDN Plugins

The Kraken Community Gradle Plugin supports setting up of SDN plugins by providing a configuration to use the Kraken Stub.

Warning: The Community API does not support the SDN yet, in order to write scripts for the SDN you cannot use any other modules.

Kotlin Script

kraken {
    //Other configurations
    setSDNPlugin(true)
    //Other configurations
}

Groovy Script

kraken {
    //Other configurations
    setSDNPlugin(true)
    //Other configurations
}
⚠️ **GitHub.com Fallback** ⚠️