Skip to content

Vxrpenter/SecretLab-Kotlin

Repository files navigation

cedmod

Secret Lab Kotlin

  

Caution

Not all api endpoints have been implemented yet. Also, many of the already implemented endpoints weren't tested due to it being just too many. If you conduct your own test/find out that some aren't working correctly then create an issue so it can be fixed

Implementation Publish

Gradle:

dependencies {
  implementation("io.github.vxrpenter:secretlab-kotlin:0.4.3")
}

Maven:

<dependency>
    <groupId>io.github.vxrpenter</groupId>
    <artifactId>secretlab-kotlin</artifactId>
    <version>0.4.3</version>
</dependency>

Note that new version releases could take around an hour until they are successfully published to maven central

Compatibilty

Api Implementation Begon Fully Implemented link Documentation Entry
Secret Laboratory Api https://api.scpslgame.com/ existing entry
Cedmod Api Only avaidible on instance existing entry
Scplist Api https://scplist.kr/api existing entry
Feature Included Easy to use
Get Basic Server Info
Get Playercount
Interact with Server
Complex Systems
Query Player Specific Info
Feature Included Easy to use
Get Basic Server Info
Get Playercount
Interact with Server
Complex Systems
Query Player Specific Info
Feature Included Easy to use
Get Basic Server Info
Get Playercount
Interact with Server
Complex Systems
Query Player Specific Info

Examples

Get current playercount with the SecretLabApi

import io.github.vxrpenter.secretlab.SecretLab

fun main() {
    // The server-specific api key can be obtained by typing !api show into the server console
    val api = "API_KEY"
    // The account id can be optained by the same way
    val accountId = "ACCOUNT_ID"
    
    // Get current online players using the SecretLab Api
    val players = SecretLab(api, accountId).serverInfo(false, players = true)?.servers?.get(0)?.players
}

Get the current playercount with the ScpListApi

import io.github.vxrpenter.scplist.ScpList

fun main() {
    // Get players using the ScpListApi
    val players = ScpList().serverGet("ID")?.players
}

Ban a player using the cedmod api

import io.github.vxrpenter.cedmod.Cedmod

fun main() {
    // The api key of the server. This can only be obtained after asking cedmod staff to active it for the specific instance
    val api = "API_KEY"
    // Url of the instance being normally https://myservername.cmod.app
    val instanceUrl = "INSTANCE_URL"

    // Issues a ban to the cedmod api. The userId is typically steam/discord id with @steam or @discord attached.
    Cedmod(api, instanceUrl).banPostIssue(userId = "USER_ID@steam", reason = "REASON", duration = 1, appealable = true, banlists = listOf(1111))
}

About

A api wrapper for accessibg most SCP: Secret Laboratory related api's

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages