The RpgLogs Scripting API

The scripting documentation can be accessed by clicking modules in the sidebar on the right. This API is used primarily by Script Pins and Report Components.

Script pins are built using JavaScript and are intended for experts and programmers who need to build extremely complex pins that can't be handled by the query UI or by expressions, Script pins can still be shared with others, however, so you don't have to be an expert to use them!

Report components are custom charts and tables built using JavaScript. Similar to how script pins work, these custom widgets can be shared with others and viewed as part of a report.

Report components are not yet available, but they operate on the same back end API as script pins, so you can use script pins for now as a way to learn your way around what's available.

Script pins are created by clicking the Queries button in the upper right of a report. You can select the New Script tab there. You will see two functions stubbed out for you within the editor: pinMatchesFightEvent and initializePinForFight. For most script pins, you will only need to implement the first function.

pinMatchesForFight takes an event and the fight the event belongs to, and it should return true if you want the pin to match the event and false otherwise.

Here is a simple example comparing a basic expression pin with its equivalent script pin.

source.name = "Kihra"
pinMatchesFightEvent = (event, fight) => {
return event.source.name == "Kihra";
}```