Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada committed Aug 24, 2024
0 parents commit 8b059e3
Show file tree
Hide file tree
Showing 27 changed files with 1,275 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*.{java,kt,kts}]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "ci"
70 changes: 70 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build with Gradle
on:
push:
branches:
- master
pull_request:
workflow_dispatch:

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
gradle:
strategy:
matrix:
#os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
# others = slow
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
with:
distribution: temurin
java-version: 11

- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4

- name: Execute Gradle build
run: ./gradlew build

- name: Build shadowJar
run: ./gradlew shadowJar

- name: Upload shadowJar
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: plugin-shadow
path: build/libs/*-*-all.jar

create-release:
needs: gradle
runs-on: ubuntu-latest
if: (github.event_name == 'push' && github.ref == 'refs/heads/master')

steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: plugin-shadow
path: release-artifacts/
- name: Create release
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
with:
removeArtifacts: true
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "release-artifacts/*"
body: |
This release should only be used if testing one of the features that have not made it to the plugin hub yet.
Note: To use this build, you must run from terminal (or command prompt): `java -ea -jar actionlogger-*-all.jar` (be sure to specify the correct version and path to the file). Also, very recent java versions may require [additional VM options](https://github.com/runelite/runelite/wiki/Building-with-IntelliJ-IDEA#jdks-16).
Latest Change:
${{ github.event.head_commit.message }}
prerelease: true
name: Nightly Release
tag: nightly-build
22 changes: 22 additions & 0 deletions .github/workflows/gradle7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build with Gradle 7.x
on: pull_request
jobs:
gradle:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11

- name: Setup hub gradle version
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 7.4 # https://github.com/runelite/plugin-hub/blob/master/package/gradle/wrapper/gradle-wrapper.properties

- name: Build plugin using hub gradle version
run: ./gradlew shadowJar --exclude-task test # tests are already executed by primary gradle task
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Lint

on:
push:
branches:
- master
pull_request:

concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Check formatting with Prettier
uses: actionsx/prettier@3d9f7c3fa44c9cb819e68292a328d7f4384be206
with:
# prettier CLI arguments.
args: --write .
- name: Show diff
run: git --no-pager diff --exit-code --color=never
shell: bash
33 changes: 33 additions & 0 deletions .github/workflows/update-resources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update Resources
on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:

jobs:
update-resources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Execute Resource Generator
run: ./gradlew generateResources

- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
title: "chore: update rarity data from ${{ steps.date.outputs.date }} wiki"
commit-message: "chore: update rarity data from ${{ steps.date.outputs.date }} wiki"
branch: automated/chore/update-resources
reviewers: iProdigy
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.gradle
build
.idea/
.project
.settings/
.classpath
nbactions.xml
nb-configuration.xml
nbproject/
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore build directory
build/

# Ignore runtime resources
src/main/resources/
7 changes: 7 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
trailingComma: none
endOfLine: auto
quoteProps: preserve
overrides:
- files: "*.md"
options:
proseWrap: preserve
11 changes: 11 additions & 0 deletions .run/Run Action Logger.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Action Logger" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="actionlogger.ActionLoggerTest" />
<module name="actionlogger.test" />
<option name="PROGRAM_PARAMETERS" value="--debug --developer-mode" />
<option name="VM_PARAMETERS" value="-ea --illegal-access=warn --add-opens=java.desktop/sun.awt=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
BSD 2-Clause License

Copyright (c) 2022, Jake Barter
All rights reserved.

Copyright (c) 2022, pajlads

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
123 changes: 123 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Action Logger

Action Logger logs actions your character makes to disk in a programmatically accessible format. These actions intend to make debugging quest helpers easier.

The files are stored in your RuneLite folder under the `actionlogger` directory. At each start, a file is created with the current unix timestamp (e.g. `1724499647864-logs.txt`).
Each new line contains an action defined in a JSON format

## Types of actions logged

### DIALOGUE_STARTED

Fires when a dialogue is opened

```json5
{
"tickCount": 95,
"timestamp": "2024-08-24 13:23:19.312",
"type": "DIALOGUE_STARTED",
"data": {
"actorName": "pajdenk",
"lastInteractedName": "Lumbridge Guide",
"lastInteractedID": 306,
"lastInteractedPosition": {
"x": 3238,
"y": 3220,
"plane": 0
},
"playerPosition": {
"x": 3237,
"y": 3220,
"plane": 0
},
"dialogueText": "",
"dialogueOptions": [
"Select an option",
"Where can I find a quest to go on?",
"What monsters should I fight?",
"Where can I make money?",
"Where can I find more information?",
"More options..."
]
}
}
```

### DIALOGUE_ENDED

Fires when a dialogue ends, either by the user selecting an option or leaving the dialogue

Where possible, the `dialogueOptionChosen` will be filled in with information about which of the dialogue options was chosen, -1 meaning they didn't chose an option or they chose "Continue" which usually isn't included in the `dialogueOptions` key

```json5
{
"tickCount": 101,
"timestamp": "2024-08-24 13:23:22.912",
"type": "DIALOGUE_ENDED",
"data": {
"actorName": "pajdenk",
"lastInteractedName": "Lumbridge Guide",
"lastInteractedID": 306,
"lastInteractedPosition": {
"x": 3238,
"y": 3220,
"plane": 0
},
"playerPosition": {
"x": 3237,
"y": 3220,
"plane": 0
},
"dialogueText": "",
"dialogueOptions": [
"Select an option",
"Where can I find a quest to go on?",
"What monsters should I fight?",
"Where can I make money?",
"Where can I find more information?",
"More options..."
],
"dialogueOptionChosen": -1
}
}
```

### VARBIT_CHANGED

Fires when a Varbit value changes

You can Inspect the Varbit in Chisel, e.g. https://chisel.weirdgloop.org/varbs/display?varbit=10060

```json5
{
"tickCount": 104,
"timestamp": "2024-08-24 13:23:24.692",
"type": "VARBIT_CHANGED",
"data": {
// ID of the Varbit being changed
"id": 10060,
"oldValue": 0,
"newValue": 2
}
}
```

### VARPLAYER_CHANGED

Fires when a Varplayer value changes

You can Inspect the Varplayer in Chisel, e.g. https://chisel.weirdgloop.org/varbs/display?varplayer=3803

```json5
{
"tickCount": 0,
"timestamp": "2024-08-24 13:22:22.092",
"type": "VARPLAYER_CHANGED",
"data": {
// ID of the Varplayer being changed
"id": 3803,
"oldValue": 0,
"newValue": 20000
}
}
```
Loading

0 comments on commit 8b059e3

Please sign in to comment.