Merge remote-tracking branch 'origin/master'
This commit is contained in:
2
.github/workflows/gradle.yml
vendored
2
.github/workflows/gradle.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Update Gradle Wrapper
|
- name: Update Gradle Wrapper
|
||||||
|
|||||||
4
.github/workflows/merge.yml
vendored
4
.github/workflows/merge.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: automerge
|
- name: automerge
|
||||||
if: github.event_name == 'pull_request' && github.actor == 'Owain94'
|
if: github.event_name == 'pull_request' && github.actor == 'Owain94'
|
||||||
uses: pascalgn/automerge-action@v0.12.0
|
uses: pascalgn/automerge-action@v0.15.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
MERGE_FORKS: false
|
MERGE_FORKS: false
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Delete PR head branch
|
- name: Delete PR head branch
|
||||||
if: github.event_name == 'pull_request' && github.actor == 'Owain94'
|
if: github.event_name == 'pull_request' && github.actor == 'Owain94'
|
||||||
uses: dawidd6/action-delete-branch@v3.0.2
|
uses: dawidd6/action-delete-branch@v3.1.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branches: ${{ steps.extract_branch.outputs.branch }}
|
branches: ${{ steps.extract_branch.outputs.branch }}
|
||||||
|
|||||||
56
.github/workflows/pr.yml
vendored
56
.github/workflows/pr.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: PR title lint
|
- name: PR title lint
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: morrisoncole/pr-lint-action@v1.4.1
|
uses: MorrisonCole/pr-lint-action@v1.6.1
|
||||||
with:
|
with:
|
||||||
title-regex: '^([\w-/]+): \w+'
|
title-regex: '^([\w-/]+): \w+'
|
||||||
on-failed-regex-fail-action: false
|
on-failed-regex-fail-action: false
|
||||||
@@ -25,8 +25,8 @@ jobs:
|
|||||||
name: Validate gradle wrapper
|
name: Validate gradle wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- uses: gradle/wrapper-validation-action@v1.0.3
|
- uses: gradle/wrapper-validation-action@v1.0.4
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
@@ -34,19 +34,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- uses: actions/cache@v2.1.3
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v3.1.1
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
cache: 'gradle'
|
||||||
- name: Assembling
|
- name: Assembling
|
||||||
run: ./gradlew assemble --console=plain
|
run: ./gradlew assemble --console=plain
|
||||||
- name: Building
|
- name: Building
|
||||||
@@ -58,19 +54,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- uses: actions/cache@v2.1.3
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v3.1.1
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
cache: 'gradle'
|
||||||
- name: Assembling
|
- name: Assembling
|
||||||
run: ./gradlew assemble --console=plain
|
run: ./gradlew assemble --console=plain
|
||||||
- name: Testing
|
- name: Testing
|
||||||
@@ -82,19 +74,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- uses: actions/cache@v2.1.3
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v3.1.1
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
cache: 'gradle'
|
||||||
- name: Assembling
|
- name: Assembling
|
||||||
run: ./gradlew assemble --console=plain
|
run: ./gradlew assemble --console=plain
|
||||||
- name: Checking code conventions
|
- name: Checking code conventions
|
||||||
@@ -106,19 +94,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- uses: actions/cache@v2.1.3
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v3.1.1
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
cache: 'gradle'
|
||||||
- name: Assembling
|
- name: Assembling
|
||||||
run: ./gradlew assemble --console=plain
|
run: ./gradlew assemble --console=plain
|
||||||
- name: Checking code conventions
|
- name: Checking code conventions
|
||||||
@@ -132,6 +116,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Approve pull request
|
- name: Approve pull request
|
||||||
if: github.event_name == 'pull_request' && github.actor == 'OpenOSRS'
|
if: github.event_name == 'pull_request' && github.actor == 'OpenOSRS'
|
||||||
uses: hmarr/auto-approve-action@v2.0.0
|
uses: hmarr/auto-approve-action@v2.2.1
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.Owain }}
|
github-token: ${{ secrets.Owain }}
|
||||||
|
|||||||
48
.github/workflows/push.yml
vendored
48
.github/workflows/push.yml
vendored
@@ -11,19 +11,15 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- uses: actions/cache@v2.1.3
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v3.1.1
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
cache: 'gradle'
|
||||||
- name: Assembling
|
- name: Assembling
|
||||||
run: ./gradlew assemble --console=plain
|
run: ./gradlew assemble --console=plain
|
||||||
- name: Building
|
- name: Building
|
||||||
@@ -34,19 +30,15 @@ jobs:
|
|||||||
name: Test
|
name: Test
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- uses: actions/cache@v2.1.3
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v3.1.1
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
cache: 'gradle'
|
||||||
- name: Assembling
|
- name: Assembling
|
||||||
run: ./gradlew assemble --console=plain
|
run: ./gradlew assemble --console=plain
|
||||||
- name: Testing
|
- name: Testing
|
||||||
@@ -57,19 +49,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- uses: actions/cache@v2.1.3
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v3.1.1
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
cache: 'gradle'
|
||||||
- name: Assembling
|
- name: Assembling
|
||||||
run: ./gradlew assemble --console=plain
|
run: ./gradlew assemble --console=plain
|
||||||
- name: Checking code conventions
|
- name: Checking code conventions
|
||||||
@@ -80,19 +68,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
- uses: actions/cache@v2.1.3
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v3.1.1
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
cache: 'gradle'
|
||||||
- name: Assembling
|
- name: Assembling
|
||||||
run: ./gradlew assemble --console=plain
|
run: ./gradlew assemble --console=plain
|
||||||
- name: Checking code conventions
|
- name: Checking code conventions
|
||||||
|
|||||||
15
.github/workflows/scraper.yml
vendored
15
.github/workflows/scraper.yml
vendored
@@ -9,23 +9,18 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
with:
|
with:
|
||||||
repository: open-osrs/cache-client
|
repository: open-osrs/cache-client
|
||||||
ref: master
|
ref: master
|
||||||
path: cache-client
|
path: cache-client
|
||||||
|
|
||||||
- uses: actions/cache@v2.1.3
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches
|
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-
|
|
||||||
|
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v3.1.1
|
||||||
with:
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
java-version: 11
|
java-version: 11
|
||||||
|
cache: 'gradle'
|
||||||
|
|
||||||
- name: Make gradlew executable
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
@@ -39,7 +34,7 @@ jobs:
|
|||||||
run: ./gradlew download --console=plain
|
run: ./gradlew download --console=plain
|
||||||
working-directory: cache-client
|
working-directory: cache-client
|
||||||
|
|
||||||
- uses: actions/checkout@v2.3.4
|
- uses: actions/checkout@v2.4.2
|
||||||
with:
|
with:
|
||||||
repository: open-osrs/runelite
|
repository: open-osrs/runelite
|
||||||
ref: master
|
ref: master
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class ChatCommandsPlugin extends Plugin
|
|||||||
private static final Pattern HS_KC_FLOOR_PATTERN = Pattern.compile("You have completed Floor (\\d) of the Hallowed Sepulchre! Total completions: <col=ff0000>([0-9,]+)</col>\\.");
|
private static final Pattern HS_KC_FLOOR_PATTERN = Pattern.compile("You have completed Floor (\\d) of the Hallowed Sepulchre! Total completions: <col=ff0000>([0-9,]+)</col>\\.");
|
||||||
private static final Pattern HS_KC_GHC_PATTERN = Pattern.compile("You have opened the Grand Hallowed Coffin <col=ff0000>([0-9,]+)</col> times?!");
|
private static final Pattern HS_KC_GHC_PATTERN = Pattern.compile("You have opened the Grand Hallowed Coffin <col=ff0000>([0-9,]+)</col> times?!");
|
||||||
private static final Pattern COLLECTION_LOG_ITEM_PATTERN = Pattern.compile("New item added to your collection log: (.*)");
|
private static final Pattern COLLECTION_LOG_ITEM_PATTERN = Pattern.compile("New item added to your collection log: (.*)");
|
||||||
private static final Pattern GUARDIANS_OF_THE_RIFT_PATTERN = Pattern.compile("Amount of Rifts you have closed: <col=ff0000>([0-9,]+)</col>.");
|
private static final Pattern GUARDIANS_OF_THE_RIFT_PATTERN = Pattern.compile("Amount of Rifts you have closed: <col=ff0000>([0-9,]+)</col>.", Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
private static final String TOTAL_LEVEL_COMMAND_STRING = "!total";
|
private static final String TOTAL_LEVEL_COMMAND_STRING = "!total";
|
||||||
private static final String PRICE_COMMAND_STRING = "!price";
|
private static final String PRICE_COMMAND_STRING = "!price";
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* 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 OWNER 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.
|
|
||||||
*/
|
|
||||||
package net.runelite.client.plugins.examine;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
class CacheKey
|
|
||||||
{
|
|
||||||
private final ExamineType type;
|
|
||||||
private final int id;
|
|
||||||
|
|
||||||
public CacheKey(ExamineType type, int id)
|
|
||||||
{
|
|
||||||
this.type = type;
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode()
|
|
||||||
{
|
|
||||||
int hash = 3;
|
|
||||||
hash = 23 * hash + Objects.hashCode(this.type);
|
|
||||||
hash = 23 * hash + this.id;
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object obj)
|
|
||||||
{
|
|
||||||
if (this == obj)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (obj == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (getClass() != obj.getClass())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
final CacheKey other = (CacheKey) obj;
|
|
||||||
if (this.id != other.id)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return this.type == other.type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -25,7 +25,6 @@
|
|||||||
package net.runelite.client.plugins.examine;
|
package net.runelite.client.plugins.examine;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import java.time.Instant;
|
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
import java.util.Deque;
|
import java.util.Deque;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -52,7 +51,6 @@ import net.runelite.client.game.ItemManager;
|
|||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.util.QuantityFormatter;
|
import net.runelite.client.util.QuantityFormatter;
|
||||||
import net.runelite.client.util.Text;
|
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Examine",
|
name = "Examine",
|
||||||
@@ -82,18 +80,18 @@ public class ExaminePlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuOptionClicked(MenuOptionClicked event)
|
public void onMenuOptionClicked(MenuOptionClicked event)
|
||||||
{
|
{
|
||||||
if (!Text.removeTags(event.getMenuOption()).equals("Examine"))
|
if (!event.getMenuOption().equals("Examine"))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExamineType type;
|
final ChatMessageType type;
|
||||||
int id, quantity = -1;
|
int id, quantity = -1;
|
||||||
switch (event.getMenuAction())
|
switch (event.getMenuAction())
|
||||||
{
|
{
|
||||||
case EXAMINE_ITEM:
|
case EXAMINE_ITEM:
|
||||||
{
|
{
|
||||||
type = ExamineType.ITEM;
|
type = ChatMessageType.ITEM_EXAMINE;
|
||||||
id = event.getId();
|
id = event.getId();
|
||||||
|
|
||||||
int widgetId = event.getParam1();
|
int widgetId = event.getParam1();
|
||||||
@@ -120,12 +118,12 @@ public class ExaminePlugin extends Plugin
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EXAMINE_ITEM_GROUND:
|
case EXAMINE_ITEM_GROUND:
|
||||||
type = ExamineType.ITEM;
|
type = ChatMessageType.ITEM_EXAMINE;
|
||||||
id = event.getId();
|
id = event.getId();
|
||||||
break;
|
break;
|
||||||
case CC_OP_LOW_PRIORITY:
|
case CC_OP_LOW_PRIORITY:
|
||||||
{
|
{
|
||||||
type = ExamineType.IF3_ITEM;
|
type = ChatMessageType.ITEM_EXAMINE; // these are spoofed by us from a [proc,examine_item] script edit
|
||||||
int[] qi = findItemFromWidget(event.getParam1(), event.getParam0());
|
int[] qi = findItemFromWidget(event.getParam1(), event.getParam0());
|
||||||
if (qi == null)
|
if (qi == null)
|
||||||
{
|
{
|
||||||
@@ -136,77 +134,45 @@ public class ExaminePlugin extends Plugin
|
|||||||
id = qi[1];
|
id = qi[1];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case EXAMINE_OBJECT:
|
|
||||||
type = ExamineType.OBJECT;
|
|
||||||
id = event.getId();
|
|
||||||
break;
|
|
||||||
case EXAMINE_NPC:
|
|
||||||
type = ExamineType.NPC;
|
|
||||||
id = event.getId();
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PendingExamine pendingExamine = new PendingExamine();
|
PendingExamine pendingExamine = new PendingExamine();
|
||||||
pendingExamine.setType(type);
|
pendingExamine.setResponseType(type);
|
||||||
pendingExamine.setId(id);
|
pendingExamine.setId(id);
|
||||||
pendingExamine.setQuantity(quantity);
|
pendingExamine.setQuantity(quantity);
|
||||||
pendingExamine.setCreated(Instant.now());
|
|
||||||
pending.push(pendingExamine);
|
pending.push(pendingExamine);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onChatMessage(ChatMessage event)
|
public void onChatMessage(ChatMessage event)
|
||||||
{
|
{
|
||||||
ExamineType type;
|
|
||||||
switch (event.getType())
|
|
||||||
{
|
|
||||||
case OBJECT_EXAMINE:
|
|
||||||
type = ExamineType.OBJECT;
|
|
||||||
break;
|
|
||||||
case NPC_EXAMINE:
|
|
||||||
type = ExamineType.NPC;
|
|
||||||
break;
|
|
||||||
case GAMEMESSAGE:
|
|
||||||
case ITEM_EXAMINE: // these are spoofed by us from a [proc,examine_item] script edit
|
|
||||||
type = ExamineType.IF3_ITEM;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pending.isEmpty())
|
if (pending.isEmpty())
|
||||||
{
|
{
|
||||||
log.debug("Got examine without a pending examine?");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PendingExamine pendingExamine = pending.pop();
|
PendingExamine pendingExamine = pending.poll();
|
||||||
|
if (pendingExamine.getResponseType() != event.getType())
|
||||||
if (pendingExamine.getType() != type)
|
|
||||||
{
|
{
|
||||||
log.debug("Type mismatch for pending examine: {} != {}", pendingExamine.getType(), type);
|
log.debug("Type mismatch for pending examine: {} != {}", pendingExamine.getResponseType(), event.getType());
|
||||||
pending.clear(); // eh
|
pending.clear(); // eh
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug("Got examine for {} {}: {}", pendingExamine.getType(), pendingExamine.getId(), event.getMessage());
|
log.debug("Got examine type {} {}: {}", pendingExamine.getResponseType(), pendingExamine.getId(), event.getMessage());
|
||||||
|
|
||||||
// If it is an item, show the price of it
|
final int itemId = pendingExamine.getId();
|
||||||
if (pendingExamine.getType() == ExamineType.ITEM || pendingExamine.getType() == ExamineType.IF3_ITEM)
|
final int itemQuantity = pendingExamine.getQuantity();
|
||||||
|
|
||||||
|
if (itemId == ItemID.COINS_995)
|
||||||
{
|
{
|
||||||
final int itemId = pendingExamine.getId();
|
return;
|
||||||
final int itemQuantity = pendingExamine.getQuantity();
|
|
||||||
|
|
||||||
if (itemId == ItemID.COINS_995)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
|
||||||
getItemPrice(itemComposition.getId(), itemComposition, itemQuantity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final ItemComposition itemComposition = itemManager.getItemComposition(itemId);
|
||||||
|
getItemPrice(itemComposition.getId(), itemComposition, itemQuantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int[] findItemFromWidget(int widgetId, int childIdx)
|
private int[] findItemFromWidget(int widgetId, int childIdx)
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* 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 OWNER 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.
|
|
||||||
*/
|
|
||||||
package net.runelite.client.plugins.examine;
|
|
||||||
|
|
||||||
enum ExamineType
|
|
||||||
{
|
|
||||||
ITEM,
|
|
||||||
IF3_ITEM,
|
|
||||||
NPC,
|
|
||||||
OBJECT;
|
|
||||||
}
|
|
||||||
@@ -24,14 +24,13 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.examine;
|
package net.runelite.client.plugins.examine;
|
||||||
|
|
||||||
import java.time.Instant;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import net.runelite.api.ChatMessageType;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
class PendingExamine
|
class PendingExamine
|
||||||
{
|
{
|
||||||
private ExamineType type;
|
private ChatMessageType responseType;
|
||||||
private int id;
|
private int id;
|
||||||
private int quantity;
|
private int quantity;
|
||||||
private Instant created;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,9 +43,11 @@ import net.runelite.api.TileObject;
|
|||||||
import net.runelite.api.WallObject;
|
import net.runelite.api.WallObject;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
|
import net.runelite.api.events.InteractingChanged;
|
||||||
import net.runelite.api.events.MenuOptionClicked;
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
import net.runelite.api.events.NpcDespawned;
|
import net.runelite.api.events.NpcDespawned;
|
||||||
import net.runelite.api.events.InteractingChanged;
|
import net.runelite.api.widgets.WidgetID;
|
||||||
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
@@ -168,7 +170,8 @@ public class InteractHighlightPlugin extends Plugin
|
|||||||
int id = menuOptionClicked.getId();
|
int id = menuOptionClicked.getId();
|
||||||
interactedObject = null;
|
interactedObject = null;
|
||||||
interactedNpc = findNpc(id);
|
interactedNpc = findNpc(id);
|
||||||
attacked = menuOptionClicked.getMenuAction() == MenuAction.NPC_SECOND_OPTION || menuOptionClicked.getMenuAction() == MenuAction.WIDGET_TARGET_ON_NPC;
|
attacked = menuOptionClicked.getMenuAction() == MenuAction.NPC_SECOND_OPTION ||
|
||||||
|
menuOptionClicked.getMenuAction() == MenuAction.WIDGET_TARGET_ON_NPC && WidgetInfo.TO_GROUP(client.getSelectedWidget().getId()) == WidgetID.SPELLBOOK_GROUP_ID;
|
||||||
clickTick = client.getTickCount();
|
clickTick = client.getTickCount();
|
||||||
gameCycle = client.getGameCycle();
|
gameCycle = client.getGameCycle();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1144,9 +1144,9 @@ public class ChatCommandsPluginTest
|
|||||||
@Test
|
@Test
|
||||||
public void testGuardiansOfTheRift()
|
public void testGuardiansOfTheRift()
|
||||||
{
|
{
|
||||||
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Amount of Rifts you have closed: <col=ff0000>7</col>.", null, 0);
|
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Amount of rifts you have closed: <col=ff0000>167</col>.", null, 0);
|
||||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||||
|
|
||||||
verify(configManager).setRSProfileConfiguration("killcount", "guardians of the rift", 7);
|
verify(configManager).setRSProfileConfiguration("killcount", "guardians of the rift", 167);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user