Merge pull request #2898 from open-osrs/upstream

project: upstream, fix git history, extract some of our api
This commit is contained in:
Tyler Bochard
2021-01-14 15:10:28 -05:00
committed by GitHub
98 changed files with 7456 additions and 1754 deletions
@@ -66,7 +66,7 @@ public class DataFile implements Closeable
* @return
* @throws IOException
*/
public byte[] read(int indexId, int archiveId, int sector, int size) throws IOException
public synchronized byte[] read(int indexId, int archiveId, int sector, int size) throws IOException
{
if (sector <= 0L || dat.length() / SECTOR_SIZE < (long) sector)
{
@@ -169,7 +169,7 @@ public class DataFile implements Closeable
return buffer.array();
}
public DataFileWriteResult write(int indexId, int archiveId, byte[] compressedData) throws IOException
public synchronized DataFileWriteResult write(int indexId, int archiveId, byte[] compressedData) throws IOException
{
int sector;
int startSector;
@@ -112,13 +112,13 @@ public class DiskStorage implements Storage
public byte[] readIndex(int indexId) throws IOException
{
IndexEntry entry = index255.read(indexId);
if (entry != null)
if (entry == null)
{
byte[] indexData = data.read(index255.getIndexFileId(), entry.getId(), entry.getSector(), entry.getLength());
return indexData;
return null;
}
return null;
byte[] indexData = data.read(index255.getIndexFileId(), entry.getId(), entry.getSector(), entry.getLength());
return indexData;
}
private void loadIndex(Index index) throws IOException
@@ -126,7 +126,6 @@ public class DiskStorage implements Storage
logger.trace("Loading index {}", index.getId());
byte[] indexData = readIndex(index.getId());
if (indexData == null)
{
return;
@@ -0,0 +1,136 @@
/*
* Copyright (c) 2020 Abex
* 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.cache.models;
public final class JagexColor
{
public static final double BRIGHTNESS_MAX = .6;
public static final double BRIGHTNESS_HIGH = .7;
public static final double BRIGHTNESS_LOW = .8;
public static final double BRIGTHNESS_MIN = .9;
private static final double HUE_OFFSET = (.5 / 64.D);
private static final double SATURATION_OFFSET = (.5 / 8.D);
private JagexColor()
{
}
public static short packHSL(int hue, int saturation, int luminance)
{
return (short) ((short) (hue & 63) << 10
| (short) (saturation & 7) << 7
| (short) (luminance & 127));
}
public static int unpackHue(short hsl)
{
return hsl >> 10 & 63;
}
public static int unpackSaturation(short hsl)
{
return hsl >> 7 & 7;
}
public static int unpackLuminance(short hsl)
{
return hsl & 127;
}
public static String formatHSL(short hsl)
{
return String.format("%02Xh%Xs%02Xl", unpackHue(hsl), unpackSaturation(hsl), unpackLuminance(hsl));
}
public static int HSLtoRGB(short hsl, double brightness)
{
double hue = (double) unpackHue(hsl) / 64.D + HUE_OFFSET;
double saturation = (double) unpackSaturation(hsl) / 8.D + SATURATION_OFFSET;
double luminance = (double) unpackLuminance(hsl) / 128.D;
// This is just a standard hsl to rgb transform
// the only difference is the offsets above and the brightness transform below
double chroma = (1.D - Math.abs((2.D * luminance) - 1.D)) * saturation;
double x = chroma * (1 - Math.abs(((hue * 6.D) % 2.D) - 1.D));
double lightness = luminance - (chroma / 2);
double r = lightness, g = lightness, b = lightness;
switch ((int) (hue * 6.D))
{
case 0:
r += chroma;
g += x;
break;
case 1:
g += chroma;
r += x;
break;
case 2:
g += chroma;
b += x;
break;
case 3:
b += chroma;
g += x;
break;
case 4:
b += chroma;
r += x;
break;
default:
r += chroma;
b += x;
break;
}
int rgb = ((int) (r * 256.0D) << 16)
| ((int) (g * 256.0D) << 8)
| (int) (b * 256.0D);
rgb = adjustForBrightness(rgb, brightness);
if (rgb == 0)
{
rgb = 1;
}
return rgb;
}
public static int adjustForBrightness(int rgb, double brightness)
{
double r = (double) (rgb >> 16) / 256.0D;
double g = (double) (rgb >> 8 & 255) / 256.0D;
double b = (double) (rgb & 255) / 256.0D;
r = Math.pow(r, brightness);
g = Math.pow(g, brightness);
b = Math.pow(b, brightness);
return ((int) (r * 256.0D) << 16)
| ((int) (g * 256.0D) << 8)
| (int) (b * 256.0D);
}
}
@@ -24,7 +24,6 @@
*/
package net.runelite.cache.models;
import java.awt.Color;
import java.io.PrintWriter;
import net.runelite.cache.TextureManager;
import net.runelite.cache.definitions.ModelDefinition;
@@ -32,6 +31,8 @@ import net.runelite.cache.definitions.TextureDefinition;
public class ObjExporter
{
private static final double BRIGHTNESS = JagexColor.BRIGTHNESS_MIN;
private final TextureManager textureManager;
private final ModelDefinition model;
@@ -111,11 +112,10 @@ public class ObjExporter
if (textureId == -1)
{
Color color = rs2hsbToColor(model.faceColors[i]);
double r = color.getRed() / 255.0;
double g = color.getGreen() / 255.0;
double b = color.getBlue() / 255.0;
int rgb = JagexColor.HSLtoRGB( model.faceColors[i], BRIGHTNESS);
double r = ((rgb >> 16) & 0xff) / 255.0;
double g = ((rgb >> 8) & 0xff) / 255.0;
double b = (rgb & 0xff) / 255.0;
mtlWriter.println("Kd " + r + " " + g + " " + b);
}
@@ -140,12 +140,4 @@ public class ObjExporter
}
}
}
private static Color rs2hsbToColor(int hsb)
{
int decode_hue = (hsb >> 10) & 0x3f;
int decode_saturation = (hsb >> 7) & 0x07;
int decode_brightness = (hsb & 0x7f);
return Color.getHSBColor((float) decode_hue / 63, (float) decode_saturation / 7, (float) decode_brightness / 127);
}
}
@@ -0,0 +1,178 @@
/*
* Copyright (c) 2020 Abex
* 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.cache.models;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class JagexColorTest
{
private static final double[] BRIGHTNESS_LEVELS = {
JagexColor.BRIGTHNESS_MIN,
JagexColor.BRIGHTNESS_LOW,
JagexColor.BRIGHTNESS_HIGH,
JagexColor.BRIGHTNESS_MAX,
};
// copy/pasted from the client, the reference colors
private static int[] computeColorTable(double brightness, int min, int max)
{
int[] colorPalette = new int[65536];
int var4 = min * 128;
for (int var5 = min; var5 < max; ++var5)
{
double var6 = (double) (var5 >> 3) / 64.0D + 0.0078125D;
double var8 = (double) (var5 & 7) / 8.0D + 0.0625D;
for (int var10 = 0; var10 < 128; ++var10)
{
double var11 = (double) var10 / 128.0D;
double var13 = var11;
double var15 = var11;
double var17 = var11;
if (var8 != 0.0D)
{
double var19;
if (var11 < 0.5D)
{
var19 = var11 * (1.0D + var8);
}
else
{
var19 = var11 + var8 - var11 * var8;
}
double var21 = 2.0D * var11 - var19;
double var23 = var6 + 0.3333333333333333D;
if (var23 > 1.0D)
{
--var23;
}
double var27 = var6 - 0.3333333333333333D;
if (var27 < 0.0D)
{
++var27;
}
if (6.0D * var23 < 1.0D)
{
var13 = var21 + (var19 - var21) * 6.0D * var23;
}
else if (2.0D * var23 < 1.0D)
{
var13 = var19;
}
else if (3.0D * var23 < 2.0D)
{
var13 = var21 + (var19 - var21) * (0.6666666666666666D - var23) * 6.0D;
}
else
{
var13 = var21;
}
if (6.0D * var6 < 1.0D)
{
var15 = var21 + (var19 - var21) * 6.0D * var6;
}
else if (2.0D * var6 < 1.0D)
{
var15 = var19;
}
else if (3.0D * var6 < 2.0D)
{
var15 = var21 + (var19 - var21) * (0.6666666666666666D - var6) * 6.0D;
}
else
{
var15 = var21;
}
if (6.0D * var27 < 1.0D)
{
var17 = var21 + (var19 - var21) * 6.0D * var27;
}
else if (2.0D * var27 < 1.0D)
{
var17 = var19;
}
else if (3.0D * var27 < 2.0D)
{
var17 = var21 + (var19 - var21) * (0.6666666666666666D - var27) * 6.0D;
}
else
{
var17 = var21;
}
}
int var29 = (int) (var13 * 256.0D);
int var20 = (int) (var15 * 256.0D);
int var30 = (int) (var17 * 256.0D);
int var22 = var30 + (var20 << 8) + (var29 << 16);
var22 = adjustForBrightness(var22, brightness);
if (var22 == 0)
{
var22 = 1;
}
colorPalette[var4++] = var22;
}
}
return colorPalette;
}
private static int adjustForBrightness(int rgb, double brightness)
{
double var3 = (double) (rgb >> 16) / 256.0D;
double var5 = (double) (rgb >> 8 & 255) / 256.0D;
double var7 = (double) (rgb & 255) / 256.0D;
var3 = Math.pow(var3, brightness);
var5 = Math.pow(var5, brightness);
var7 = Math.pow(var7, brightness);
int var9 = (int) (var3 * 256.0D);
int var10 = (int) (var5 * 256.0D);
int var11 = (int) (var7 * 256.0D);
return var11 + (var10 << 8) + (var9 << 16);
}
@Test
public void testHslToRgb()
{
for (double brightness : BRIGHTNESS_LEVELS)
{
int[] colorPalette = computeColorTable(brightness, 0, 512);
for (int i = 0; i < 0xFFFF; i++)
{
int rgb = JagexColor.HSLtoRGB((short) i, brightness);
int crgb = colorPalette[i];
assertEquals("idx " + i + " brightness " + brightness, crgb, rgb);
}
}
}
}
@@ -0,0 +1,250 @@
/*
* Copyright (c) 2018, 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.http.service.chat;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.runelite.http.api.chat.Duels;
import net.runelite.http.api.chat.LayoutRoom;
import net.runelite.http.api.chat.Task;
import net.runelite.http.service.util.exception.NotFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.CacheControl;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/chat")
public class ChatController
{
private static final Pattern STRING_VALIDATION = Pattern.compile("[^a-zA-Z0-9' -]");
private static final int STRING_MAX_LENGTH = 50;
private static final int MAX_LAYOUT_ROOMS = 16;
private final Cache<KillCountKey, Integer> killCountCache = CacheBuilder.newBuilder()
.expireAfterWrite(2, TimeUnit.MINUTES)
.maximumSize(128L)
.build();
@Autowired
private ChatService chatService;
@PostMapping("/kc")
public void submitKc(@RequestParam String name, @RequestParam String boss, @RequestParam int kc)
{
if (kc <= 0)
{
return;
}
chatService.setKc(name, boss, kc);
killCountCache.put(new KillCountKey(name, boss), kc);
}
@GetMapping("/kc")
public int getKc(@RequestParam String name, @RequestParam String boss)
{
Integer kc = killCountCache.getIfPresent(new KillCountKey(name, boss));
if (kc == null)
{
kc = chatService.getKc(name, boss);
if (kc != null)
{
killCountCache.put(new KillCountKey(name, boss), kc);
}
}
if (kc == null)
{
throw new NotFoundException();
}
return kc;
}
@PostMapping("/qp")
public void submitQp(@RequestParam String name, @RequestParam int qp)
{
if (qp < 0)
{
return;
}
chatService.setQp(name, qp);
}
@GetMapping("/qp")
public int getQp(@RequestParam String name)
{
Integer kc = chatService.getQp(name);
if (kc == null)
{
throw new NotFoundException();
}
return kc;
}
@PostMapping("/gc")
public void submitGc(@RequestParam String name, @RequestParam int gc)
{
if (gc < 0)
{
return;
}
chatService.setGc(name, gc);
}
@GetMapping("/gc")
public int getKc(@RequestParam String name)
{
Integer gc = chatService.getGc(name);
if (gc == null)
{
throw new NotFoundException();
}
return gc;
}
@PostMapping("/task")
public void submitTask(@RequestParam String name, @RequestParam("task") String taskName, @RequestParam int amount,
@RequestParam int initialAmount, @RequestParam String location)
{
Matcher mTask = STRING_VALIDATION.matcher(taskName);
Matcher mLocation = STRING_VALIDATION.matcher(location);
if (mTask.find() || taskName.length() > STRING_MAX_LENGTH ||
mLocation.find() || location.length() > STRING_MAX_LENGTH)
{
return;
}
Task task = new Task();
task.setTask(taskName);
task.setAmount(amount);
task.setInitialAmount(initialAmount);
task.setLocation(location);
chatService.setTask(name, task);
}
@GetMapping("/task")
public ResponseEntity<Task> getTask(@RequestParam String name)
{
Task task = chatService.getTask(name);
if (task == null)
{
return ResponseEntity.status(HttpStatus.NOT_FOUND)
.build();
}
return ResponseEntity.ok()
.cacheControl(CacheControl.maxAge(2, TimeUnit.MINUTES).cachePublic())
.body(task);
}
@PostMapping("/pb")
public void submitPb(@RequestParam String name, @RequestParam String boss, @RequestParam int pb)
{
if (pb < 0)
{
return;
}
chatService.setPb(name, boss, pb);
}
@GetMapping("/pb")
public int getPb(@RequestParam String name, @RequestParam String boss)
{
Integer pb = chatService.getPb(name, boss);
if (pb == null)
{
throw new NotFoundException();
}
return pb;
}
@PostMapping("/duels")
public void submitDuels(@RequestParam String name, @RequestParam int wins,
@RequestParam int losses,
@RequestParam int winningStreak, @RequestParam int losingStreak)
{
if (wins < 0 || losses < 0 || winningStreak < 0 || losingStreak < 0)
{
return;
}
Duels duels = new Duels();
duels.setWins(wins);
duels.setLosses(losses);
duels.setWinningStreak(winningStreak);
duels.setLosingStreak(losingStreak);
chatService.setDuels(name, duels);
}
@GetMapping("/duels")
public Duels getDuels(@RequestParam String name)
{
Duels duels = chatService.getDuels(name);
if (duels == null)
{
throw new NotFoundException();
}
return duels;
}
@PostMapping("/layout")
public void submitLayout(@RequestParam String name, @RequestBody LayoutRoom[] rooms)
{
if (rooms.length > MAX_LAYOUT_ROOMS)
{
return;
}
chatService.setLayout(name, rooms);
}
@GetMapping("/layout")
public LayoutRoom[] getLayout(@RequestParam String name)
{
LayoutRoom[] layout = chatService.getLayout(name);
if (layout == null)
{
throw new NotFoundException();
}
return layout;
}
}
@@ -0,0 +1,134 @@
/*
* Copyright (c) 2019, 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.http.service.config;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.runelite.http.api.config.Configuration;
import net.runelite.http.service.account.AuthFilter;
import net.runelite.http.service.account.beans.SessionEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import static org.springframework.web.bind.annotation.RequestMethod.DELETE;
import static org.springframework.web.bind.annotation.RequestMethod.PUT;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/config")
public class ConfigController
{
private final ConfigService configService;
private final AuthFilter authFilter;
@Autowired
public ConfigController(ConfigService configService, AuthFilter authFilter)
{
this.configService = configService;
this.authFilter = authFilter;
}
@GetMapping
public Configuration get(HttpServletRequest request, HttpServletResponse response) throws IOException
{
SessionEntry session = authFilter.handle(request, response);
if (session == null)
{
return null;
}
return configService.get(session.getUser());
}
@PatchMapping
public List<String> patch(
HttpServletRequest request,
HttpServletResponse response,
@RequestBody Configuration changes
) throws IOException
{
SessionEntry session = authFilter.handle(request, response);
if (session == null)
{
return null;
}
List<String> failures = configService.patch(session.getUser(), changes);
if (failures.size() != 0)
{
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
return failures;
}
return null;
}
@RequestMapping(path = "/{key:.+}", method = PUT)
public void setKey(
HttpServletRequest request,
HttpServletResponse response,
@PathVariable String key,
@RequestBody(required = false) String value
) throws IOException
{
SessionEntry session = authFilter.handle(request, response);
if (session == null)
{
return;
}
if (!configService.setKey(session.getUser(), key, value))
{
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}
@RequestMapping(path = "/{key:.+}", method = DELETE)
public void unsetKey(
HttpServletRequest request,
HttpServletResponse response,
@PathVariable String key
) throws IOException
{
SessionEntry session = authFilter.handle(request, response);
if (session == null)
{
return;
}
if (!configService.unsetKey(session.getUser(), key))
{
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}
}
@@ -0,0 +1,341 @@
/*
* Copyright (c) 2017-2019, 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.http.service.config;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSyntaxException;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import static com.mongodb.client.model.Filters.eq;
import com.mongodb.client.model.IndexOptions;
import com.mongodb.client.model.Indexes;
import com.mongodb.client.model.UpdateOptions;
import static com.mongodb.client.model.Updates.combine;
import static com.mongodb.client.model.Updates.set;
import static com.mongodb.client.model.Updates.unset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
import net.runelite.http.api.RuneLiteAPI;
import net.runelite.http.api.config.ConfigEntry;
import net.runelite.http.api.config.Configuration;
import org.bson.Document;
import org.bson.conversions.Bson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@Service
public class ConfigService
{
private static final int MAX_DEPTH = 8;
private static final int MAX_VALUE_LENGTH = 262144;
private final Gson GSON = RuneLiteAPI.GSON;
private final UpdateOptions upsertUpdateOptions = new UpdateOptions().upsert(true);
private final MongoCollection<Document> mongoCollection;
@Autowired
public ConfigService(
MongoClient mongoClient,
@Value("${mongo.database}") String databaseName
)
{
MongoDatabase database = mongoClient.getDatabase(databaseName);
MongoCollection<Document> collection = database.getCollection("config");
this.mongoCollection = collection;
// Create unique index on _userId
IndexOptions indexOptions = new IndexOptions().unique(true);
collection.createIndex(Indexes.ascending("_userId"), indexOptions);
}
private Document getConfig(int userId)
{
return mongoCollection.find(eq("_userId", userId)).first();
}
public Configuration get(int userId)
{
Map<String, Object> configMap = getConfig(userId);
if (configMap == null || configMap.isEmpty())
{
return new Configuration(Collections.emptyList());
}
List<ConfigEntry> config = new ArrayList<>();
for (String group : configMap.keySet())
{
// Reserved keys
if (group.startsWith("_") || group.startsWith("$"))
{
continue;
}
Map<String, Object> groupMap = (Map) configMap.get(group);
for (Map.Entry<String, Object> entry : groupMap.entrySet())
{
String key = entry.getKey();
Object value = entry.getValue();
if (value instanceof Map || value instanceof Collection)
{
value = GSON.toJson(entry.getValue());
}
else if (value == null)
{
continue;
}
ConfigEntry configEntry = new ConfigEntry();
configEntry.setKey(group + "." + key.replace(':', '.'));
configEntry.setValue(value.toString());
config.add(configEntry);
}
}
return new Configuration(config);
}
public List<String> patch(int userID, Configuration config)
{
List<String> failures = new ArrayList<>();
List<Bson> sets = new ArrayList<>(config.getConfig().size());
for (ConfigEntry entry : config.getConfig())
{
Bson s = setForKV(entry.getKey(), entry.getValue());
if (s == null)
{
failures.add(entry.getKey());
}
else
{
sets.add(s);
}
}
if (sets.size() > 0)
{
mongoCollection.updateOne(
eq("_userId", userID),
combine(sets),
upsertUpdateOptions
);
}
return failures;
}
@Nullable
private Bson setForKV(String key, @Nullable String value)
{
if (key.startsWith("$") || key.startsWith("_"))
{
return null;
}
String[] split = key.split("\\.", 2);
if (split.length != 2)
{
return null;
}
String dbKey = split[0] + "." + split[1].replace('.', ':');
if (Strings.isNullOrEmpty(value))
{
return unset(dbKey);
}
if (!validateJson(value))
{
return null;
}
Object jsonValue = parseJsonString(value);
return set(dbKey, jsonValue);
}
public boolean setKey(
int userId,
String key,
@Nullable String value
)
{
Bson set = setForKV(key, value);
if (set == null)
{
return false;
}
mongoCollection.updateOne(eq("_userId", userId),
set,
upsertUpdateOptions);
return true;
}
public boolean unsetKey(
int userId,
String key
)
{
Bson set = setForKV(key, null);
if (set == null)
{
return false;
}
mongoCollection.updateOne(eq("_userId", userId), set);
return true;
}
@VisibleForTesting
static Object parseJsonString(String value)
{
Object jsonValue;
try
{
jsonValue = RuneLiteAPI.GSON.fromJson(value, Object.class);
if (jsonValue == null)
{
return value;
}
else if (jsonValue instanceof Double || jsonValue instanceof Float)
{
Number number = (Number) jsonValue;
if (Math.floor(number.doubleValue()) == number.doubleValue() && !Double.isInfinite(number.doubleValue()))
{
// value is an int or long. 'number' might be truncated so parse it from 'value'
try
{
jsonValue = Integer.parseInt(value);
}
catch (NumberFormatException ex)
{
try
{
jsonValue = Long.parseLong(value);
}
catch (NumberFormatException ex2)
{
}
}
}
}
}
catch (JsonSyntaxException ex)
{
jsonValue = value;
}
return jsonValue;
}
@VisibleForTesting
static boolean validateJson(String value)
{
try
{
// I couldn't figure out a better way to do this than a second json parse
JsonElement jsonElement = RuneLiteAPI.GSON.fromJson(value, JsonElement.class);
if (jsonElement == null)
{
return value.length() < MAX_VALUE_LENGTH;
}
return validateObject(jsonElement, 1);
}
catch (JsonSyntaxException ex)
{
// the client submits the string representation of objects which is not always valid json,
// eg. a value with a ':' in it. We just ignore it now. We can't json encode the values client
// side due to them already being strings, which prevents gson from being able to convert them
// to ints/floats/maps etc.
return value.length() < MAX_VALUE_LENGTH;
}
}
private static boolean validateObject(JsonElement jsonElement, int depth)
{
if (depth >= MAX_DEPTH)
{
return false;
}
if (jsonElement.isJsonObject())
{
JsonObject jsonObject = jsonElement.getAsJsonObject();
for (Map.Entry<String, JsonElement> entry : jsonObject.entrySet())
{
JsonElement element = entry.getValue();
if (!validateObject(element, depth + 1))
{
return false;
}
}
}
else if (jsonElement.isJsonArray())
{
JsonArray jsonArray = jsonElement.getAsJsonArray();
for (int i = 0; i < jsonArray.size(); ++i)
{
JsonElement element = jsonArray.get(i);
if (!validateObject(element, depth + 1))
{
return false;
}
}
}
else if (jsonElement.isJsonPrimitive())
{
JsonPrimitive jsonPrimitive = jsonElement.getAsJsonPrimitive();
String value = jsonPrimitive.getAsString();
if (value.length() >= MAX_VALUE_LENGTH)
{
return false;
}
}
return true;
}
}
@@ -0,0 +1,158 @@
/*
* Copyright (c) 2019, 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.http.service.ge;
import com.google.gson.Gson;
import java.io.IOException;
import java.time.Instant;
import java.util.Collection;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.runelite.http.api.RuneLiteAPI;
import net.runelite.http.api.ge.GrandExchangeTrade;
import net.runelite.http.service.account.AuthFilter;
import net.runelite.http.service.account.beans.SessionEntry;
import net.runelite.http.service.util.redis.RedisPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.Jedis;
@RestController
@RequestMapping("/ge")
public class GrandExchangeController
{
private static final Gson GSON = RuneLiteAPI.GSON;
private final GrandExchangeService grandExchangeService;
private final AuthFilter authFilter;
private final RedisPool redisPool;
@Autowired
public GrandExchangeController(GrandExchangeService grandExchangeService, AuthFilter authFilter, RedisPool redisPool)
{
this.grandExchangeService = grandExchangeService;
this.authFilter = authFilter;
this.redisPool = redisPool;
}
@PostMapping
public void submit(HttpServletRequest request, HttpServletResponse response, @RequestBody GrandExchangeTrade grandExchangeTrade) throws IOException
{
SessionEntry session = null;
if (request.getHeader(RuneLiteAPI.RUNELITE_AUTH) != null)
{
session = authFilter.handle(request, response);
if (session == null)
{
// error is set here on the response, so we shouldn't continue
return;
}
}
Integer userId = session == null ? null : session.getUser();
// We don't keep track of pending trades in the web UI, so only add cancelled or completed trades
if (userId != null &&
grandExchangeTrade.getQty() > 0 &&
(grandExchangeTrade.isCancel() || grandExchangeTrade.getQty() == grandExchangeTrade.getTotal()))
{
grandExchangeService.add(userId, grandExchangeTrade);
}
Trade trade = new Trade();
trade.setBuy(grandExchangeTrade.isBuy());
trade.setCancel(grandExchangeTrade.isCancel());
trade.setLogin(grandExchangeTrade.isLogin());
trade.setItemId(grandExchangeTrade.getItemId());
trade.setQty(grandExchangeTrade.getQty());
trade.setDqty(grandExchangeTrade.getDqty());
trade.setTotal(grandExchangeTrade.getTotal());
trade.setSpent(grandExchangeTrade.getDspent());
trade.setOffer(grandExchangeTrade.getOffer());
trade.setSlot(grandExchangeTrade.getSlot());
trade.setTime((int) (System.currentTimeMillis() / 1000L));
trade.setMachineId(request.getHeader(RuneLiteAPI.RUNELITE_MACHINEID));
trade.setUserId(userId);
trade.setIp(request.getHeader("X-Forwarded-For"));
trade.setUa(request.getHeader("User-Agent"));
trade.setWorldType(grandExchangeTrade.getWorldType());
trade.setSeq(grandExchangeTrade.getSeq());
Instant resetTime = grandExchangeTrade.getResetTime();
trade.setResetTime(resetTime == null ? 0L : resetTime.getEpochSecond());
String json = GSON.toJson(trade);
try (Jedis jedis = redisPool.getResource())
{
jedis.publish("ge", json);
}
}
@GetMapping
public Collection<GrandExchangeTradeHistory> get(HttpServletRequest request, HttpServletResponse response,
@RequestParam(required = false, defaultValue = "1024") int limit,
@RequestParam(required = false, defaultValue = "0") int offset) throws IOException
{
SessionEntry session = authFilter.handle(request, response);
if (session == null)
{
return null;
}
return grandExchangeService.get(session.getUser(), limit, offset).stream()
.map(GrandExchangeController::convert)
.collect(Collectors.toList());
}
private static GrandExchangeTradeHistory convert(TradeEntry tradeEntry)
{
GrandExchangeTradeHistory grandExchangeTrade = new GrandExchangeTradeHistory();
grandExchangeTrade.setBuy(tradeEntry.getAction() == TradeAction.BUY);
grandExchangeTrade.setItemId(tradeEntry.getItem());
grandExchangeTrade.setQuantity(tradeEntry.getQuantity());
grandExchangeTrade.setPrice(tradeEntry.getPrice());
grandExchangeTrade.setTime(tradeEntry.getTime());
return grandExchangeTrade;
}
@DeleteMapping
public void delete(HttpServletRequest request, HttpServletResponse response) throws IOException
{
SessionEntry session = authFilter.handle(request, response);
if (session == null)
{
return;
}
grandExchangeService.delete(session.getUser());
}
}
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2019, 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.http.service.config;
import com.google.common.collect.ImmutableMap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class ConfigServiceTest
{
@Test
public void testParseJsonString()
{
assertEquals(1, ConfigService.parseJsonString("1"));
assertEquals(3.14, ConfigService.parseJsonString("3.14"));
assertEquals(1L << 32, ConfigService.parseJsonString("4294967296"));
assertEquals("test", ConfigService.parseJsonString("test"));
assertEquals("test", ConfigService.parseJsonString("\"test\""));
assertEquals(ImmutableMap.of("key", "value"), ConfigService.parseJsonString("{\"key\": \"value\"}"));
}
@Test
public void testValidateJson()
{
assertTrue(ConfigService.validateJson("1"));
assertTrue(ConfigService.validateJson("3.14"));
assertTrue(ConfigService.validateJson("test"));
assertTrue(ConfigService.validateJson("\"test\""));
assertTrue(ConfigService.validateJson("key:value"));
assertTrue(ConfigService.validateJson("{\"key\": \"value\"}"));
assertTrue(ConfigService.validateJson("\n"));
}
}
@@ -0,0 +1,161 @@
/*
* 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.http.service.hiscore;
import java.io.IOException;
import net.runelite.http.api.hiscore.HiscoreEndpoint;
import net.runelite.http.api.hiscore.HiscoreResult;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class HiscoreServiceTest
{
private static final String RESPONSE = "654683,705,1304518\n"
+ "679419,50,107181\n"
+ "550667,48,85764\n"
+ "861497,50,101366\n"
+ "891591,48,87843\n"
+ "-1,1,4\n"
+ "840255,27,10073\n"
+ "1371912,10,1310\n"
+ "432193,56,199795\n"
+ "495638,56,198304\n"
+ "514466,37,27502\n"
+ "456981,54,159727\n"
+ "459159,49,93010\n"
+ "1028855,8,823\n"
+ "862906,29,12749\n"
+ "795020,31,16097\n"
+ "673591,5,495\n"
+ "352676,51,112259\n"
+ "428419,40,37235\n"
+ "461887,43,51971\n"
+ "598582,1,10\n"
+ "638177,1,0\n"
+ "516239,9,1000\n"
+ "492790,1,0\n"
+ "2,2460\n" // leagues
+ "-1,-1\n"
+ "73,1738\n"
+ "531,1432\n"
+ "324,212\n"
+ "8008,131\n"
+ "1337,911\n"
+ "42,14113\n"
+ "1,777\n"
+ "254,92\n"
+ "-1,-1\n" // lms
+ "1,241\n" // soul wars
+ "24870,37\n"
+ "15020,388\n"
+ "50463,147\n"
+ "-1,-1\n"
+ "92357,1\n"
+ "22758,637\n"
+ "22744,107\n"
+ "-1,-1\n"
+ "20150,17\n"
+ "29400,18\n"
+ "13465,172\n"
+ "1889,581\n"
+ "42891,11\n"
+ "1624,1957\n"
+ "1243,2465\n"
+ "1548,2020\n"
+ "-1,-1\n"
+ "16781,327\n"
+ "19004,149\n"
+ "-1,-1\n"
+ "72046,5\n"
+ "5158,374\n"
+ "20902,279\n"
+ "702,6495\n"
+ "10170,184\n"
+ "8064,202\n"
+ "6936,2\n"
+ "2335,9\n"
+ "-1,-1\n"
+ "-1,-1\n"
+ "19779,22\n"
+ "58283,10\n"
+ "-1,-1\n"
+ "-1,-1\n"
+ "-1,-1\n"
+ "29347,130\n"
+ "723,4\n"
+ "1264,38\n"
+ "44595,4\n"
+ "24820,4\n"
+ "12116,782\n"
+ "2299,724\n"
+ "19301,62\n"
+ "1498,5847\n";
private final MockWebServer server = new MockWebServer();
@Before
public void before() throws IOException
{
server.enqueue(new MockResponse().setBody(RESPONSE));
server.start();
}
@After
public void after() throws IOException
{
server.shutdown();
}
@Test
public void testNormalLookup() throws Exception
{
HiscoreTestService hiscores = new HiscoreTestService(server.url("/"));
HiscoreResult result = hiscores.lookupUsername("zezima", HiscoreEndpoint.NORMAL.getHiscoreURL());
Assert.assertEquals(50, result.getAttack().getLevel());
Assert.assertEquals(159727L, result.getFishing().getExperience());
Assert.assertEquals(492790, result.getConstruction().getRank());
Assert.assertEquals(1432, result.getClueScrollAll().getLevel());
Assert.assertEquals(324, result.getClueScrollBeginner().getRank());
Assert.assertEquals(8008, result.getClueScrollEasy().getRank());
Assert.assertEquals(911, result.getClueScrollMedium().getLevel());
Assert.assertEquals(42, result.getClueScrollHard().getRank());
Assert.assertEquals(777, result.getClueScrollElite().getLevel());
Assert.assertEquals(254, result.getClueScrollMaster().getRank());
Assert.assertEquals(-1, result.getLastManStanding().getLevel());
Assert.assertEquals(241, result.getSoulWarsZeal().getLevel());
Assert.assertEquals(2460, result.getLeaguePoints().getLevel());
Assert.assertEquals(37, result.getAbyssalSire().getLevel());
Assert.assertEquals(92357, result.getCallisto().getRank());
Assert.assertEquals(5847, result.getZulrah().getLevel());
}
}
@@ -0,0 +1,312 @@
package com.openosrs.api.widgets;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum Varbits
{
/*
* Kharedst's Memoirs Teleport Item
*/
KHAREDSTS_MEMOIRS_CHARGES(6035),
/**
* Grand Exchange
*/
GRAND_EXCHANGE_PRICE_PER_ITEM(4398),
/**
* Locked Prayers
* 0-7 = Locked
* 8 = Unlocked
*/
CHIVPIETY_UNLOCKED(3909),
/**
* Locked Prayers
* 0 = Locked
* 1 = Unlocked
*/
RIGOUR_UNLOCKED(5451),
AUGURY_UNLOCKED(5452),
PRESERVE_UNLOCKED(5453),
/**
* Theatre of Blood 1=In Party, 2=Inside/Spectator, 3=Dead Spectating
*/
THEATRE_OF_BLOOD(6440),
BLOAT_DOOR(6447),
/**
* Theatre of Blood orb varbits each number stands for the player's health on a scale of 1-27 (I think), 0 hides the orb
*/
THEATRE_OF_BLOOD_ORB_1(6442),
THEATRE_OF_BLOOD_ORB_2(6443),
THEATRE_OF_BLOOD_ORB_3(6444),
THEATRE_OF_BLOOD_ORB_4(6445),
THEATRE_OF_BLOOD_ORB_5(6446),
/**
* Nightmare Zone
*/
NMZ_ABSORPTION(3956),
NMZ_POINTS(3949),
NMZ_OVERLOAD(3955),
/**
* Pyramid plunder
*/
PYRAMID_PLUNDER_SARCO_OPEN(2362),
PYRAMID_PLUNDER_CHEST_OPEN(2363),
PYRAMID_PLUNDER_ROOM_LOCATION(2365),
PYRAMID_PLUNDER_TIMER(2375),
PYRAMID_PLUNDER_THIEVING_LEVEL(2376),
PYRAMID_PLUNDER_ROOM(2377),
/**
* In the Wilderness
*/
IN_THE_WILDERNESS(5963),
/**
* Kingdom Management
*/
KINGDOM_FAVOR(72),
KINGDOM_COFFER(74),
KINGDOM_WORKERS_WOOD(81),
KINGDOM_WORKERS_HERBS(82),
KINGDOM_WORKERS_FISHING(83),
KINGDOM_WORKERS_MINING(84),
KINGDOM_WORKERS_FISH_COOKED_BUTTON(135), // 0 - Raw, 1 - Cooked
KINGDOM_WORKERS_HARDWOOD(2131),
KINGDOM_WORKERS_FARM(2132),
KINGDOM_WORKERS_HARDWOOD_BUTTON(2133), // 0 - Mahogany, 1 - Teak, 2 - Both
KINGDOM_WORKERS_HERBS_BUTTON(2134), // 0 - Herbs, 1 - Flax
/**
* Varbit used for Slayer reward points
*/
SLAYER_REWARD_POINTS(4068),
/**
* 0 = standard
* 1 = ancients
* 2 = lunars
* 3 = arrceus
**/
SPELLBOOK(4070),
/**
* Bank settings/flags
**/
BANK_NOTE_FLAG(3958),
/**
* Spells being auto-casted
*/
AUTO_CAST_SPELL(276),
/**
* Temple Trekking
*/
TREK_POINTS(1955),
TREK_STARTED(1956),
TREK_EVENT(1958),
TREK_STATUS(6719),
BLOAT_ENTERED_ROOM(6447),
/**
* f2p Quest varbits, these don't hold the completion value.
*/
QUEST_DEMON_SLAYER(2561),
QUEST_GOBLIN_DIPLOMACY(2378),
QUEST_MISTHALIN_MYSTERY(3468),
QUEST_THE_CORSAIR_CURSE(6071),
QUEST_X_MARKS_THE_SPOT(8063),
QUEST_ERNEST_LEVER_A(1788),
QUEST_ERNEST_LEVER_B(1789),
QUEST_ERNEST_LEVER_C(1790),
QUEST_ERNEST_LEVER_D(1791),
QUEST_ERNEST_LEVER_E(1792),
QUEST_ERNEST_LEVER_F(1793),
/**
* member Quest varbits, these don't hold the completion value.
*/
QUEST_ANIMAL_MAGNETISM(3185),
QUEST_BETWEEN_A_ROCK(299),
QUEST_CONTACT(3274),
QUEST_ZOGRE_FLESH_EATERS(487),
QUEST_DARKNESS_OF_HALLOWVALE(2573),
QUEST_DEATH_TO_THE_DORGESHUUN(2258),
QUEST_DESERT_TREASURE(358),
QUEST_DEVIOUS_MINDS(1465),
QUEST_EAGLES_PEAK(2780),
QUEST_ELEMENTAL_WORKSHOP_II(2639),
QUEST_ENAKHRAS_LAMENT(1560),
QUEST_ENLIGHTENED_JOURNEY(2866),
QUEST_THE_EYES_OF_GLOUPHRIE(2497),
QUEST_FAIRYTALE_I_GROWING_PAINS(1803),
QUEST_FAIRYTALE_II_CURE_A_QUEEN(2326),
QUEST_THE_FEUD(334), // 14 = able to pickpocket
QUEST_FORGETTABLE_TALE(822),
QUEST_GARDEN_OF_TRANQUILLITY(961),
QUEST_GHOSTS_AHOY(217),
QUEST_THE_GIANT_DWARF(571),
QUEST_THE_GOLEM(346),
QUEST_HORROR_FROM_THE_DEEP(34),
QUEST_ICTHLARINS_LITTLE_HELPER(418),
QUEST_IN_AID_OF_THE_MYREQUE(1990),
QUEST_THE_LOST_TRIBE(532),
QUEST_LUNAR_DIPLOMACY(2448),
QUEST_MAKING_HISTORY(1383),
QUEST_MOUNTAIN_DAUGHTER(260),
QUEST_MOURNINGS_END_PART_II(1103),
QUEST_MY_ARMS_BIG_ADVENTURE(2790),
QUEST_RATCATCHERS(1404),
QUEST_RECIPE_FOR_DISASTER(1850),
QUEST_RECRUITMENT_DRIVE(657),
QUEST_ROYAL_TROUBLE(2140),
QUEST_THE_SLUG_MENACE(2610),
QUEST_SHADOW_OF_THE_STORM(1372),
QUEST_A_SOULS_BANE(2011),
QUEST_SPIRITS_OF_THE_ELID(1444),
QUEST_SWAN_SONG(2098),
QUEST_A_TAIL_OF_TWO_CATS(1028),
QUEST_TEARS_OF_GUTHIX(451),
QUEST_WANTED(1051),
QUEST_COLD_WAR(3293),
QUEST_THE_FREMENNIK_ISLES(3311),
QUEST_TOWER_OF_LIFE(3337),
QUEST_WHAT_LIES_BELOW(3523),
QUEST_OLAFS_QUEST(3534),
QUEST_ANOTHER_SLICE_OF_HAM(3550),
QUEST_DREAM_MENTOR(3618),
QUEST_GRIM_TALES(2783),
QUEST_KINGS_RANSOM(3888),
QUEST_MONKEY_MADNESS_II(5027),
QUEST_CLIENT_OF_KOUREND(5619),
QUEST_BONE_VOYAGE(5795),
QUEST_THE_QUEEN_OF_THIEVES(6037),
QUEST_THE_DEPTHS_OF_DESPAIR(6027),
QUEST_DRAGON_SLAYER_II(6104),
QUEST_TALE_OF_THE_RIGHTEOUS(6358),
QUEST_A_TASTE_OF_HOPE(6396),
QUEST_MAKING_FRIENDS_WITH_MY_ARM(6528),
QUEST_THE_ASCENT_OF_ARCEUUS(7856),
QUEST_THE_FORSAKEN_TOWER(7796),
//TODO
QUEST_SONG_OF_THE_ELVES(7796),
/**
* mini-quest varbits, these don't hold the completion value.
*/
QUEST_ARCHITECTURAL_ALLIANCE(4982),
QUEST_BEAR_YOUR_SOUL(5078),
QUEST_CURSE_OF_THE_EMPTY_LORD(821),
QUEST_ENCHANTED_KEY(1391),
QUEST_THE_GENERALS_SHADOW(3330),
QUEST_SKIPPY_AND_THE_MOGRES(1344),
QUEST_LAIR_OF_TARN_RAZORLOR(3290),
QUEST_FAMILY_PEST(5347),
QUEST_THE_MAGE_ARENA_II(6067),
//TODO
QUEST_IN_SEARCH_OF_KNOWLEDGE(6067),
/**
* Spellbook filtering (1 = unfiltered, 0 = filtered)
*/
FILTER_SPELLBOOK(6718),
/**
* POH Building mode (1 = yes, 0 = no)
*/
BUILDING_MODE(2176),
/**
* 1 if in game, 0 if not
*/
LMS_IN_GAME(5314),
/**
* Amount of pvp kills in current game
*/
LMS_KILLS(5315),
/**
* The x coordinate of the final safespace (world coord)
*/
LMS_SAFE_X(5316),
LMS_POISON_PROGRESS(5317),
/**
* The y coordinate of the final safespace (world coord)
*/
LMS_SAFE_Y(5320),
/**
* 1 is true, 0 is false.
*/
GAUNTLET_FINAL_ROOM_ENTERED(9177),
/**
* 1 is true, 0 is false.
*/
GAUNTLET_ENTERED(9178),
WITHDRAW_X_AMOUNT(3960),
IN_PVP_AREA(8121),
/**
* Value of hotkey varbits can be 0-13
* 0 corresponds to no hotkey set
* 1-12 correspond to F1-F12 respectively
* 13 corresponds to escape
*/
COMBAT_TAB_HOTKEY(4675),
STATS_TAB_HOTKEY(4676),
QUESTS_TAB_HOTKEY(4677),
INVENTORY_TAB_HOTKEY(4678),
EQUIPMENT_TAB_HOTKEY(4679),
PRAYER_TAB_HOTKEY(4680),
SPELLBOOK_TAB_HOTKEY(4682),
FRIENDS_TAB_HOTKEY(4684),
ACCOUNT_MANAGEMENT_TAB_HOTKEY(6517),
LOGOUT_TAB_HOTKEY(4689),
OPTIONS_TAB_HOTKEY(4686),
EMOTES_TAB_HOTKEY(4687),
CLAN_TAB_HOTKEY(4683),
MUSIC_TAB_HOTKEY(4688),
/**
* Chat Notifications settings
* <br>
* LOOT_DROP_NOTIFICATIONS: 1 is true, 0 is false
* LOOT_DROP_NOTIFICATIONS_VALUE: gp value
* UNTRADEABLE_LOOT_NOTIFICATIONS: 1 is true, 0 is false
* BOSS_KILL_COUNT_UPDATES: 1 is filtered, 0 is unfiltered
* DROP_ITEM_WARNINGS: 1 is true, 0 is false
* DROP_ITEM_WARNINGS_VALUE: gp value
*/
LOOT_DROP_NOTIFICATIONS(5399),
LOOT_DROP_NOTIFICATIONS_VALUE(5400),
UNTRADEABLE_LOOT_NOTIFICATIONS(5402),
BOSS_KILL_COUNT_UPDATES(4930),
DROP_ITEM_WARNINGS(5411),
DROP_ITEM_WARNINGS_VALUE(5412),
PARASITE(10151),
;
/**
* The raw varbit ID.
*/
private final int id;
}
@@ -0,0 +1,673 @@
package com.openosrs.api.widgets;
public class WidgetID extends net.runelite.api.widgets.WidgetID
{
public static final int BANK_PIN_GROUP_ID = 213;
public static final int PLAYER_TRADE_CONFIRM_GROUP_ID = 334;
public static final int PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID = 243;
public static final int DIALOG_MINIGAME_GROUP_ID = 229;
public static final int BA_HORN_OF_GLORY = 484;
public static final int MOTHERLODE_MINE_FULL_INVENTORY_GROUP_ID = 229;
public static final int DIALOG_PLAYER_GROUP_ID = 217;
public static final int DIALOG_NOTIFICATION_GROUP_ID = 229;
public static final int FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID = 608;
public static final int PERFORMERS_FOR_THE_THEATRE_GROUPS_GROUP_ID = 364;
public static final int PERFORMERS_FOR_THE_THEATRE_PLAYERS_GROUP_ID = 50;
public static final int DIALOG_SPRITE2_ID = 11;
public static final int EQUIPMENT_PAGE_GROUP_ID = 84;
public static final int QUESTTAB_GROUP_ID = 629;
public static final int MUSICTAB_GROUP_ID = 239;
public static final int JEWELLERY_BOX_GROUP_ID = 590;
public static final int OPTIONS_GROUP_ID = 261;
public static final int MULTISKILL_MENU_GROUP_ID = 270;
public static final int THEATRE_OF_BLOOD_PARTY_GROUP_ID = 28;
public static final int GWD_KC_GROUP_ID = 406;
public static final int GAUNTLET_MAP_GROUP_ID = 638;
public static final int SETTINGS_SIDE_GROUP_ID = 116;
public static final int SETTINGS_GROUP_ID = 134;
static class SettingsSide
{
static final int CAMERA_ZOOM_SLIDER_TRACK = 59;
static final int MUSIC_SLIDER = 13;
static final int SOUND_EFFECT_SLIDER = 17;
static final int AREA_SOUND_SLIDER = 21;
}
static class Settings
{
static final int INIT = 1;
}
static class DialogPlayer
{
static final int HEAD_MODEL = 1;
static final int NAME = 2;
static final int CONTINUE = 3;
static final int TEXT = 4;
}
static class DialogNotification
{
static final int TEXT = 0;
static final int CONTINUE = 1;
}
static class DialogOption
{
static final int TEXT = 0;
static final int OPTION1 = 1;
static final int OPTION2 = 2;
static final int OPTION3 = 3;
static final int OPTION4 = 4;
static final int OPTION5 = 5;
}
static class PestControlBoat
{
static final int INFO = 3;
static final int NEXT_DEPARTURE = 4;
static final int PLAYERS_READY = 5;
static final int POINTS = 6;
}
static class PestControlExchangeWindow
{
static final int ITEM_LIST = 2;
static final int BOTTOM = 5;
static final int POINTS = 8;
static final int CONFIRM_BUTTON = 6;
}
static class MinigameDialog
{
static final int TEXT = 1;
static final int CONTINUE = 2;
}
static class PestControl
{
static final int INFO = 3;
static final int TIME = 6;
static final int ACTIVITY_BAR = 12;
static final int ACTIVITY_PROGRESS = 14;
static final int PURPLE_SHIELD = 15;
static final int BLUE_SHIELD = 16;
static final int YELLOW_SHIELD = 17;
static final int RED_SHIELD = 18;
static final int PURPLE_ICON = 19;
static final int BLUE_ICON = 20;
static final int YELLOW_ICON = 21;
static final int RED_ICON = 22;
static final int PURPLE_HEALTH = 23;
static final int BLUE_HEALTH = 24;
static final int YELLOW_HEALTH = 25;
static final int RED_HEALTH = 26;
}
static class Bank
{
static final int BANK_CONTAINER = 1;
static final int INVENTORY_ITEM_CONTAINER = 3;
static final int BANK_TITLE_BAR = 3;
static final int TUTORIAL_BUTTON = 4;
static final int ITEM_COUNT_TOP = 5;
static final int ITEM_COUNT_BAR = 6;
static final int ITEM_COUNT_BOTTOM = 7;
static final int CONTENT_CONTAINER = 9;
static final int TAB_CONTAINER = 10;
static final int ITEM_CONTAINER = 12;
static final int SCROLLBAR = 13;
static final int UNNOTED_BUTTON = 21;
static final int NOTED_BUTTON = 23;
static final int SEARCH_BUTTON_BACKGROUND = 39;
static final int DEPOSIT_INVENTORY = 41;
static final int DEPOSIT_EQUIPMENT = 43;
static final int INCINERATOR = 45;
static final int INCINERATOR_CONFIRM = 46;
static final int EQUIPMENT_CONTENT_CONTAINER = 68;
static final int SETTINGS_BUTTON = 111;
static final int EQUIPMENT_BUTTON = 112;
}
static class GrandExchange
{
static final int WINDOW_CONTAINER = 0;
static final int WINDOW_BORDERS = 2;
static final int HISTORY_BUTTON = 3;
static final int BACK_BUTTON = 4;
static final int OFFER1 = 7;
static final int OFFER2 = 8;
static final int OFFER3 = 9;
static final int OFFER4 = 10;
static final int OFFER5 = 11;
static final int OFFER6 = 12;
static final int OFFER7 = 13;
static final int OFFER8 = 14;
static final int OFFER_CONTAINER = 24;
static final int OFFER_DESCRIPTION = 25;
static final int OFFER_PRICE = 26;
static final int OFFER_CONFIRM_BUTTON = 27;
}
static class Shop
{
static final int ITEMS_CONTAINER = 2;
static final int INVENTORY_ITEM_CONTAINER = 0;
}
static class Smithing
{
static final int INVENTORY_ITEM_CONTAINER = 0;
static final int QTY_1 = 3;
static final int QTY_5 = 4;
static final int QTY_10 = 5;
static final int QTY_X = 6;
static final int QTY_ALL = 7;
static final int DAGGER = 9;
static final int SWORD = 10;
static final int SCIMITAR = 11;
static final int LONG_SWORD = 12;
static final int TWO_H_SWORD = 13;
static final int AXE = 14;
static final int MACE = 15;
static final int WARHAMMER = 16;
static final int BATTLE_AXE = 17;
static final int CLAWS = 18;
static final int CHAIN_BODY = 19;
static final int PLATE_LEGS = 20;
static final int PLATE_SKIRT = 21;
static final int PLATE_BODY = 22;
static final int NAILS = 23;
static final int MED_HELM = 24;
static final int FULL_HELM = 25;
static final int SQ_SHIELD = 26;
static final int KITE_SHIELD = 27;
static final int EXCLUSIVE1 = 28;
static final int DART_TIPS = 29;
static final int ARROW_HEADS = 30;
static final int KNIVES = 31;
static final int EXCLUSIVE2 = 32;
static final int JAVELIN_HEADS = 33;
static final int BOLTS = 34;
static final int LIMBS = 35;
}
static class Equipment
{
static final int HELMET = 14;
static final int CAPE = 15;
static final int AMULET = 16;
static final int WEAPON = 17;
static final int BODY = 18;
static final int SHIELD = 19;
static final int LEGS = 20;
static final int GLOVES = 21;
static final int BOOTS = 22;
static final int RING = 23;
static final int AMMO = 24;
static final int INVENTORY_ITEM_CONTAINER = 0;
}
static class Minimap
{
static final int XP_ORB = 1;
static final int HEALTH_ORB = 2;
static final int PRAYER_ORB = 12;
static final int QUICK_PRAYER_ORB = 14; // Has the "Quick-prayers" name
static final int PRAYER_ORB_TEXT = 15;
static final int RUN_ORB = 20;
static final int TOGGLE_RUN_ORB = 22; // Has the "Toggle run" name
static final int RUN_ORB_TEXT = 23;
static final int SPEC_ORB = 28;
static final int SPEC_CLICKBOX = 30;
static final int WORLDMAP_ORB = 41;
static final int WIKI_BANNER = 43;
}
static class Combat
{
static final int WEAPON_NAME = 1;
static final int LEVEL = 3;
static final int STYLE_ONE = 4;
static final int STYLE_TWO = 8;
static final int STYLE_THREE = 12;
static final int STYLE_FOUR = 16;
static final int SPELLS = 20;
static final int DEFENSIVE_SPELL_BOX = 21;
static final int DEFENSIVE_SPELL_ICON = 23;
static final int DEFENSIVE_SPELL_SHIELD = 24;
static final int DEFENSIVE_SPELL_TEXT = 25;
static final int SPELL_BOX = 26;
static final int SPELL_ICON = 28;
static final int SPELL_TEXT = 29;
static final int AUTO_RETALIATE = 30;
static final int SPECIAL_ATTACK_BAR = 34;
static final int SPECIAL_ATTACK_CLICKBOX = 36;
static final int TOOLTIP = 41;
}
static class BarbarianAssault
{
static class ATK
{
static final int LISTEN_TOP = 7;
static final int LISTEN_BOTTOM = 8;
static final int TO_CALL_WIDGET = 9;
static final int TO_CALL = 10;
static final int ROLE_SPRITE = 11;
static final int ROLE = 12;
}
static class HLR
{
static final int TEAMMATE1 = 18;
static final int TEAMMATE2 = 22;
static final int TEAMMATE3 = 26;
static final int TEAMMATE4 = 30;
}
static class HORN_GLORY
{
static final int ATTACKER = 5;
static final int DEFENDER = 6;
static final int COLLECTOR = 7;
static final int HEALER = 8;
}
static class REWARD_VALUES
{
static final int RUNNERS_PASSED = 14;
static final int HITPOINTS_REPLENISHED = 19;
static final int WRONG_POISON_PACKS_USED = 20;
static final int EGGS_COLLECTED = 21;
static final int FAILED_ATTACKER_ATTACKS = 22;
static final int RUNNERS_PASSED_POINTS = 24;
static final int RANGERS_KILLED = 25;
static final int FIGHTERS_KILLED = 26;
static final int HEALERS_KILLED = 27;
static final int RUNNERS_KILLED = 28;
static final int HITPOINTS_REPLENISHED_POINTS = 29;
static final int WRONG_POISON_PACKS_USED_POINTS = 30;
static final int EGGS_COLLECTED_POINTS = 31;
static final int FAILED_ATTACKER_ATTACKS_POINTS = 32;
static final int BASE_POINTS = 33;
static final int HONOUR_POINTS_REWARD = 49;
}
static final int CORRECT_STYLE = 3;
static final int GAME_WIDGET = 3;
static final int CURRENT_WAVE_WIDGET = 4;
static final int CURRENT_WAVE = 5;
static final int LISTEN_WIDGET = 6;
static final int LISTEN = 7;
static final int TO_CALL_WIDGET = 8;
static final int TO_CALL = 9;
static final int ROLE_SPRITE = 10;
static final int ROLE = 11;
static final int REWARD_TEXT = 57;
}
static class LevelUp
{
static final int SKILL = 1;
static final int LEVEL = 2;
static final int CONTINUE = 3;
}
static class TheatreOfBlood
{
static final int RAIDING_PARTY = 9;
static final int ORB_BOX = 10;
static final int BOSS_HEALTH_BAR = 35;
}
static class TheatreOfBloodParty
{
static final int CONTAINER = 10;
}
static class LightBox
{
static final int LIGHT_BOX = 1;
static final int LIGHT_BOX_WINDOW = 2;
static final int LIGHT_BULB_CONTAINER = 3;
static final int LIGHT_BOX_BUTTON_CONTAINER = 6;
static final int BUTTON_A = 8;
static final int BUTTON_B = 9;
static final int BUTTON_C = 10;
static final int BUTTON_D = 11;
static final int BUTTON_E = 12;
static final int BUTTON_F = 13;
static final int BUTTON_G = 14;
static final int BUTTON_H = 15;
}
static class EquipmentWidgetIdentifiers
{
static final int EQUIP_YOUR_CHARACTER = 3;
static final int STAB_ATTACK_BONUS = 24;
static final int SLASH_ATTACK_BONUS = 25;
static final int CRUSH_ATTACK_BONUS = 26;
static final int MAGIC_ATTACK_BONUS = 27;
static final int RANGED_ATTACK_BONUS = 28;
static final int STAB_DEFENCE_BONUS = 30;
static final int SLASH_DEFENCE_BONUS = 31;
static final int CRUSH_DEFENCE_BONUS = 32;
static final int MAGIC_DEFENCE_BONUS = 33;
static final int RANGED_DEFENCE_BONUS = 34;
static final int MELEE_STRENGTH = 36;
static final int RANGED_STRENGTH = 37;
static final int MAGIC_DAMAGE = 38;
static final int PRAYER_BONUS = 39;
static final int UNDEAD_DAMAGE_BONUS = 41;
static final int SLAYER_DAMAGE_BONUS = 42;
static final int WEIGHT = 49;
}
static class WorldSwitcher
{
static final int CONTAINER = 1;
static final int WORLD_LIST = 16;
static final int LOGOUT_BUTTON = 23;
}
static class FossilMushroomTeleport
{
static final int ROOT = 2;
static final int HOUSE_ON_HILL = 4;
static final int VERDANT_VALLEY = 8;
static final int SWAMP = 12;
static final int MUSHROOM_MEADOW = 16;
}
static class SpellBook
{
static final int FILTERED_SPELLS_BOUNDS = 3;
static final int TOOLTIP = 189;
// NORMAL SPELLS
static final int LUMBRIDGE_HOME_TELEPORT = 5;
static final int WIND_STRIKE = 6;
static final int CONFUSE = 7;
static final int ENCHANT_CROSSBOW_BOLT = 8;
static final int WATER_STRIKE = 9;
static final int LVL_1_ENCHANT = 10;
static final int EARTH_STRIKE = 11;
static final int WEAKEN = 12;
static final int FIRE_STRIKE = 13;
static final int BONES_TO_BANANAS = 14;
static final int WIND_BOLT = 15;
static final int CURSE = 16;
static final int BIND = 17;
static final int LOW_LEVEL_ALCHEMY = 18;
static final int WATER_BOLT = 19;
static final int VARROCK_TELEPORT = 20;
static final int LVL_2_ENCHANT = 21;
static final int EARTH_BOLT = 22;
static final int LUMBRIDGE_TELEPORT = 23;
static final int TELEKINETIC_GRAB = 24;
static final int FIRE_BOLT = 25;
static final int FALADOR_TELEPORT = 26;
static final int CRUMBLE_UNDEAD = 27;
static final int TELEPORT_TO_HOUSE = 28;
static final int WIND_BLAST = 29;
static final int SUPERHEAT_ITEM = 30;
static final int CAMELOT_TELEPORT = 31;
static final int WATER_BLAST = 32;
static final int LVL_3_ENCHANT = 33;
static final int IBAN_BLAST = 34;
static final int SNARE = 35;
static final int MAGIC_DART = 36;
static final int ARDOUGNE_TELEPORT = 37;
static final int EARTH_BLAST = 38;
static final int HIGH_LEVEL_ALCHEMY = 39;
static final int CHARGE_WATER_ORB = 40;
static final int LVL_4_ENCHANT = 41;
static final int WATCHTOWER_TELEPORT = 42;
static final int FIRE_BLAST = 43;
static final int CHARGE_EARTH_ORB = 44;
static final int BONES_TO_PEACHES = 45;
static final int SARADOMIN_STRIKE = 46;
static final int CLAWS_OF_GUTHIX = 47;
static final int FLAMES_OF_ZAMORAK = 48;
static final int TROLLHEIM_TELEPORT = 49;
static final int WIND_WAVE = 50;
static final int CHARGE_FIRE_ORB = 51;
static final int TELEPORT_TO_APE_ATOLL = 52;
static final int WATER_WAVE = 53;
static final int CHARGE_AIR_ORB = 54;
static final int VULNERABILITY = 55;
static final int LVL_5_ENCHANT = 56;
static final int TELEPORT_TO_KOUREND = 57;
static final int EARTH_WAVE = 58;
static final int ENFEEBLE = 59;
static final int TELEOTHER_LUMBRIDGE = 60;
static final int FIRE_WAVE = 61;
static final int ENTANGLE = 62;
static final int STUN = 63;
static final int CHARGE = 64;
static final int WIND_SURGE = 65;
static final int TELEOTHER_FALADOR = 66;
static final int WATER_SURGE = 67;
static final int TELE_BLOCK = 68;
static final int BOUNTY_TARGET_TELEPORT = 69;
static final int LVL_6_ENCHANT = 70;
static final int TELEOTHER_CAMELOT = 71;
static final int EARTH_SURGE = 72;
static final int LVL_7_ENCHANT = 73;
static final int FIRE_SURGE = 74;
// ANCIENT SPELLS
static final int ICE_RUSH = 75;
static final int ICE_BLITZ = 76;
static final int ICE_BURST = 77;
static final int ICE_BARRAGE = 78;
static final int BLOOD_RUSH = 79;
static final int BLOOD_BLITZ = 80;
static final int BLOOD_BURST = 81;
static final int BLOOD_BARRAGE = 82;
static final int SMOKE_RUSH = 83;
static final int SMOKE_BLITZ = 84;
static final int SMOKE_BURST = 85;
static final int SMOKE_BARRAGE = 86;
static final int SHADOW_RUSH = 87;
static final int SHADOW_BLITZ = 88;
static final int SHADOW_BURST = 89;
static final int SHADOW_BARRAGE = 90;
static final int PADDEWWA_TELEPORT = 91;
static final int SENNTISTEN_TELEPORT = 92;
static final int KHARYRLL_TELEPORT = 93;
static final int LASSAR_TELEPORT = 94;
static final int DAREEYAK_TELEPORT = 95;
static final int CARRALLANGER_TELEPORT = 96;
static final int ANNAKARL_TELEPORT = 97;
static final int GHORROCK_TELEPORT = 98;
static final int EDGEVILLE_HOME_TELEPORT = 99;
// LUNAR SPELLS
static final int LUNAR_HOME_TELEPORT = 100;
static final int BAKE_PIE = 101;
static final int CURE_PLANT = 102;
static final int MONSTER_EXAMINE = 103;
static final int NPC_CONTACT = 104;
static final int CURE_OTHER = 105;
static final int HUMIDIFY = 106;
static final int MOONCLAN_TELEPORT = 107;
static final int TELE_GROUP_MOONCLAN = 108;
static final int CURE_ME = 109;
static final int HUNTER_KIT = 110;
static final int WATERBIRTH_TELEPORT = 111;
static final int TELE_GROUP_WATERBIRTH = 112;
static final int CURE_GROUP = 113;
static final int STAT_SPY = 114;
static final int BARBARIAN_TELEPORT = 115;
static final int TELE_GROUP_BARBARIAN = 116;
static final int SUPERGLASS_MAKE = 117;
static final int TAN_LEATHER = 118;
static final int KHAZARD_TELEPORT = 119;
static final int TELE_GROUP_KHAZARD = 120;
static final int DREAM = 121;
static final int STRING_JEWELLERY = 122;
static final int STAT_RESTORE_POT_SHARE = 123;
static final int MAGIC_IMBUE = 124;
static final int FERTILE_SOIL = 125;
static final int BOOST_POTION_SHARE = 126;
static final int FISHING_GUILD_TELEPORT = 127;
static final int TELE_GROUP_FISHING_GUILD = 128;
static final int PLANK_MAKE = 129;
static final int CATHERBY_TELEPORT = 130;
static final int TELE_GROUP_CATHERBY = 131;
static final int RECHARGE_DRAGONSTONE = 132;
static final int ICE_PLATEAU_TELEPORT = 133;
static final int TELE_GROUP_ICE_PLATEAU = 134;
static final int ENERGY_TRANSFER = 135;
static final int HEAL_OTHER = 136;
static final int VENGEANCE_OTHER = 137;
static final int VENGEANCE = 138;
static final int HEAL_GROUP = 139;
static final int SPELLBOOK_SWAP = 140;
static final int GEOMANCY = 141;
static final int SPIN_FLAX = 142;
static final int OURANIA_TELEPORT = 143;
// ARCEUUS SPELLS
static final int ARCEUUS_HOME_TELEPORT = 144;
static final int BATTLEFRONT_TELEPORT = 179;
// HEADS
static final int REANIMATE_GOBLIN = 145;
static final int REANIMATE_MONKEY = 147;
static final int REANIMATE_IMP = 148;
static final int REANIMATE_MINOTAUR = 149;
static final int REANIMATE_SCORPION = 151;
static final int REANIMATE_BEAR = 152;
static final int REANIMATE_UNICORN = 153;
static final int REANIMATE_DOG = 154;
static final int REANIMATE_CHAOS_DRUID = 156;
static final int REANIMATE_GIANT = 158;
static final int REANIMATE_OGRE = 160;
static final int REANIMATE_ELF = 161;
static final int REANIMATE_TROLL = 162;
static final int REANIMATE_HORROR = 164;
static final int REANIMATE_KALPHITE = 165;
static final int REANIMATE_DAGANNOTH = 167;
static final int REANIMATE_BLOODVELD = 168;
static final int REANIMATE_TZHAAR = 170;
static final int REANIMATE_DEMON = 172;
static final int REANIMATE_AVIANSIE = 173;
static final int REANIMATE_ABYSSAL = 176;
static final int REANIMATE_DRAGON = 178;
}
static class Pvp
{
static final int FOG_OVERLAY = 1;
static final int PVP_WIDGET_CONTAINER = 54; // OUTDATED?
static final int SKULL = 56; // OUTDATED?
static final int ATTACK_RANGE = 59; // OUTDATED?
static final int BOUNTY_HUNTER_INFO = 6;
static final int KILLDEATH_RATIO = 28;
static final int SKULL_CONTAINER = 48;
static final int SAFE_ZONE = 50;
static final int WILDERNESS_LEVEL = 53; // this can also be the Deadman Mode "Protection" text
}
static class DialogSprite2
{
static final int SPRITE1 = 1;
static final int TEXT = 2;
static final int SPRITE2 = 3;
static final int CONTINUE = 4;
}
static class QuestTab
{
static final int QUEST_TAB = 3;
}
public static class TradeScreen
{
public static final int FIRST_TRADING_WITH = 31;
public static final int SECOND_ACCEPT_FUNC = 13;
public static final int SECOND_DECLINE_FUNC = 14;
public static final int SECOND_MY_OFFER = 23;
public static final int SECOND_THEIR_OFFER = 24;
public static final int SECOND_ACCEPT_TEXT = 25;
public static final int SECOND_DECLINE_TEXT = 26;
public static final int SECOND_MY_ITEMS = 28;
public static final int SECOND_THEIR_ITEMS = 29;
public static final int SECOND_TRADING_WITH = 30;
}
public static class DuelConfig
{
public static final int CONFIG_GROUP_IP = 482;
public static final int TITLE = 35;
public static final int OPPONENT_ATT = 9;
public static final int OPPONENT_STR = 13;
public static final int OPPONENT_DEF = 17;
public static final int OPPONENT_HP = 21;
}
public static class DuelResult
{
public static final int RESULT_GROUP_ID = 372;
public static final int TITLE = 16;
public static final int TOTAL_STAKED = 32;
public static final int TOTAL_TAX = 39;
public static final int WINNINGS = 40;
}
// Also used for many other interfaces!
static class BankPin
{
static final int CONTAINER = 0;
static final int TOP_LEFT_TEXT = 2;
static final int FIRST_ENTERED = 3;
static final int SECOND_ENTERED = 4;
static final int THIRD_ENTERED = 5;
static final int FOURTH_ENTERED = 6;
static final int INSTRUCTION_TEXT = 10;
static final int EXIT_BUTTON = 13;
static final int FORGOT_BUTTON = 15;
static final int BUTTON_1 = 16;
static final int BUTTON_2 = 18;
static final int BUTTON_3 = 20;
static final int BUTTON_4 = 22;
static final int BUTTON_5 = 24;
static final int BUTTON_6 = 26;
static final int BUTTON_7 = 28;
static final int BUTTON_8 = 30;
static final int BUTTON_9 = 32;
static final int BUTTON_10 = 34;
}
static class JewelBox
{
static final int DUEL_RING = 2;
static final int GAME_NECK = 3;
static final int COMB_BRAC = 4;
static final int SKIL_NECK = 5;
static final int RING_OFGP = 6;
static final int AMUL_GLOR = 7; // yes
}
static class Options
{
static final int CAMERA_ZOOM_SLIDER_HANDLE = 15;
static final int MUSIC_SLIDER = 37;
static final int SOUND_EFFECT_SLIDER = 43;
static final int AREA_SOUND_SLIDER = 49;
}
static class GauntletMap
{
static final int CONTAINER = 4;
}
}
@@ -0,0 +1,488 @@
package com.openosrs.api.widgets;
public enum WidgetInfo
{
WORLD_MAP_BUTTON_BORDER(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.WORLDMAP_ORB),
EQUIPMENT_HELMET(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.HELMET),
EQUIPMENT_CAPE(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.CAPE),
EQUIPMENT_AMULET(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.AMULET),
EQUIPMENT_WEAPON(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.WEAPON),
EQUIPMENT_BODY(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.BODY),
EQUIPMENT_SHIELD(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.SHIELD),
EQUIPMENT_LEGS(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.LEGS),
EQUIPMENT_GLOVES(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.GLOVES),
EQUIPMENT_BOOTS(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.BOOTS),
EQUIPMENT_RING(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.RING),
EQUIPMENT_AMMO(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.AMMO),
MINIGAME_DIALOG(WidgetID.DIALOG_MINIGAME_GROUP_ID, 0),
MINIGAME_DIALOG_TEXT(WidgetID.DIALOG_MINIGAME_GROUP_ID, WidgetID.MinigameDialog.TEXT),
MINIGAME_DIALOG_CONTINUE(WidgetID.DIALOG_MINIGAME_GROUP_ID, WidgetID.MinigameDialog.CONTINUE),
PEST_CONTROL_EXCHANGE_WINDOW(WidgetID.PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID, 0),
PEST_CONTROL_EXCHANGE_WINDOW_POINTS(WidgetID.PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID, WidgetID.PestControlExchangeWindow.POINTS),
PEST_CONTROL_BOAT_INFO_POINTS(WidgetID.PEST_CONTROL_BOAT_GROUP_ID, WidgetID.PestControlBoat.POINTS),
PEST_CONTROL_INFO_TIME(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.TIME),
BANK_UNNOTED_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.UNNOTED_BUTTON),
BANK_NOTED_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.NOTED_BUTTON),
GRAND_EXCHANGE_HISTORY_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.HISTORY_BUTTON),
GRAND_EXCHANGE_BACK_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.BACK_BUTTON),
GRAND_EXCHANGE_OFFER1(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER1),
GRAND_EXCHANGE_OFFER2(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER2),
GRAND_EXCHANGE_OFFER3(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER3),
GRAND_EXCHANGE_OFFER4(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER4),
GRAND_EXCHANGE_OFFER5(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER5),
GRAND_EXCHANGE_OFFER6(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER6),
GRAND_EXCHANGE_OFFER7(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER7),
GRAND_EXCHANGE_OFFER8(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER8),
GRAND_EXCHANGE_OFFER_CONFIRM_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER_CONFIRM_BUTTON),
SMITHING_ANVIL_DAGGER(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.DAGGER),
SMITHING_ANVIL_SWORD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.SWORD),
SMITHING_ANVIL_SCIMITAR(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.SCIMITAR),
SMITHING_ANVIL_LONG_SWORD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.LONG_SWORD),
SMITHING_ANVIL_TWO_H_SWORD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.TWO_H_SWORD),
SMITHING_ANVIL_AXE(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.AXE),
SMITHING_ANVIL_MACE(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.MACE),
SMITHING_ANVIL_WARHAMMER(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.WARHAMMER),
SMITHING_ANVIL_BATTLE_AXE(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.BATTLE_AXE),
SMITHING_ANVIL_CLAWS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.CLAWS),
SMITHING_ANVIL_CHAIN_BODY(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.CHAIN_BODY),
SMITHING_ANVIL_PLATE_LEGS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.PLATE_LEGS),
SMITHING_ANVIL_PLATE_SKIRT(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.PLATE_SKIRT),
SMITHING_ANVIL_PLATE_BODY(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.PLATE_BODY),
SMITHING_ANVIL_NAILS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.NAILS),
SMITHING_ANVIL_MED_HELM(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.MED_HELM),
SMITHING_ANVIL_FULL_HELM(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.FULL_HELM),
SMITHING_ANVIL_SQ_SHIELD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.SQ_SHIELD),
SMITHING_ANVIL_KITE_SHIELD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.KITE_SHIELD),
SMITHING_ANVIL_DART_TIPS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.DART_TIPS),
SMITHING_ANVIL_ARROW_HEADS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.ARROW_HEADS),
SMITHING_ANVIL_KNIVES(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.KNIVES),
SMITHING_ANVIL_JAVELIN_HEADS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.JAVELIN_HEADS),
SMITHING_ANVIL_BOLTS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.BOLTS),
SMITHING_ANVIL_LIMBS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.LIMBS),
SMITHING_ANVIL_EXCLUSIVE1(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.EXCLUSIVE1),
SMITHING_ANVIL_EXCLUSIVE2(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.EXCLUSIVE2),
MINIMAP_SPEC_CLICKBOX(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.SPEC_CLICKBOX),
MINIMAP_WORLD_ORB(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.WORLDMAP_ORB),
RESIZABLE_VIEWPORT_BOTTOM_LINE_MAGIC_TAB(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.SPELL_TAB),
COMBAT_WEAPON(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.WEAPON_NAME),
COMBAT_SPECIAL_ATTACK(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPECIAL_ATTACK_BAR),
COMBAT_SPECIAL_ATTACK_CLICKBOX(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPECIAL_ATTACK_CLICKBOX),
COMBAT_TOOLTIP(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.TOOLTIP),
MULTI_SKILL_MENU(WidgetID.MULTISKILL_MENU_GROUP_ID, 0),
DIALOG2_SPRITE(WidgetID.DIALOG_SPRITE2_ID, 0),
DIALOG2_SPRITE_SPRITE1(WidgetID.DIALOG_SPRITE2_ID, WidgetID.DialogSprite2.SPRITE1),
DIALOG2_SPRITE_SPRITE2(WidgetID.DIALOG_SPRITE2_ID, WidgetID.DialogSprite2.SPRITE2),
DIALOG2_SPRITE_TEXT(WidgetID.DIALOG_SPRITE2_ID, WidgetID.DialogSprite2.TEXT),
DIALOG2_SPRITE_CONTINUE(WidgetID.DIALOG_SPRITE2_ID, WidgetID.DialogSprite2.CONTINUE),
DIALOG_PLAYER_NAME(WidgetID.DIALOG_PLAYER_GROUP_ID, WidgetID.DialogPlayer.NAME),
DIALOG_PLAYER_TEXT(WidgetID.DIALOG_PLAYER_GROUP_ID, WidgetID.DialogPlayer.TEXT),
DIALOG_PLAYER_HEAD_MODEL(WidgetID.DIALOG_PLAYER_GROUP_ID, WidgetID.DialogPlayer.HEAD_MODEL),
DIALOG_PLAYER_CONTINUE(WidgetID.DIALOG_PLAYER_GROUP_ID, WidgetID.DialogPlayer.CONTINUE),
DIALOG_NOTIFICATION_TEXT(WidgetID.DIALOG_NOTIFICATION_GROUP_ID, WidgetID.DialogNotification.TEXT),
DIALOG_NOTIFICATION_CONTINUE(WidgetID.DIALOG_NOTIFICATION_GROUP_ID, WidgetID.DialogNotification.CONTINUE),
DIALOG_OPTION_TEXT(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.TEXT),
DIALOG_OPTION_OPTION1(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION1),
DIALOG_OPTION_OPTION2(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION2),
DIALOG_OPTION_OPTION3(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION3),
DIALOG_OPTION_OPTION4(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION4),
DIALOG_OPTION_OPTION5(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION5),
BA_RUNNERS_PASSED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.RUNNERS_PASSED),
BA_HITPOINTS_REPLENISHED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.HITPOINTS_REPLENISHED),
BA_WRONG_POISON_PACKS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.WRONG_POISON_PACKS_USED),
BA_EGGS_COLLECTED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.EGGS_COLLECTED),
BA_FAILED_ATTACKER_ATTACKS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.FAILED_ATTACKER_ATTACKS),
BA_RUNNERS_PASSED_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.RUNNERS_PASSED_POINTS),
BA_RANGERS_KILLED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.RANGERS_KILLED),
BA_FIGHTERS_KILLED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.FIGHTERS_KILLED),
BA_HEALERS_KILLED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.HEALERS_KILLED),
BA_RUNNERS_KILLED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.RUNNERS_KILLED),
BA_HITPOINTS_REPLENISHED_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.HITPOINTS_REPLENISHED_POINTS),
BA_WRONG_POISON_PACKS_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.WRONG_POISON_PACKS_USED_POINTS),
BA_EGGS_COLLECTED_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.EGGS_COLLECTED_POINTS),
BA_FAILED_ATTACKER_ATTACKS_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.FAILED_ATTACKER_ATTACKS_POINTS),
BA_HONOUR_POINTS_REWARD(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.HONOUR_POINTS_REWARD),
BA_BASE_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.BASE_POINTS),
LEVEL_UP_CONTINUE(WidgetID.LEVEL_UP_GROUP_ID, WidgetID.LevelUp.CONTINUE),
THEATRE_OF_BLOOD_PARTY(WidgetID.THEATRE_OF_BLOOD_PARTY_GROUP_ID, WidgetID.TheatreOfBloodParty.CONTAINER),
LIGHT_BOX_BUTTON_CONTAINER(WidgetID.LIGHT_BOX_GROUP_ID, WidgetID.LightBox.LIGHT_BOX_BUTTON_CONTAINER),
THEATRE_OF_BLOOD_HEALTH_ORBS(WidgetID.THEATRE_OF_BLOOD_GROUP_ID, WidgetID.TheatreOfBlood.ORB_BOX),
THEATRE_OF_BLOOD_BOSS_HEALTH(WidgetID.THEATRE_OF_BLOOD_GROUP_ID, WidgetID.TheatreOfBlood.BOSS_HEALTH_BAR),
THEATRE_OF_BLOOD_RAIDING_PARTY(WidgetID.THEATRE_OF_BLOOD_GROUP_ID, WidgetID.TheatreOfBlood.RAIDING_PARTY),
WORLD_SWITCHER_CONTAINER(WidgetID.WORLD_SWITCHER_GROUP_ID, WidgetID.WorldSwitcher.CONTAINER),
WORLD_SWITCHER_LOGOUT_BUTTON(WidgetID.WORLD_SWITCHER_GROUP_ID, WidgetID.WorldSwitcher.LOGOUT_BUTTON),
FOSSIL_MUSHROOM_TELEPORT(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.ROOT),
FOSSIL_MUSHROOM_HOUSE(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.HOUSE_ON_HILL),
FOSSIL_MUSHROOM_VALLEY(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.VERDANT_VALLEY),
FOSSIL_MUSHROOM_SWAMP(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.SWAMP),
FOSSIL_MUSHROOM_MEADOW(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.MUSHROOM_MEADOW),
PVP_SKULL(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL),
PVP_ATTACK_RANGE(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.ATTACK_RANGE),
SPELLBOOK(WidgetID.SPELLBOOK_GROUP_ID, 0),
SPELLBOOK_FILTERED_BOUNDS(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTERED_SPELLS_BOUNDS),
/* STANDARD SPELL BOOK WIDGETS*/
SPELL_LUMBRIDGE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUMBRIDGE_HOME_TELEPORT),
SPELL_WIND_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_STRIKE),
SPELL_CONFUSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CONFUSE),
SPELL_ENCHANT_CROSSBOW_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENCHANT_CROSSBOW_BOLT),
SPELL_WATER_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_STRIKE),
SPELL_LVL_1_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_1_ENCHANT),
SPELL_EARTH_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_STRIKE),
SPELL_WEAKEN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WEAKEN),
SPELL_FIRE_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_STRIKE),
SPELL_BONES_TO_BANANAS(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BONES_TO_BANANAS),
SPELL_WIND_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_BOLT),
SPELL_CURSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURSE),
SPELL_BIND(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BIND),
SPELL_LOW_LEVEL_ALCHEMY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LOW_LEVEL_ALCHEMY),
SPELL_WATER_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_BOLT),
SPELL_VARROCK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VARROCK_TELEPORT),
SPELL_LVL_2_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_2_ENCHANT),
SPELL_EARTH_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_BOLT),
SPELL_LUMBRIDGE_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUMBRIDGE_TELEPORT),
SPELL_TELEKINETIC_GRAB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEKINETIC_GRAB),
SPELL_FIRE_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_BOLT),
SPELL_FALADOR_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FALADOR_TELEPORT),
SPELL_CRUMBLE_UNDEAD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CRUMBLE_UNDEAD),
SPELL_TELEPORT_TO_HOUSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEPORT_TO_HOUSE),
SPELL_WIND_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_BLAST),
SPELL_SUPERHEAT_ITEM(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SUPERHEAT_ITEM),
SPELL_CAMELOT_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CAMELOT_TELEPORT),
SPELL_WATER_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_BLAST),
SPELL_LVL_3_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_3_ENCHANT),
SPELL_IBAN_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.IBAN_BLAST),
SPELL_SNARE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SNARE),
SPELL_MAGIC_DART(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MAGIC_DART),
SPELL_ARDOUGNE_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ARDOUGNE_TELEPORT),
SPELL_EARTH_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_BLAST),
SPELL_HIGH_LEVEL_ALCHEMY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HIGH_LEVEL_ALCHEMY),
SPELL_CHARGE_WATER_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_WATER_ORB),
SPELL_LVL_4_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_4_ENCHANT),
SPELL_WATCHTOWER_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATCHTOWER_TELEPORT),
SPELL_FIRE_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_BLAST),
SPELL_CHARGE_EARTH_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_EARTH_ORB),
SPELL_BONES_TO_PEACHES(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BONES_TO_PEACHES),
SPELL_SARADOMIN_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SARADOMIN_STRIKE),
SPELL_CLAWS_OF_GUTHIX(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CLAWS_OF_GUTHIX),
SPELL_FLAMES_OF_ZAMORAK(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FLAMES_OF_ZAMORAK),
SPELL_TROLLHEIM_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TROLLHEIM_TELEPORT),
SPELL_WIND_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_WAVE),
SPELL_CHARGE_FIRE_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_FIRE_ORB),
SPELL_TELEPORT_TO_APE_ATOLL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEPORT_TO_APE_ATOLL),
SPELL_WATER_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_WAVE),
SPELL_CHARGE_AIR_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_AIR_ORB),
SPELL_VULNERABILITY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VULNERABILITY),
SPELL_LVL_5_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_5_ENCHANT),
SPELL_TELEPORT_TO_KOUREND(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEPORT_TO_KOUREND),
SPELL_EARTH_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_WAVE),
SPELL_ENFEEBLE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENFEEBLE),
SPELL_FIRE_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_WAVE),
SPELL_ENTANGLE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENTANGLE),
SPELL_TELEOTHER_LUMBRIDGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEOTHER_LUMBRIDGE),
SPELL_STUN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STUN),
SPELL_CHARGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE),
SPELL_WIND_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_SURGE),
SPELL_TELEOTHER_FALADOR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEOTHER_FALADOR),
SPELL_WATER_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_SURGE),
SPELL_TELE_BLOCK(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_BLOCK),
SPELL_LVL_6_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_6_ENCHANT),
SPELL_TELEOTHER_CAMELOT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEOTHER_CAMELOT),
SPELL_EARTH_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_SURGE),
SPELL_LVL_7_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_7_ENCHANT),
SPELL_FIRE_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_SURGE),
SPELL_BOUNTY_TARGET_TELEPORT2(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
/* END OF STANDARD SPELL BOOK WIDGETS*/
/* ANCIENT SPELL BOOK WIDGETS*/
SPELL_ICE_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_RUSH),
SPELL_ICE_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_BLITZ),
SPELL_ICE_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_BURST),
SPELL_ICE_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_BARRAGE),
SPELL_BLOOD_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_RUSH),
SPELL_BLOOD_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_BLITZ),
SPELL_BLOOD_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_BURST),
SPELL_BLOOD_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_BARRAGE),
SPELL_SMOKE_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_RUSH),
SPELL_SMOKE_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_BLITZ),
SPELL_SMOKE_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_BURST),
SPELL_SMOKE_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_BARRAGE),
SPELL_SHADOW_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_RUSH),
SPELL_SHADOW_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_BLITZ),
SPELL_SHADOW_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_BURST),
SPELL_SHADOW_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_BARRAGE),
SPELL_PADDEWWA_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.PADDEWWA_TELEPORT),
SPELL_SENNTISTEN_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SENNTISTEN_TELEPORT),
SPELL_KHARYRLL_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.KHARYRLL_TELEPORT),
SPELL_LASSAR_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LASSAR_TELEPORT),
SPELL_DAREEYAK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.DAREEYAK_TELEPORT),
SPELL_CARRALLANGER_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CARRALLANGER_TELEPORT),
SPELL_ANNAKARL_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ANNAKARL_TELEPORT),
SPELL_GHORROCK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GHORROCK_TELEPORT),
SPELL_EDGEVILLE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EDGEVILLE_HOME_TELEPORT),
SPELL_BOUNTY_TARGET_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
/* END OF ANCIENT SPELL BOOK WIDGETS*/
/* LUNAR SPELL BOOK WIDGETS*/
SPELL_LUNAR_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUNAR_HOME_TELEPORT),
SPELL_VENGEANCE_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE_OTHER),
SPELL_VENGEANCE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE),
SPELL_BOUNTY_TARGET_TELEPORT3(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
SPELL_BAKE_PIE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BAKE_PIE),
SPELL_CURE_PLANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_PLANT),
SPELL_MONSTER_EXAMINE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MONSTER_EXAMINE),
SPELL_NPC_CONTACT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.NPC_CONTACT),
SPELL_CURE_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_OTHER),
SPELL_HUMIDIFY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HUMIDIFY),
SPELL_MOONCLAN_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MOONCLAN_TELEPORT),
SPELL_TELE_GROUP_MOONCLAN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_MOONCLAN),
SPELL_CURE_ME(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_ME),
SPELL_HUNTER_KIT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HUNTER_KIT),
SPELL_WATERBIRTH_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATERBIRTH_TELEPORT),
SPELL_TELE_GROUP_WATERBIRTH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_WATERBIRTH),
SPELL_CURE_GROUP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_GROUP),
SPELL_STAT_SPY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STAT_SPY),
SPELL_BARBARIAN_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BARBARIAN_TELEPORT),
SPELL_TELE_GROUP_BARBARIAN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_BARBARIAN),
SPELL_SUPERGLASS_MAKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SUPERGLASS_MAKE),
SPELL_TAN_LEATHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TAN_LEATHER),
SPELL_KHAZARD_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.KHAZARD_TELEPORT),
SPELL_TELE_GROUP_KHAZARD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_KHAZARD),
SPELL_DREAM(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.DREAM),
SPELL_STRING_JEWELLERY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STRING_JEWELLERY),
SPELL_STAT_RESTORE_POT_SHARE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STAT_RESTORE_POT_SHARE),
SPELL_MAGIC_IMBUE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MAGIC_IMBUE),
SPELL_FERTILE_SOIL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FERTILE_SOIL),
SPELL_BOOST_POTION_SHARE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOOST_POTION_SHARE),
SPELL_FISHING_GUILD_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FISHING_GUILD_TELEPORT),
SPELL_TELE_GROUP_FISHING_GUILD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_FISHING_GUILD),
SPELL_PLANK_MAKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.PLANK_MAKE),
SPELL_CATHERBY_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CATHERBY_TELEPORT),
SPELL_TELE_GROUP_CATHERBY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_CATHERBY),
SPELL_RECHARGE_DRAGONSTONE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.RECHARGE_DRAGONSTONE),
SPELL_ICE_PLATEAU_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_PLATEAU_TELEPORT),
SPELL_TELE_GROUP_ICE_PLATEAU(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_ICE_PLATEAU),
SPELL_ENERGY_TRANSFER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENERGY_TRANSFER),
SPELL_HEAL_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HEAL_OTHER),
SPELL_HEAL_GROUP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HEAL_GROUP),
SPELL_SPELLBOOK_SWAP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SPELLBOOK_SWAP),
SPELL_GEOMANCY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GEOMANCY),
SPELL_SPIN_FLAX(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SPIN_FLAX),
SPELL_OURANIA_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.OURANIA_TELEPORT),
/* END OF LUNAR SPELL BOOK WIDGETS*/
SPELL_TOOLTIP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TOOLTIP),
/* ARCEUUS SPELL BOOK WIDGETS*/
SPELL_KOUREND_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, net.runelite.api.widgets.WidgetID.StandardSpellBook.KOUREND_HOME_TELEPORT),
SPELL_ARCEUUS_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ARCEUUS_HOME_TELEPORT),
SPELL_BATTLEFRONT_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BATTLEFRONT_TELEPORT),
SPELL_REANIMATE_GOBLIN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_GOBLIN),
SPELL_REANIMATE_MONKEY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_MONKEY),
SPELL_REANIMATE_IMP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_IMP),
SPELL_REANIMATE_MINOTAUR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_MINOTAUR),
SPELL_REANIMATE_SCORPION(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_SCORPION),
SPELL_REANIMATE_BEAR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_BEAR),
SPELL_REANIMATE_UNICORN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_UNICORN),
SPELL_REANIMATE_DOG(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_DOG),
SPELL_REANIMATE_CHAOS_DRUID(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_CHAOS_DRUID),
SPELL_REANIMATE_GIANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_GIANT),
SPELL_REANIMATE_OGRE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_OGRE),
SPELL_REANIMATE_ELF(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_ELF),
SPELL_REANIMATE_TROLL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_TROLL),
SPELL_REANIMATE_HORROR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_HORROR),
SPELL_REANIMATE_KALPHITE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_KALPHITE),
SPELL_REANIMATE_DAGANNOTH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_DAGANNOTH),
SPELL_REANIMATE_BLOODVELD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_BLOODVELD),
SPELL_REANIMATE_TZHAAR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_TZHAAR),
SPELL_REANIMATE_DEMON(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_DEMON),
SPELL_REANIMATE_AVIANSIE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_AVIANSIE),
SPELL_REANIMATE_ABYSSAL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_ABYSSAL),
SPELL_REANIMATE_DRAGON(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_DRAGON),
/* END OF ARCEUUS SPELL BOOK WIDGETS*/
MULTICOMBAT_FIXED(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MULTICOMBAT_INDICATOR),
MULTICOMBAT_RESIZEABLE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewport.MULTICOMBAT_INDICATOR),
FULLSCREEN_MAP_ROOT(WidgetID.FULLSCREEN_CONTAINER_TLI, WidgetID.FullScreenMap.ROOT),
MUSICTAB_INTERFACE(WidgetID.MUSICTAB_GROUP_ID, 1),
MUSICTAB_SONG_BOX(WidgetID.MUSICTAB_GROUP_ID, 2),
MUSICTAB_ALL_SONGS(WidgetID.MUSICTAB_GROUP_ID, 3),
MUSICTAB_SCROLLBAR(WidgetID.MUSICTAB_GROUP_ID, 4),
MUSICTAB_PLAYING(WidgetID.MUSICTAB_GROUP_ID, 5),
MUSICTAB_CURRENT_SONG_NAME(WidgetID.MUSICTAB_GROUP_ID, 6),
MUSICTAB_AUTO_BUTTON_LISTENER(WidgetID.MUSICTAB_GROUP_ID, 7),
MUSICTAB_AUTO_BUTTON(WidgetID.MUSICTAB_GROUP_ID, 8),
MUSICTAB_MANUAL_BUTTON_LISTENER(WidgetID.MUSICTAB_GROUP_ID, 9),
MUSICTAB_MANUAL_BUTTON(WidgetID.MUSICTAB_GROUP_ID, 10),
MUSICTAB_LOOP_BUTTON_LISTENER(WidgetID.MUSICTAB_GROUP_ID, 11),
MUSICTAB_LOOP_BUTTON(WidgetID.MUSICTAB_GROUP_ID, 12),
MUSICTAB_UNLOCKED_SONGS(WidgetID.MUSICTAB_GROUP_ID, 13),
QUESTTAB_QUEST_TAB(WidgetID.QUESTTAB_GROUP_ID, WidgetID.QuestTab.QUEST_TAB),
EQUIPMENT_MELEE_STRENGTH(WidgetID.EQUIPMENT_PAGE_GROUP_ID, WidgetID.EquipmentWidgetIdentifiers.MELEE_STRENGTH),
EQUIPMENT_RANGED_STRENGTH(WidgetID.EQUIPMENT_PAGE_GROUP_ID, WidgetID.EquipmentWidgetIdentifiers.RANGED_STRENGTH),
EQUIPMENT_MAGIC_DAMAGE(WidgetID.EQUIPMENT_PAGE_GROUP_ID, WidgetID.EquipmentWidgetIdentifiers.MAGIC_DAMAGE),
EQUIP_YOUR_CHARACTER(WidgetID.EQUIPMENT_PAGE_GROUP_ID, WidgetID.EquipmentWidgetIdentifiers.EQUIP_YOUR_CHARACTER),
BANK_PIN_TOP_LEFT_TEXT(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.TOP_LEFT_TEXT),
BANK_PIN_EXIT_BUTTON(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.EXIT_BUTTON),
BANK_PIN_FORGOT_BUTTON(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.FORGOT_BUTTON),
BANK_PIN_FIRST_ENTERED(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.FIRST_ENTERED),
BANK_PIN_SECOND_ENTERED(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.SECOND_ENTERED),
BANK_PIN_THIRD_ENTERED(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.THIRD_ENTERED),
BANK_PIN_FOURTH_ENTERED(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.FOURTH_ENTERED),
BANK_PIN_INSTRUCTION_TEXT(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.INSTRUCTION_TEXT),
BANK_PIN_1(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_1),
BANK_PIN_2(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_2),
BANK_PIN_3(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_3),
BANK_PIN_4(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_4),
BANK_PIN_5(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_5),
BANK_PIN_6(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_6),
BANK_PIN_7(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_7),
BANK_PIN_8(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_8),
BANK_PIN_9(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_9),
BANK_PIN_10(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_10),
XP_DROP_1(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_1),
XP_DROP_2(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_2),
XP_DROP_3(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_3),
XP_DROP_4(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_4),
XP_DROP_5(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_5),
XP_DROP_6(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_6),
XP_DROP_7(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_7),
JEWELLERY_BOX_DUEL_RING(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.DUEL_RING),
JEWELLERY_BOX_GAME_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.GAME_NECK),
JEWELLERY_BOX_COMB_BRAC(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.COMB_BRAC),
JEWELLERY_BOX_SKIL_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.SKIL_NECK),
JEWELLERY_BOX_RING_OFGP(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.RING_OFGP),
JEWELLERY_BOX_AMUL_GLOR(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.AMUL_GLOR),
OPTIONS_CAMERA_ZOOM_SLIDER_HANDLE(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.CAMERA_ZOOM_SLIDER_HANDLE),
OPTIONS_MUSIC_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.MUSIC_SLIDER),
OPTIONS_SOUND_EFFECT_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.SOUND_EFFECT_SLIDER),
OPTIONS_AREA_SOUND_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.AREA_SOUND_SLIDER),
TRADING_WITH(WidgetID.PLAYER_TRADE_SCREEN_GROUP_ID, WidgetID.TradeScreen.FIRST_TRADING_WITH),
SECOND_TRADING_WITH(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_TRADING_WITH),
SECOND_TRADING_WITH_ACCEPT_BUTTON(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_ACCEPT_FUNC),
SECOND_TRADING_WITH_ACCEPT_TEXT(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_ACCEPT_TEXT),
SECOND_TRADING_WITH_DECLINE_BUTTON(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_DECLINE_FUNC),
SECOND_TRADING_WITH_DECLINE_TEXT(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_DECLINE_TEXT),
SECOND_TRADING_WITH_MY_OFFER(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_MY_OFFER),
SECOND_TRADING_WITH_THEIR_OFFER(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_THEIR_OFFER),
SECOND_TRADING_WITH_MY_ITEMS(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_MY_ITEMS),
SECOND_TRADING_WITH_THEIR_ITEMS(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_THEIR_ITEMS),
GAUNTLET_MAP(WidgetID.GAUNTLET_MAP_GROUP_ID, WidgetID.GauntletMap.CONTAINER),
SETTINGS_INIT(WidgetID.SETTINGS_GROUP_ID, WidgetID.Settings.INIT),
SHOP_ITEMS_CONTAINER(WidgetID.SHOP_GROUP_ID, WidgetID.Shop.ITEMS_CONTAINER),
;
private final int groupId;
private final int childId;
WidgetInfo(int groupId, int childId)
{
this.groupId = groupId;
this.childId = childId;
}
/**
* Gets the ID of the group-child pairing.
*
* @return the ID
*/
public int getId()
{
return groupId << 16 | childId;
}
/**
* Gets the group ID of the pair.
*
* @return the group ID
*/
public int getGroupId()
{
return groupId;
}
/**
* Gets the ID of the child in the group.
*
* @return the child ID
*/
public int getChildId()
{
return childId;
}
/**
* Gets the packed widget ID.
*
* @return the packed ID
*/
public int getPackedId()
{
return groupId << 16 | childId;
}
public static int PACK(int groupId, int childId)
{
return groupId << 16 | childId;
}
/**
* Utility method that converts an ID returned by {@link #getId()} back
* to its group ID.
*
* @param id passed group-child ID
* @return the group ID
*/
public static int TO_GROUP(int id)
{
return id >>> 16;
}
/**
* Utility method that converts an ID returned by {@link #getId()} back
* to its child ID.
*
* @param id passed group-child ID
* @return the child ID
*/
public static int TO_CHILD(int id)
{
return id & 0xFFFF;
}
}
@@ -513,6 +513,15 @@ public interface Client extends GameShell
@Nullable
Widget getWidget(WidgetInfo widget);
/**
* Gets a widget from our extended WidgetInfo
*
* @param widget the widget info
* @return the widget
*/
@Nullable
Widget getWidget(com.openosrs.api.widgets.WidgetInfo widget);
/**
* Gets a widget by its raw group ID and child ID.
* <p>
@@ -82,6 +82,11 @@ public class Constants
public static final int TILE_FLAG_BRIDGE = 2;
/**
* The height of the overworld, in tiles. Coordinates above this are in caves and other such zones.
*/
public static final int OVERWORLD_MAX_Y = 4160;
/**
* The number of milliseconds in a client tick.
* <p>
@@ -114,9 +119,4 @@ public class Constants
* Height of a standard item sprite
*/
public static final int ITEM_SPRITE_HEIGHT = 32;
/**
* The height of the overworld, in tiles. Coordinates above this are in caves and other such zones.
*/
public static final int OVERWORLD_MAX_Y = 4160;
}
@@ -188,10 +188,6 @@ public enum MenuAction
* Fifth menu action for an item.
*/
ITEM_FIFTH_OPTION(37),
/**
* Menu action to drop an item (identical to ITEM_FIFTH_OPTION).
*/
ITEM_DROP(37),
/**
* Menu action to use an item.
*/
@@ -2657,9 +2657,7 @@ public final class NpcID
public static final int DRYAD = 2828;
public static final int FAIRY_2829 = 2829;
public static final int MYSTERIOUS_OLD_MAN = 2830;
public static final int LIZARD_MAN = 2831;
public static final int ORC = 2832;
public static final int TROLL_2833 = 2833;
public static final int LIL_CREATOR = 2833;
public static final int GIANT_BAT = 2834;
public static final int CAMEL = 2835;
public static final int GOLEM = 2836;
@@ -3340,9 +3338,9 @@ public final class NpcID
public static final int VERONICA = 3561;
public static final int PROFESSOR_ODDENSTEIN = 3562;
public static final int ERNEST = 3563;
public static final int CHICKEN_3564 = 3564;
public static final int LIL_DESTRUCTOR = 3564;
public static final int SKELETON_3565 = 3565;
public static final int WITCH_3566 = 3566;
public static final int LIL_CREATOR_3566 = 3566;
public static final int PENTYN = 3568;
public static final int ARISTARCHUS = 3569;
public static final int BONEGUARD = 3570;
@@ -4683,7 +4681,7 @@ public final class NpcID
public static final int ELEMENTAL_BALANCE_5004 = 5004;
public static final int WIZARD_GRAYZAG = 5006;
public static final int IMP_5007 = 5007;
public static final int IMP_5008 = 5008;
public static final int LIL_DESTRUCTOR_5008 = 5008;
public static final int ELEMENTAL_BALANCE_5009 = 5009;
public static final int ELEMENTAL_BALANCE_5010 = 5010;
public static final int ELEMENTAL_BALANCE_5011 = 5011;
@@ -7708,8 +7706,7 @@ public final class NpcID
public static final int CAT_8594 = 8594;
public static final int FELFIZ_YARYUS = 8595;
public static final int KEITH = 8596;
public static final int GORDON = 8597;
public static final int MARY_8598 = 8598;
public static final int ORNATE_COMBAT_DUMMY = 8598;
public static final int SHAYZIEN_SOLDIER_8599 = 8599;
public static final int SHAYZIEN_SERGEANT = 8600;
public static final int SHAYZIEN_ARCHER = 8601;
@@ -8869,5 +8866,91 @@ public final class NpcID
public static final int CAPTAIN_SHORACKS_10489 = 10489;
public static final int CAPTAIN_SHORACKS_10490 = 10490;
public static final int CAPTAIN_SHORACKS_10491 = 10491;
public static final int HEADLESS_BEAST_HARD = 10492;
public static final int HEADLESS_BEAST = 10493;
public static final int CHICKEN_10494 = 10494;
public static final int CHICKEN_10495 = 10495;
public static final int CHICKEN_10496 = 10496;
public static final int CHICKEN_10497 = 10497;
public static final int CHICKEN_10498 = 10498;
public static final int CHICKEN_10499 = 10499;
public static final int GORDON = 10500;
public static final int GORDON_10501 = 10501;
public static final int MARY_10502 = 10502;
public static final int MARY_10503 = 10503;
public static final int MARY_10504 = 10504;
public static final int SHAYZIEN_SERGEANT_10505 = 10505;
public static final int HEADLESS_BEAST_10506 = 10506;
public static final int ORNATE_UNDEAD_COMBAT_DUMMY = 10507;
public static final int ORNATE_WILDERNESS_COMBAT_DUMMY = 10508;
public static final int ORNATE_KALPHITE_COMBAT_DUMMY = 10509;
public static final int ORNATE_KURASK_COMBAT_DUMMY = 10510;
public static final int ORNATE_UNDEAD_COMBAT_DUMMY_10511 = 10511;
public static final int ORNATE_UNDEAD_COMBAT_DUMMY_10512 = 10512;
public static final int FISHING_SPOT_10513 = 10513;
public static final int FISHING_SPOT_10514 = 10514;
public static final int FISHING_SPOT_10515 = 10515;
public static final int NOMAD = 10516;
public static final int ZIMBERFIZZ = 10517;
public static final int ZIMBERFIZZ_10518 = 10518;
public static final int ZIMBERFIZZ_10519 = 10519;
public static final int AVATAR_OF_CREATION = 10520;
public static final int AVATAR_OF_DESTRUCTION = 10521;
public static final int WOLF_10522 = 10522;
public static final int FORGOTTEN_SOUL = 10523;
public static final int FORGOTTEN_SOUL_10524 = 10524;
public static final int FORGOTTEN_SOUL_10525 = 10525;
public static final int FORGOTTEN_SOUL_10526 = 10526;
public static final int NOMAD_10528 = 10528;
public static final int NOMAD_10529 = 10529;
public static final int ZIMBERFIZZ_10530 = 10530;
public static final int AVATAR_OF_CREATION_10531 = 10531;
public static final int AVATAR_OF_DESTRUCTION_10532 = 10532;
public static final int WOLF_10533 = 10533;
public static final int FORGOTTEN_SOUL_10534 = 10534;
public static final int FORGOTTEN_SOUL_10535 = 10535;
public static final int FORGOTTEN_SOUL_10536 = 10536;
public static final int FORGOTTEN_SOUL_10537 = 10537;
public static final int GHOST_10538 = 10538;
public static final int BARRICADE_10539 = 10539;
public static final int BARRICADE_10540 = 10540;
public static final int BIRD_10541 = 10541;
public static final int FORGOTTEN_SOUL_10544 = 10544;
public static final int FORGOTTEN_SOUL_10545 = 10545;
public static final int DUCK_10546 = 10546;
public static final int DUCK_10547 = 10547;
public static final int CHICKEN_10556 = 10556;
public static final int GNOME_CHILD_10557 = 10557;
public static final int GNOME_CHILD_10558 = 10558;
public static final int SCRUBFOOT = 10559;
public static final int GNOME_CHILD_10560 = 10560;
public static final int RED_FIREFLIES = 10561;
public static final int GNOME_CHILD_10562 = 10562;
public static final int THRANDER = 10563;
public static final int GREEN_FIREFLIES = 10564;
public static final int CHUCK_10565 = 10565;
public static final int GOBLIN_10566 = 10566;
public static final int GOBLIN_10567 = 10567;
public static final int PIOUS_PETE = 10568;
public static final int MYSTERIOUS_WATCHER = 10569;
public static final int MYSTERIOUS_WATCHER_10570 = 10570;
public static final int MYSTERIOUS_WATCHER_10571 = 10571;
public static final int BIG_MO = 10572;
public static final int CHEERLEADER_10573 = 10573;
public static final int CHEERLEADER_10574 = 10574;
public static final int CHEERLEADER_10575 = 10575;
public static final int BLACK_DRAGON_10576 = 10576;
public static final int RED_DRAGON_10577 = 10577;
public static final int BLUE_DRAGON_10578 = 10578;
public static final int KING_BLACK_DRAGON_10579 = 10579;
public static final int BABY_BLUE_DRAGON_10580 = 10580;
public static final int LESSER_DEMON_10581 = 10581;
public static final int GREATER_DEMON_10582 = 10582;
public static final int BLACK_DEMON_10583 = 10583;
public static final int SCORPION_10584 = 10584;
public static final int KING_SCORPION_10585 = 10585;
public static final int ORC = 10586;
public static final int LIZARD_MAN = 10587;
public static final int TROLL_10588 = 10588;
/* This file is automatically generated. Do not edit. */
}
@@ -2128,6 +2128,7 @@ public final class NullItemID
public static final int NULL_5550 = 5550;
public static final int NULL_5551 = 5551;
public static final int NULL_5552 = 5552;
public static final int NULL_5572 = 5572;
public static final int NULL_5611 = 5611;
public static final int NULL_5612 = 5612;
public static final int NULL_5613 = 5613;
@@ -13325,6 +13326,7 @@ public final class NullItemID
public static final int NULL_25036 = 25036;
public static final int NULL_25038 = 25038;
public static final int NULL_25039 = 25039;
public static final int NULL_25040 = 25040;
public static final int NULL_25041 = 25041;
public static final int NULL_25043 = 25043;
public static final int NULL_25045 = 25045;
@@ -13387,5 +13389,96 @@ public final class NullItemID
public static final int NULL_25142 = 25142;
public static final int NULL_25143 = 25143;
public static final int NULL_25144 = 25144;
public static final int NULL_25148 = 25148;
public static final int NULL_25149 = 25149;
public static final int NULL_25150 = 25150;
public static final int NULL_25151 = 25151;
public static final int NULL_25153 = 25153;
public static final int NULL_25156 = 25156;
public static final int NULL_25158 = 25158;
public static final int NULL_25164 = 25164;
public static final int NULL_25166 = 25166;
public static final int NULL_25168 = 25168;
public static final int NULL_25170 = 25170;
public static final int NULL_25172 = 25172;
public static final int NULL_25175 = 25175;
public static final int NULL_25178 = 25178;
public static final int NULL_25180 = 25180;
public static final int NULL_25182 = 25182;
public static final int NULL_25184 = 25184;
public static final int NULL_25186 = 25186;
public static final int NULL_25188 = 25188;
public static final int NULL_25190 = 25190;
public static final int NULL_25192 = 25192;
public static final int NULL_25194 = 25194;
public static final int NULL_25198 = 25198;
public static final int NULL_25200 = 25200;
public static final int NULL_25245 = 25245;
public static final int NULL_25247 = 25247;
public static final int NULL_25249 = 25249;
public static final int NULL_25251 = 25251;
public static final int NULL_25253 = 25253;
public static final int NULL_25255 = 25255;
public static final int NULL_25257 = 25257;
public static final int NULL_25259 = 25259;
public static final int NULL_25261 = 25261;
public static final int NULL_25263 = 25263;
public static final int NULL_25265 = 25265;
public static final int NULL_25277 = 25277;
public static final int NULL_25279 = 25279;
public static final int NULL_25281 = 25281;
public static final int NULL_25291 = 25291;
public static final int NULL_25292 = 25292;
public static final int NULL_25293 = 25293;
public static final int NULL_25294 = 25294;
public static final int NULL_25295 = 25295;
public static final int NULL_25296 = 25296;
public static final int NULL_25297 = 25297;
public static final int NULL_25298 = 25298;
public static final int NULL_25299 = 25299;
public static final int NULL_25300 = 25300;
public static final int NULL_25301 = 25301;
public static final int NULL_25302 = 25302;
public static final int NULL_25303 = 25303;
public static final int NULL_25304 = 25304;
public static final int NULL_25305 = 25305;
public static final int NULL_25306 = 25306;
public static final int NULL_25307 = 25307;
public static final int NULL_25308 = 25308;
public static final int NULL_25309 = 25309;
public static final int NULL_25310 = 25310;
public static final int NULL_25311 = 25311;
public static final int NULL_25312 = 25312;
public static final int NULL_25313 = 25313;
public static final int NULL_25315 = 25315;
public static final int NULL_25317 = 25317;
public static final int NULL_25318 = 25318;
public static final int NULL_25323 = 25323;
public static final int NULL_25325 = 25325;
public static final int NULL_25327 = 25327;
public static final int NULL_25329 = 25329;
public static final int NULL_25331 = 25331;
public static final int NULL_25333 = 25333;
public static final int NULL_25335 = 25335;
public static final int NULL_25337 = 25337;
public static final int NULL_25339 = 25339;
public static final int NULL_25341 = 25341;
public static final int NULL_25343 = 25343;
public static final int NULL_25345 = 25345;
public static final int NULL_25347 = 25347;
public static final int NULL_25349 = 25349;
public static final int NULL_25368 = 25368;
public static final int NULL_25370 = 25370;
public static final int NULL_25372 = 25372;
public static final int NULL_25374 = 25374;
public static final int NULL_25375 = 25375;
public static final int NULL_25377 = 25377;
public static final int NULL_25379 = 25379;
public static final int NULL_25381 = 25381;
public static final int NULL_25382 = 25382;
public static final int NULL_25384 = 25384;
public static final int NULL_25385 = 25385;
public static final int NULL_25387 = 25387;
public static final int NULL_25388 = 25388;
/* This file is automatically generated. Do not edit. */
}
@@ -173,6 +173,8 @@ public final class NullNpcID
public static final int NULL_2779 = 2779;
public static final int NULL_2780 = 2780;
public static final int NULL_2781 = 2781;
public static final int NULL_2831 = 2831;
public static final int NULL_2832 = 2832;
public static final int NULL_2934 = 2934;
public static final int NULL_2935 = 2935;
public static final int NULL_2936 = 2936;
@@ -421,7 +423,6 @@ public final class NullNpcID
public static final int NULL_6140 = 6140;
public static final int NULL_6141 = 6141;
public static final int NULL_6142 = 6142;
public static final int NULL_6143 = 6143;
public static final int NULL_6144 = 6144;
public static final int NULL_6145 = 6145;
public static final int NULL_6146 = 6146;
@@ -873,6 +874,7 @@ public final class NullNpcID
public static final int NULL_8489 = 8489;
public static final int NULL_8490 = 8490;
public static final int NULL_8516 = 8516;
public static final int NULL_8597 = 8597;
public static final int NULL_8624 = 8624;
public static final int NULL_8625 = 8625;
public static final int NULL_8626 = 8626;
@@ -1606,5 +1608,16 @@ public final class NullNpcID
public static final int NULL_10441 = 10441;
public static final int NULL_10474 = 10474;
public static final int NULL_10475 = 10475;
public static final int NULL_10527 = 10527;
public static final int NULL_10542 = 10542;
public static final int NULL_10543 = 10543;
public static final int NULL_10548 = 10548;
public static final int NULL_10549 = 10549;
public static final int NULL_10550 = 10550;
public static final int NULL_10551 = 10551;
public static final int NULL_10552 = 10552;
public static final int NULL_10553 = 10553;
public static final int NULL_10554 = 10554;
public static final int NULL_10555 = 10555;
/* This file is automatically generated. Do not edit. */
}
@@ -890,6 +890,7 @@ public final class NullObjectID
public static final int NULL_1807 = 1807;
public static final int NULL_1808 = 1808;
public static final int NULL_1809 = 1809;
public static final int NULL_1812 = 1812;
public static final int NULL_1815 = 1815;
public static final int NULL_1818 = 1818;
public static final int NULL_1819 = 1819;
@@ -9386,6 +9387,7 @@ public final class NullObjectID
public static final int NULL_20842 = 20842;
public static final int NULL_20846 = 20846;
public static final int NULL_20857 = 20857;
public static final int NULL_20858 = 20858;
public static final int NULL_20859 = 20859;
public static final int NULL_20860 = 20860;
public static final int NULL_20861 = 20861;
@@ -19725,9 +19727,368 @@ public final class NullObjectID
public static final int NULL_40352 = 40352;
public static final int NULL_40353 = 40353;
public static final int NULL_40354 = 40354;
public static final int NULL_40368 = 40368;
public static final int NULL_40369 = 40369;
public static final int NULL_40370 = 40370;
public static final int NULL_40371 = 40371;
public static final int NULL_40372 = 40372;
public static final int NULL_40373 = 40373;
public static final int NULL_40374 = 40374;
public static final int NULL_40375 = 40375;
public static final int NULL_40376 = 40376;
public static final int NULL_40377 = 40377;
public static final int NULL_40378 = 40378;
public static final int NULL_40379 = 40379;
public static final int NULL_40380 = 40380;
public static final int NULL_40392 = 40392;
public static final int NULL_40393 = 40393;
public static final int NULL_40394 = 40394;
public static final int NULL_40395 = 40395;
public static final int NULL_40427 = 40427;
public static final int NULL_40428 = 40428;
public static final int NULL_40429 = 40429;
public static final int NULL_40477 = 40477;
public static final int NULL_40478 = 40478;
public static final int NULL_40479 = 40479;
public static final int NULL_40480 = 40480;
public static final int NULL_40481 = 40481;
public static final int NULL_40482 = 40482;
public static final int NULL_40483 = 40483;
public static final int NULL_40484 = 40484;
public static final int NULL_40485 = 40485;
public static final int NULL_40486 = 40486;
public static final int NULL_40487 = 40487;
public static final int NULL_40488 = 40488;
public static final int NULL_40489 = 40489;
public static final int NULL_40490 = 40490;
public static final int NULL_40500 = 40500;
public static final int NULL_40501 = 40501;
public static final int NULL_40502 = 40502;
public static final int NULL_40503 = 40503;
public static final int NULL_40504 = 40504;
public static final int NULL_40505 = 40505;
public static final int NULL_40506 = 40506;
public static final int NULL_40507 = 40507;
public static final int NULL_40508 = 40508;
public static final int NULL_40509 = 40509;
public static final int NULL_40510 = 40510;
public static final int NULL_40511 = 40511;
public static final int NULL_40512 = 40512;
public static final int NULL_40513 = 40513;
public static final int NULL_40514 = 40514;
public static final int NULL_40515 = 40515;
public static final int NULL_40516 = 40516;
public static final int NULL_40517 = 40517;
public static final int NULL_40518 = 40518;
public static final int NULL_40519 = 40519;
public static final int NULL_40520 = 40520;
public static final int NULL_40521 = 40521;
public static final int NULL_40522 = 40522;
public static final int NULL_40523 = 40523;
public static final int NULL_40524 = 40524;
public static final int NULL_40525 = 40525;
public static final int NULL_40526 = 40526;
public static final int NULL_40527 = 40527;
public static final int NULL_40528 = 40528;
public static final int NULL_40529 = 40529;
public static final int NULL_40530 = 40530;
public static final int NULL_40531 = 40531;
public static final int NULL_40532 = 40532;
public static final int NULL_40533 = 40533;
public static final int NULL_40534 = 40534;
public static final int NULL_40535 = 40535;
public static final int NULL_40536 = 40536;
public static final int NULL_40537 = 40537;
public static final int NULL_40538 = 40538;
public static final int NULL_40539 = 40539;
public static final int NULL_40540 = 40540;
public static final int NULL_40541 = 40541;
public static final int NULL_40542 = 40542;
public static final int NULL_40543 = 40543;
public static final int NULL_40552 = 40552;
public static final int NULL_40553 = 40553;
public static final int NULL_40554 = 40554;
public static final int NULL_40555 = 40555;
public static final int NULL_40556 = 40556;
public static final int NULL_40557 = 40557;
public static final int NULL_40558 = 40558;
public static final int NULL_40559 = 40559;
public static final int NULL_40560 = 40560;
public static final int NULL_40561 = 40561;
public static final int NULL_40562 = 40562;
public static final int NULL_40563 = 40563;
public static final int NULL_40564 = 40564;
public static final int NULL_40565 = 40565;
public static final int NULL_40566 = 40566;
public static final int NULL_40567 = 40567;
public static final int NULL_40568 = 40568;
public static final int NULL_40569 = 40569;
public static final int NULL_40570 = 40570;
public static final int NULL_40571 = 40571;
public static final int NULL_40572 = 40572;
public static final int NULL_40573 = 40573;
public static final int NULL_40574 = 40574;
public static final int NULL_40575 = 40575;
public static final int NULL_40576 = 40576;
public static final int NULL_40577 = 40577;
public static final int NULL_40578 = 40578;
public static final int NULL_40579 = 40579;
public static final int NULL_40580 = 40580;
public static final int NULL_40581 = 40581;
public static final int NULL_40582 = 40582;
public static final int NULL_40583 = 40583;
public static final int NULL_40584 = 40584;
public static final int NULL_40585 = 40585;
public static final int NULL_40586 = 40586;
public static final int NULL_40587 = 40587;
public static final int NULL_40591 = 40591;
public static final int NULL_40592 = 40592;
public static final int NULL_40593 = 40593;
public static final int NULL_40594 = 40594;
public static final int NULL_40595 = 40595;
public static final int NULL_40596 = 40596;
public static final int NULL_40597 = 40597;
public static final int NULL_40598 = 40598;
public static final int NULL_40599 = 40599;
public static final int NULL_40600 = 40600;
public static final int NULL_40601 = 40601;
public static final int NULL_40602 = 40602;
public static final int NULL_40603 = 40603;
public static final int NULL_40604 = 40604;
public static final int NULL_40605 = 40605;
public static final int NULL_40606 = 40606;
public static final int NULL_40607 = 40607;
public static final int NULL_40608 = 40608;
public static final int NULL_40609 = 40609;
public static final int NULL_40610 = 40610;
public static final int NULL_40611 = 40611;
public static final int NULL_40612 = 40612;
public static final int NULL_40613 = 40613;
public static final int NULL_40614 = 40614;
public static final int NULL_40615 = 40615;
public static final int NULL_40616 = 40616;
public static final int NULL_40617 = 40617;
public static final int NULL_40618 = 40618;
public static final int NULL_40619 = 40619;
public static final int NULL_40620 = 40620;
public static final int NULL_40621 = 40621;
public static final int NULL_40622 = 40622;
public static final int NULL_40623 = 40623;
public static final int NULL_40624 = 40624;
public static final int NULL_40625 = 40625;
public static final int NULL_40626 = 40626;
public static final int NULL_40627 = 40627;
public static final int NULL_40628 = 40628;
public static final int NULL_40629 = 40629;
public static final int NULL_40630 = 40630;
public static final int NULL_40631 = 40631;
public static final int NULL_40632 = 40632;
public static final int NULL_40633 = 40633;
public static final int NULL_40634 = 40634;
public static final int NULL_40635 = 40635;
public static final int NULL_40636 = 40636;
public static final int NULL_40637 = 40637;
public static final int NULL_40638 = 40638;
public static final int NULL_40639 = 40639;
public static final int NULL_40640 = 40640;
public static final int NULL_40641 = 40641;
public static final int NULL_40642 = 40642;
public static final int NULL_40643 = 40643;
public static final int NULL_40644 = 40644;
public static final int NULL_40645 = 40645;
public static final int NULL_40646 = 40646;
public static final int NULL_40647 = 40647;
public static final int NULL_40648 = 40648;
public static final int NULL_40649 = 40649;
public static final int NULL_40650 = 40650;
public static final int NULL_40651 = 40651;
public static final int NULL_40652 = 40652;
public static final int NULL_40653 = 40653;
public static final int NULL_40654 = 40654;
public static final int NULL_40655 = 40655;
public static final int NULL_40656 = 40656;
public static final int NULL_40657 = 40657;
public static final int NULL_40658 = 40658;
public static final int NULL_40659 = 40659;
public static final int NULL_40660 = 40660;
public static final int NULL_40661 = 40661;
public static final int NULL_40662 = 40662;
public static final int NULL_40663 = 40663;
public static final int NULL_40664 = 40664;
public static final int NULL_40665 = 40665;
public static final int NULL_40666 = 40666;
public static final int NULL_40667 = 40667;
public static final int NULL_40668 = 40668;
public static final int NULL_40669 = 40669;
public static final int NULL_40670 = 40670;
public static final int NULL_40671 = 40671;
public static final int NULL_40672 = 40672;
public static final int NULL_40673 = 40673;
public static final int NULL_40674 = 40674;
public static final int NULL_40675 = 40675;
public static final int NULL_40676 = 40676;
public static final int NULL_40677 = 40677;
public static final int NULL_40678 = 40678;
public static final int NULL_40679 = 40679;
public static final int NULL_40680 = 40680;
public static final int NULL_40681 = 40681;
public static final int NULL_40682 = 40682;
public static final int NULL_40683 = 40683;
public static final int NULL_40684 = 40684;
public static final int NULL_40685 = 40685;
public static final int NULL_40686 = 40686;
public static final int NULL_40687 = 40687;
public static final int NULL_40688 = 40688;
public static final int NULL_40689 = 40689;
public static final int NULL_40690 = 40690;
public static final int NULL_40691 = 40691;
public static final int NULL_40692 = 40692;
public static final int NULL_40693 = 40693;
public static final int NULL_40694 = 40694;
public static final int NULL_40695 = 40695;
public static final int NULL_40696 = 40696;
public static final int NULL_40697 = 40697;
public static final int NULL_40698 = 40698;
public static final int NULL_40699 = 40699;
public static final int NULL_40700 = 40700;
public static final int NULL_40701 = 40701;
public static final int NULL_40702 = 40702;
public static final int NULL_40703 = 40703;
public static final int NULL_40704 = 40704;
public static final int NULL_40705 = 40705;
public static final int NULL_40706 = 40706;
public static final int NULL_40707 = 40707;
public static final int NULL_40708 = 40708;
public static final int NULL_40709 = 40709;
public static final int NULL_40710 = 40710;
public static final int NULL_40711 = 40711;
public static final int NULL_40712 = 40712;
public static final int NULL_40713 = 40713;
public static final int NULL_40714 = 40714;
public static final int NULL_40717 = 40717;
public static final int NULL_40718 = 40718;
public static final int NULL_40719 = 40719;
public static final int NULL_40720 = 40720;
public static final int NULL_40721 = 40721;
public static final int NULL_40722 = 40722;
public static final int NULL_40724 = 40724;
public static final int NULL_40726 = 40726;
public static final int NULL_40727 = 40727;
public static final int NULL_40729 = 40729;
public static final int NULL_40730 = 40730;
public static final int NULL_40740 = 40740;
public static final int NULL_40743 = 40743;
public static final int NULL_40745 = 40745;
public static final int NULL_40746 = 40746;
public static final int NULL_40747 = 40747;
public static final int NULL_40748 = 40748;
public static final int NULL_40749 = 40749;
public static final int NULL_40762 = 40762;
public static final int NULL_40763 = 40763;
public static final int NULL_40764 = 40764;
public static final int NULL_40765 = 40765;
public static final int NULL_40766 = 40766;
public static final int NULL_40767 = 40767;
public static final int NULL_40779 = 40779;
public static final int NULL_40862 = 40862;
public static final int NULL_40863 = 40863;
public static final int NULL_40864 = 40864;
public static final int NULL_40865 = 40865;
public static final int NULL_40866 = 40866;
public static final int NULL_40867 = 40867;
public static final int NULL_40868 = 40868;
public static final int NULL_40869 = 40869;
public static final int NULL_40870 = 40870;
public static final int NULL_40890 = 40890;
public static final int NULL_40895 = 40895;
public static final int NULL_40898 = 40898;
public static final int NULL_40907 = 40907;
public static final int NULL_40908 = 40908;
public static final int NULL_40925 = 40925;
public static final int NULL_40926 = 40926;
public static final int NULL_40927 = 40927;
public static final int NULL_40928 = 40928;
public static final int NULL_40934 = 40934;
public static final int NULL_40935 = 40935;
public static final int NULL_40936 = 40936;
public static final int NULL_40942 = 40942;
public static final int NULL_40943 = 40943;
public static final int NULL_40944 = 40944;
public static final int NULL_40945 = 40945;
public static final int NULL_40946 = 40946;
public static final int NULL_40947 = 40947;
public static final int NULL_40948 = 40948;
public static final int NULL_40949 = 40949;
public static final int NULL_40950 = 40950;
public static final int NULL_40951 = 40951;
public static final int NULL_40952 = 40952;
public static final int NULL_40953 = 40953;
public static final int NULL_40954 = 40954;
public static final int NULL_40955 = 40955;
public static final int NULL_40956 = 40956;
public static final int NULL_40957 = 40957;
public static final int NULL_40958 = 40958;
public static final int NULL_40959 = 40959;
public static final int NULL_40960 = 40960;
public static final int NULL_40961 = 40961;
public static final int NULL_40962 = 40962;
public static final int NULL_40963 = 40963;
public static final int NULL_40964 = 40964;
public static final int NULL_40965 = 40965;
public static final int NULL_40966 = 40966;
public static final int NULL_40967 = 40967;
public static final int NULL_40968 = 40968;
public static final int NULL_40969 = 40969;
public static final int NULL_40970 = 40970;
public static final int NULL_40971 = 40971;
public static final int NULL_40972 = 40972;
public static final int NULL_40973 = 40973;
public static final int NULL_40974 = 40974;
public static final int NULL_40975 = 40975;
public static final int NULL_40976 = 40976;
public static final int NULL_40977 = 40977;
public static final int NULL_40978 = 40978;
public static final int NULL_40979 = 40979;
public static final int NULL_40980 = 40980;
public static final int NULL_40981 = 40981;
public static final int NULL_40982 = 40982;
public static final int NULL_40983 = 40983;
public static final int NULL_40984 = 40984;
public static final int NULL_40985 = 40985;
public static final int NULL_40987 = 40987;
public static final int NULL_40988 = 40988;
public static final int NULL_40989 = 40989;
public static final int NULL_40990 = 40990;
public static final int NULL_40991 = 40991;
public static final int NULL_40992 = 40992;
public static final int NULL_40993 = 40993;
public static final int NULL_40994 = 40994;
public static final int NULL_40995 = 40995;
public static final int NULL_40996 = 40996;
public static final int NULL_40997 = 40997;
public static final int NULL_40998 = 40998;
public static final int NULL_40999 = 40999;
public static final int NULL_41000 = 41000;
public static final int NULL_41001 = 41001;
public static final int NULL_41002 = 41002;
public static final int NULL_41003 = 41003;
public static final int NULL_41004 = 41004;
public static final int NULL_41005 = 41005;
public static final int NULL_41006 = 41006;
public static final int NULL_41007 = 41007;
public static final int NULL_41008 = 41008;
public static final int NULL_41009 = 41009;
public static final int NULL_41010 = 41010;
public static final int NULL_41011 = 41011;
public static final int NULL_41012 = 41012;
public static final int NULL_41013 = 41013;
public static final int NULL_41014 = 41014;
public static final int NULL_41015 = 41015;
public static final int NULL_41016 = 41016;
public static final int NULL_41018 = 41018;
public static final int NULL_41019 = 41019;
public static final int NULL_41020 = 41020;
public static final int NULL_41021 = 41021;
public static final int NULL_41022 = 41022;
/* This file is automatically generated. Do not edit. */
}
@@ -928,8 +928,7 @@ public final class ObjectID
public static final int DOOR_1805 = 1805;
public static final int WEB_1810 = 1810;
public static final int SLICED_WEB = 1811;
public static final int PORTAL = 1812;
public static final int STONE_STAND = 1813;
public static final int BANDAGE_TABLE = 1813;
public static final int LEVER_1814 = 1814;
public static final int LEVER_1816 = 1816;
public static final int LEVER_1817 = 1817;
@@ -2233,7 +2232,7 @@ public final class ObjectID
public static final int SHELF_4062 = 4062;
public static final int SINK_4063 = 4063;
public static final int SMASHED_TABLE_4064 = 4064;
public static final int STONE_STAND_4065 = 4065;
public static final int STONE_STAND = 4065;
public static final int SIGNPOST_4066 = 4066;
public static final int WARNING_SIGN = 4067;
public static final int BROKEN_WALL = 4068;
@@ -2312,7 +2311,7 @@ public final class ObjectID
public static final int CAVE_ENTRANCE_4147 = 4147;
public static final int DOOR_4148 = 4148;
public static final int LALLIS_STEW = 4149;
public static final int PORTAL_4150 = 4150;
public static final int PORTAL = 4150;
public static final int PORTAL_4151 = 4151;
public static final int PORTAL_4152 = 4152;
public static final int PORTAL_4153 = 4153;
@@ -6988,11 +6987,19 @@ public final class ObjectID
public static final int LADDER_12389 = 12389;
public static final int LADDER_12390 = 12390;
public static final int LADDER_12391 = 12391;
public static final int SACKS_12392 = 12392;
public static final int SACKS_12393 = 12393;
public static final int SACK_PILE = 12394;
public static final int SACK_PILE_12395 = 12395;
public static final int SACK_12396 = 12396;
public static final int SACK_12399 = 12399;
public static final int CAULDRON_12400 = 12400;
public static final int CAULDRON_12401 = 12401;
public static final int EXPLOSION = 12402;
public static final int SHELVES_12403 = 12403;
public static final int SHELVES_12404 = 12404;
public static final int CUPBOARD_12405 = 12405;
public static final int CUPBOARD_12406 = 12406;
public static final int STOOL_12407 = 12407;
public static final int STOOL_12408 = 12408;
public static final int STOOL_12409 = 12409;
@@ -9024,7 +9031,7 @@ public final class ObjectID
public static final int LARGE_DOOR_15758 = 15758;
public static final int DOOR_15759 = 15759;
public static final int SACK_15760 = 15760;
public static final int SACK_PILE = 15761;
public static final int SACK_PILE_15761 = 15761;
public static final int SACKS_15762 = 15762;
public static final int BED_15767 = 15767;
public static final int CRATE_15768 = 15768;
@@ -20674,7 +20681,7 @@ public final class ObjectID
public static final int NEUTRAL_BARRIER = 40439;
public static final int PORTAL_40440 = 40440;
public static final int PORTAL_40441 = 40441;
public static final int BANDAGE_TABLE = 40442;
public static final int BANDAGE_TABLE_40442 = 40442;
public static final int BARRICADE_TABLE = 40443;
public static final int BARRICADE_TABLE_40444 = 40444;
public static final int EXPLOSIVE_POTION_TABLE = 40445;
@@ -20851,22 +20858,22 @@ public final class ObjectID
public static final int DOOR_40859 = 40859;
public static final int DOOR_40860 = 40860;
public static final int DOOR_40861 = 40861;
public static final int SACKS_40871 = 40871;
public static final int SACKS_40872 = 40872;
public static final int SACKS_40873 = 40873;
public static final int SACKS_40874 = 40874;
public static final int SACK_PILE_40875 = 40875;
public static final int SACK_PILE_40876 = 40876;
public static final int SACK_PILE_40877 = 40877;
public static final int SACK_PILE_40878 = 40878;
public static final int SHELVES_40879 = 40879;
public static final int SHELVES_40880 = 40880;
public static final int SHELVES_40881 = 40881;
public static final int SHELVES_40882 = 40882;
public static final int CUPBOARD_40883 = 40883;
public static final int CUPBOARD_40884 = 40884;
public static final int CUPBOARD_40885 = 40885;
public static final int CUPBOARD_40886 = 40886;
public static final int ICON_OF_GNOME_CHILD = 40871;
public static final int ALTAR_40872 = 40872;
public static final int ALTAR_40873 = 40873;
public static final int ALTAR_40874 = 40874;
public static final int ALTAR_40875 = 40875;
public static final int ALTAR_40876 = 40876;
public static final int ALTAR_40877 = 40877;
public static final int ALTAR_40878 = 40878;
public static final int DECORATIVE_WINDOW_40879 = 40879;
public static final int STAINEDGLASS_WINDOW_40880 = 40880;
public static final int DECORATIVE_WINDOW_40881 = 40881;
public static final int STAINEDGLASS_WINDOW_40882 = 40882;
public static final int DECORATIVE_WINDOW_40883 = 40883;
public static final int STAINEDGLASS_WINDOW_40884 = 40884;
public static final int DECORATIVE_WINDOW_40885 = 40885;
public static final int STAINEDGLASS_WINDOW_40886 = 40886;
public static final int CAVE_ENTRANCE_40887 = 40887;
public static final int CAVE_EXIT_40888 = 40888;
public static final int CREVICE_40889 = 40889;
@@ -20876,19 +20883,201 @@ public final class ObjectID
public static final int SLOPE_END = 40894;
public static final int PEBBLES = 40896;
public static final int BOULDER_40897 = 40897;
public static final int BOULDER_40899 = 40899;
public static final int STICK_40901 = 40901;
public static final int STICK_40902 = 40902;
public static final int CAULDRON_40903 = 40903;
public static final int TREASURE_CHEST_40904 = 40904;
public static final int DECORATIVE_WINDOW_40899 = 40899;
public static final int STAINEDGLASS_WINDOW_40900 = 40900;
public static final int DECORATIVE_WINDOW_40901 = 40901;
public static final int STAINEDGLASS_WINDOW_40902 = 40902;
public static final int DECORATIVE_WINDOW_40903 = 40903;
public static final int STAINEDGLASS_WINDOW_40904 = 40904;
public static final int ROCKS_40905 = 40905;
public static final int ROCKS_40906 = 40906;
public static final int SOCKING = 40909;
public static final int SOCKING_40910 = 40910;
public static final int SOCKING_40911 = 40911;
public static final int DECORATIVE_WINDOW_40909 = 40909;
public static final int STAINEDGLASS_WINDOW_40910 = 40910;
public static final int DECORATIVE_WINDOW_40911 = 40911;
public static final int STAINEDGLASS_WINDOW_40912 = 40912;
public static final int DECORATIVE_WINDOW_40913 = 40913;
public static final int STAINEDGLASS_WINDOW_40914 = 40914;
public static final int STATUE_40915 = 40915;
public static final int STATUE_40916 = 40916;
public static final int STATUE_40917 = 40917;
public static final int INERT_PORTAL = 40918;
public static final int PORTAL_40919 = 40919;
public static final int ODD_FEATHERS = 40920;
public static final int PORTAL_40921 = 40921;
public static final int BARRIER_40922 = 40922;
public static final int SLEEPING_BAG_40923 = 40923;
public static final int STATUE_40924 = 40924;
public static final int ARCHWAY_40929 = 40929;
public static final int LIGHT_40930 = 40930;
public static final int LIGHT_40931 = 40931;
public static final int EVERGREEN_40932 = 40932;
public static final int EVERGREEN_40933 = 40933;
public static final int TREE_40937 = 40937;
public static final int TREE_40938 = 40938;
public static final int LIGHT_40937 = 40937;
public static final int LIGHT_40938 = 40938;
public static final int LIGHT_40939 = 40939;
public static final int LIGHT_40940 = 40940;
public static final int FIREWORKS = 40941;
public static final int POST_40986 = 40986;
public static final int PARTY_TABLE = 41017;
public static final int POTION_OF_POWER_TABLE_41023 = 41023;
public static final int PEDESTAL_SPACE = 41024;
public static final int PEDESTAL_SPACE_41025 = 41025;
public static final int PEDESTAL_SPACE_41026 = 41026;
public static final int TROPHY_CASE_SPACE = 41027;
public static final int BANNER_STAND_SPACE = 41028;
public static final int OUTFIT_STAND_SPACE = 41029;
public static final int STATUE_SPACE_41030 = 41030;
public static final int RUG_SPACE_41031 = 41031;
public static final int RUG_SPACE_41032 = 41032;
public static final int RUG_SPACE_41033 = 41033;
public static final int ACCOMPLISHMENT_SCROLL_SPACE = 41034;
public static final int TROPHY_PEDESTAL = 41035;
public static final int TROPHY_PEDESTAL_41036 = 41036;
public static final int TROPHY_PEDESTAL_41037 = 41037;
public static final int TROPHY_PEDESTAL_41038 = 41038;
public static final int TROPHY_PEDESTAL_41039 = 41039;
public static final int TROPHY_PEDESTAL_41040 = 41040;
public static final int TROPHY_PEDESTAL_41041 = 41041;
public static final int TROPHY_PEDESTAL_41042 = 41042;
public static final int TROPHY_PEDESTAL_41043 = 41043;
public static final int TROPHY_PEDESTAL_41044 = 41044;
public static final int TROPHY_PEDESTAL_41045 = 41045;
public static final int TROPHY_PEDESTAL_41046 = 41046;
public static final int TROPHY_PEDESTAL_41047 = 41047;
public static final int TROPHY_PEDESTAL_41048 = 41048;
public static final int TROPHY_PEDESTAL_41049 = 41049;
public static final int ORNATE_TROPHY_PEDESTAL = 41050;
public static final int ORNATE_TROPHY_PEDESTAL_41051 = 41051;
public static final int ORNATE_TROPHY_PEDESTAL_41052 = 41052;
public static final int ORNATE_TROPHY_PEDESTAL_41053 = 41053;
public static final int ORNATE_TROPHY_PEDESTAL_41054 = 41054;
public static final int ORNATE_TROPHY_PEDESTAL_41055 = 41055;
public static final int ORNATE_TROPHY_PEDESTAL_41056 = 41056;
public static final int ORNATE_TROPHY_PEDESTAL_41057 = 41057;
public static final int ORNATE_TROPHY_PEDESTAL_41058 = 41058;
public static final int ORNATE_TROPHY_PEDESTAL_41059 = 41059;
public static final int ORNATE_TROPHY_PEDESTAL_41060 = 41060;
public static final int ORNATE_TROPHY_PEDESTAL_41061 = 41061;
public static final int ORNATE_TROPHY_PEDESTAL_41062 = 41062;
public static final int ORNATE_TROPHY_PEDESTAL_41063 = 41063;
public static final int ORNATE_TROPHY_PEDESTAL_41064 = 41064;
public static final int TROPHY_PEDESTAL_41065 = 41065;
public static final int TROPHY_PEDESTAL_41066 = 41066;
public static final int TROPHY_PEDESTAL_41067 = 41067;
public static final int TROPHY_PEDESTAL_41068 = 41068;
public static final int TROPHY_PEDESTAL_41069 = 41069;
public static final int TROPHY_PEDESTAL_41070 = 41070;
public static final int TROPHY_PEDESTAL_41071 = 41071;
public static final int TROPHY_PEDESTAL_41072 = 41072;
public static final int TROPHY_PEDESTAL_41073 = 41073;
public static final int TROPHY_PEDESTAL_41074 = 41074;
public static final int TROPHY_PEDESTAL_41075 = 41075;
public static final int TROPHY_PEDESTAL_41076 = 41076;
public static final int TROPHY_PEDESTAL_41077 = 41077;
public static final int TROPHY_PEDESTAL_41078 = 41078;
public static final int TROPHY_PEDESTAL_41079 = 41079;
public static final int ORNATE_TROPHY_PEDESTAL_41080 = 41080;
public static final int ORNATE_TROPHY_PEDESTAL_41081 = 41081;
public static final int ORNATE_TROPHY_PEDESTAL_41082 = 41082;
public static final int ORNATE_TROPHY_PEDESTAL_41083 = 41083;
public static final int ORNATE_TROPHY_PEDESTAL_41084 = 41084;
public static final int ORNATE_TROPHY_PEDESTAL_41085 = 41085;
public static final int ORNATE_TROPHY_PEDESTAL_41086 = 41086;
public static final int ORNATE_TROPHY_PEDESTAL_41087 = 41087;
public static final int ORNATE_TROPHY_PEDESTAL_41088 = 41088;
public static final int ORNATE_TROPHY_PEDESTAL_41089 = 41089;
public static final int ORNATE_TROPHY_PEDESTAL_41090 = 41090;
public static final int ORNATE_TROPHY_PEDESTAL_41091 = 41091;
public static final int ORNATE_TROPHY_PEDESTAL_41092 = 41092;
public static final int ORNATE_TROPHY_PEDESTAL_41093 = 41093;
public static final int ORNATE_TROPHY_PEDESTAL_41094 = 41094;
public static final int TROPHY_PEDESTAL_41095 = 41095;
public static final int TROPHY_PEDESTAL_41096 = 41096;
public static final int TROPHY_PEDESTAL_41097 = 41097;
public static final int TROPHY_PEDESTAL_41098 = 41098;
public static final int TROPHY_PEDESTAL_41099 = 41099;
public static final int TROPHY_PEDESTAL_41100 = 41100;
public static final int TROPHY_PEDESTAL_41101 = 41101;
public static final int TROPHY_PEDESTAL_41102 = 41102;
public static final int TROPHY_PEDESTAL_41103 = 41103;
public static final int TROPHY_PEDESTAL_41104 = 41104;
public static final int TROPHY_PEDESTAL_41105 = 41105;
public static final int TROPHY_PEDESTAL_41106 = 41106;
public static final int TROPHY_PEDESTAL_41107 = 41107;
public static final int TROPHY_PEDESTAL_41108 = 41108;
public static final int TROPHY_PEDESTAL_41109 = 41109;
public static final int ORNATE_TROPHY_PEDESTAL_41110 = 41110;
public static final int ORNATE_TROPHY_PEDESTAL_41111 = 41111;
public static final int ORNATE_TROPHY_PEDESTAL_41112 = 41112;
public static final int ORNATE_TROPHY_PEDESTAL_41113 = 41113;
public static final int ORNATE_TROPHY_PEDESTAL_41114 = 41114;
public static final int ORNATE_TROPHY_PEDESTAL_41115 = 41115;
public static final int ORNATE_TROPHY_PEDESTAL_41116 = 41116;
public static final int ORNATE_TROPHY_PEDESTAL_41117 = 41117;
public static final int ORNATE_TROPHY_PEDESTAL_41118 = 41118;
public static final int ORNATE_TROPHY_PEDESTAL_41119 = 41119;
public static final int ORNATE_TROPHY_PEDESTAL_41120 = 41120;
public static final int ORNATE_TROPHY_PEDESTAL_41121 = 41121;
public static final int ORNATE_TROPHY_PEDESTAL_41122 = 41122;
public static final int ORNATE_TROPHY_PEDESTAL_41123 = 41123;
public static final int ORNATE_TROPHY_PEDESTAL_41124 = 41124;
public static final int RUG_41125 = 41125;
public static final int OPULENT_RUG = 41126;
public static final int RUG_41127 = 41127;
public static final int OPULENT_RUG_41128 = 41128;
public static final int RUG_41129 = 41129;
public static final int OPULENT_RUG_41130 = 41130;
public static final int TRAILBLAZER_RUG = 41131;
public static final int TRAILBLAZER_RUG_41132 = 41132;
public static final int TRAILBLAZER_RUG_41133 = 41133;
public static final int TRAILBLAZER_RUG_41134 = 41134;
public static final int TRAILBLAZER_RUG_41135 = 41135;
public static final int TRAILBLAZER_RUG_41136 = 41136;
public static final int TRAILBLAZER_RUG_41137 = 41137;
public static final int TRAILBLAZER_RUG_41138 = 41138;
public static final int TRAILBLAZER_RUG_41139 = 41139;
public static final int TRAILBLAZER_RUG_41140 = 41140;
public static final int TRAILBLAZER_RUG_41141 = 41141;
public static final int TRAILBLAZER_RUG_41142 = 41142;
public static final int TRAILBLAZER_RUG_41143 = 41143;
public static final int TRAILBLAZER_RUG_41144 = 41144;
public static final int TRAILBLAZER_RUG_41145 = 41145;
public static final int TRAILBLAZER_RUG_41146 = 41146;
public static final int TRAILBLAZER_RUG_41147 = 41147;
public static final int TRAILBLAZER_RUG_41148 = 41148;
public static final int TRAILBLAZER_RUG_41149 = 41149;
public static final int TRAILBLAZER_RUG_41150 = 41150;
public static final int TRAILBLAZER_RUG_41151 = 41151;
public static final int TRAILBLAZER_RUG_41152 = 41152;
public static final int TRAILBLAZER_RUG_41153 = 41153;
public static final int TRAILBLAZER_RUG_41154 = 41154;
public static final int OAK_TROPHY_CASE = 41155;
public static final int OAK_TROPHY_CASE_41156 = 41156;
public static final int MAHOGANY_TROPHY_CASE = 41157;
public static final int MAHOGANY_TROPHY_CASE_41158 = 41158;
public static final int BANNER_STAND = 41159;
public static final int BANNER_STAND_41160 = 41160;
public static final int BANNER_STAND_41161 = 41161;
public static final int ORNATE_BANNER_STAND = 41162;
public static final int ORNATE_BANNER_STAND_41163 = 41163;
public static final int ORNATE_BANNER_STAND_41164 = 41164;
public static final int OAK_OUTFIT_STAND = 41165;
public static final int OAK_OUTFIT_STAND_41166 = 41166;
public static final int OAK_OUTFIT_STAND_41167 = 41167;
public static final int OAK_OUTFIT_STAND_41168 = 41168;
public static final int OAK_OUTFIT_STAND_41169 = 41169;
public static final int OAK_OUTFIT_STAND_41170 = 41170;
public static final int OAK_OUTFIT_STAND_41171 = 41171;
public static final int MAHOGANY_OUTFIT_STAND = 41172;
public static final int MAHOGANY_OUTFIT_STAND_41173 = 41173;
public static final int MAHOGANY_OUTFIT_STAND_41174 = 41174;
public static final int MAHOGANY_OUTFIT_STAND_41175 = 41175;
public static final int MAHOGANY_OUTFIT_STAND_41176 = 41176;
public static final int MAHOGANY_OUTFIT_STAND_41177 = 41177;
public static final int MAHOGANY_OUTFIT_STAND_41178 = 41178;
public static final int LEAGUE_STATUE = 41179;
public static final int ORNATE_LEAGUE_STATUE = 41180;
public static final int TRAILBLAZER_GLOBE = 41181;
public static final int LEAGUE_ACCOMPLISHMENT_SCROLL = 41182;
/* This file is automatically generated. Do not edit. */
}
}
@@ -54,4 +54,4 @@ public interface ParamHolder
* Sets the value of a given {@link ParamID}
*/
void setValue(int paramID, String value);
}
}
@@ -45,4 +45,4 @@ public class ParamID
public static final int SETTING_SLIDER_IS_DRAGGABLE = 1108;
public static final int SETTING_SLIDER_DEADZONE = 1109;
public static final int SETTING_SLIDER_DEADTIME = 1110;
}
}
@@ -683,6 +683,7 @@ public class Perspective
{
int[] x2d = new int[m.getVerticesCount()];
int[] y2d = new int[m.getVerticesCount()];
final int[] faceColors3 = m.getFaceColors3();
Perspective.modelToCanvas(client,
m.getVerticesCount(),
@@ -709,6 +710,11 @@ public class Perspective
nextTri:
for (int tri = 0; tri < m.getTrianglesCount(); tri++)
{
if (faceColors3[tri] == -2)
{
continue;
}
int
minX = Integer.MAX_VALUE,
minY = Integer.MAX_VALUE,
@@ -66,4 +66,9 @@ public interface Preferences
* @param volume 0-127 inclusive
*/
void setAreaSoundEffectVolume(int volume);
/**
* Gets if the login name should be replaced with asterisks
*/
boolean getHideUsername();
}
@@ -36,7 +36,7 @@ public enum Quest
THE_CORSAIR_CURSE(301, "The Corsair Curse"),
DEMON_SLAYER(302, "Demon Slayer"),
DORICS_QUEST(303, "Doric's Quest"),
DRAGON_SLAYER(304, "Dragon Slayer"),
DRAGON_SLAYER_I(304, "Dragon Slayer I"),
ERNEST_THE_CHICKEN(305, "Ernest the Chicken"),
GOBLIN_DIPLOMACY(306, "Goblin Diplomacy"),
IMP_CATCHER(307, "Imp Catcher"),
@@ -133,7 +133,7 @@ public enum Quest
PLAGUE_CITY(407, "Plague City"),
PRIEST_IN_PERIL(408, "Priest in Peril"),
THE_QUEEN_OF_THIEVES(409, "The Queen of Thieves"),
RAG_AND_BONE_MAN(410, "Rag and Bone Man"),
RAG_AND_BONE_MAN_I(410, "Rag and Bone Man I"),
RAG_AND_BONE_MAN_II(411, "Rag and Bone Man II"),
RATCATCHERS(412, "Ratcatchers"),
RECIPE_FOR_DISASTER(413, "Recipe for Disaster"),
@@ -93,4 +93,4 @@ public interface ScriptEvent
* This method must be ran on the client thread and is not reentrant
*/
void run();
}
}
@@ -370,4 +370,4 @@ public final class ScriptID
*/
@ScriptArguments(integer = 4)
public static final int WIKI_ICON_UPDATE = 3306;
}
}
@@ -24,6 +24,9 @@
*/
package net.runelite.api;
/**
* @see ParamID#SETTING_ID
*/
public class SettingID
{
public static final int CAMERA_ZOOM = 14;
@@ -31,4 +34,4 @@ public class SettingID
public static final int MUSIC_VOLUME = 30;
public static final int EFFECT_VOLUME = 31;
public static final int AREA_VOLUME = 32;
}
}
@@ -35,4 +35,4 @@ package net.runelite.api;
public interface StructComposition extends ParamHolder
{
int getId();
}
}
@@ -34,4 +34,4 @@ public class StructID
public static final int SETTINGS_MUSIC_VOLUME = 2753;
public static final int SETTINGS_EFFECT_VOLUME = 2754;
public static final int SETTINGS_AREA_VOLUME = 2755;
}
}
@@ -42,11 +42,6 @@ import lombok.Getter;
@Getter
public enum Varbits
{
/*
* Kharedst's Memoirs Teleport Item
*/
KHAREDSTS_MEMOIRS_CHARGES(6035),
/*
* If chatbox is transparent or not
*/
@@ -62,11 +57,6 @@ public enum Varbits
*/
CHAT_SCROLLBAR_ON_LEFT(6374),
/**
* Grand Exchange
*/
GRAND_EXCHANGE_PRICE_PER_ITEM(4398),
/**
* Runepouch
*/
@@ -110,23 +100,6 @@ public enum Varbits
PRAYER_PRESERVE(5466),
PRAYER_RIGOUR(5464),
PRAYER_AUGURY(5465),
/**
* Locked Prayers
* 0-7 = Locked
* 8 = Unlocked
*/
CHIVPIETY_UNLOCKED(3909),
/**
* Locked Prayers
* 0 = Locked
* 1 = Unlocked
*/
RIGOUR_UNLOCKED(5451),
AUGURY_UNLOCKED(5452),
PRESERVE_UNLOCKED(5453),
/**
* Diary Entries
@@ -275,12 +248,12 @@ public enum Varbits
/**
* Blast Furnace Bar Dispenser
* <p>
*
* These are the expected values:
* 0 = No bars being processed
* 1 = Ores are being processed on the conveyor belt, bar dispenser cannot be checked
* 2 = Bars are cooling down
* 3 = Bars can be collected
* 0 = No bars being processed
* 1 = Ores are being processed on the conveyor belt, bar dispenser cannot be checked
* 2 = Bars are cooling down
* 3 = Bars can be collected
*/
BAR_DISPENSER(936),
@@ -292,11 +265,11 @@ public enum Varbits
/**
* Experience tracker
* <p>
*
* EXPERIENCE_TRACKER_POSITION expected values:
* 0 = Right
* 1 = Middle
* 2 = Left
* 0 = Right
* 1 = Middle
* 2 = Left
*/
EXPERIENCE_TRACKER_POSITION(4692),
EXPERIENCE_TRACKER_COUNTER(4697),
@@ -313,7 +286,7 @@ public enum Varbits
TITHE_FARM_SACK_AMOUNT(4900),
TITHE_FARM_SACK_ICON(5370),
TITHE_FARM_POINTS(4893),
/**
* Blast Mine
*/
@@ -349,23 +322,12 @@ public enum Varbits
* Theatre of Blood 1=In Party, 2=Inside/Spectator, 3=Dead Spectating
*/
THEATRE_OF_BLOOD(6440),
BLOAT_DOOR(6447),
/**
* Theatre of Blood orb varbits each number stands for the player's health on a scale of 1-27 (I think), 0 hides the orb
*/
THEATRE_OF_BLOOD_ORB_1(6442),
THEATRE_OF_BLOOD_ORB_2(6443),
THEATRE_OF_BLOOD_ORB_3(6444),
THEATRE_OF_BLOOD_ORB_4(6445),
THEATRE_OF_BLOOD_ORB_5(6446),
/**
* Nightmare Zone
*/
NMZ_ABSORPTION(3956),
NMZ_POINTS(3949),
NMZ_OVERLOAD(3955),
/**
* Blast Furnace
@@ -394,8 +356,6 @@ public enum Varbits
/**
* Pyramid plunder
*/
PYRAMID_PLUNDER_SARCO_OPEN(2362),
PYRAMID_PLUNDER_CHEST_OPEN(2363),
PYRAMID_PLUNDER_ROOM_LOCATION(2365),
PYRAMID_PLUNDER_TIMER(2375),
PYRAMID_PLUNDER_THIEVING_LEVEL(2376),
@@ -426,25 +386,11 @@ public enum Varbits
*/
MULTICOMBAT_AREA(4605),
/**
* In the Wilderness
*/
IN_THE_WILDERNESS(5963),
/**
* Kingdom Management
*/
KINGDOM_FAVOR(72),
KINGDOM_COFFER(74),
KINGDOM_WORKERS_WOOD(81),
KINGDOM_WORKERS_HERBS(82),
KINGDOM_WORKERS_FISHING(83),
KINGDOM_WORKERS_MINING(84),
KINGDOM_WORKERS_FISH_COOKED_BUTTON(135), // 0 - Raw, 1 - Cooked
KINGDOM_WORKERS_HARDWOOD(2131),
KINGDOM_WORKERS_FARM(2132),
KINGDOM_WORKERS_HARDWOOD_BUTTON(2133), // 0 - Mahogany, 1 - Teak, 2 - Both
KINGDOM_WORKERS_HERBS_BUTTON(2134), // 0 - Herbs, 1 - Flax
/**
* The Hand in the Sand quest status
@@ -521,11 +467,6 @@ public enum Varbits
*/
ACCOUNT_TYPE(1777),
/**
* Varbit used for Slayer reward points
*/
SLAYER_REWARD_POINTS(4068),
/**
* The varbit that stores the oxygen percentage for player
*/
@@ -586,20 +527,6 @@ public enum Varbits
*/
VENGEANCE_COOLDOWN(2451),
/**
* 0 = standard
* 1 = ancients
* 2 = lunars
* 3 = arrceus
**/
SPELLBOOK(4070),
/**
* Bank settings/flags
**/
BANK_NOTE_FLAG(3958),
/**
* Amount of items in each bank tab
*/
@@ -620,13 +547,6 @@ public enum Varbits
*/
GE_OFFER_CREATION_TYPE(4397),
/**
* Spells being auto-casted
*/
AUTO_CAST_SPELL(276),
/**
* The active tab within the quest interface
*/
@@ -640,140 +560,8 @@ public enum Varbits
EXPLORER_RING_ALCHS(4554),
EXPLORER_RING_RUNENERGY(4553),
/**
* Temple Trekking
*/
TREK_POINTS(1955),
TREK_STARTED(1956),
TREK_EVENT(1958),
TREK_STATUS(6719),
BLOAT_ENTERED_ROOM(6447),
/**
* f2p Quest varbits, these don't hold the completion value.
*/
QUEST_DEMON_SLAYER(2561),
QUEST_GOBLIN_DIPLOMACY(2378),
QUEST_MISTHALIN_MYSTERY(3468),
QUEST_THE_CORSAIR_CURSE(6071),
QUEST_X_MARKS_THE_SPOT(8063),
QUEST_ERNEST_LEVER_A(1788),
QUEST_ERNEST_LEVER_B(1789),
QUEST_ERNEST_LEVER_C(1790),
QUEST_ERNEST_LEVER_D(1791),
QUEST_ERNEST_LEVER_E(1792),
QUEST_ERNEST_LEVER_F(1793),
/**
* member Quest varbits, these don't hold the completion value.
*/
QUEST_ANIMAL_MAGNETISM(3185),
QUEST_BETWEEN_A_ROCK(299),
QUEST_CONTACT(3274),
QUEST_ZOGRE_FLESH_EATERS(487),
QUEST_DARKNESS_OF_HALLOWVALE(2573),
QUEST_DEATH_TO_THE_DORGESHUUN(2258),
QUEST_DESERT_TREASURE(358),
QUEST_DEVIOUS_MINDS(1465),
QUEST_EAGLES_PEAK(2780),
QUEST_ELEMENTAL_WORKSHOP_II(2639),
QUEST_ENAKHRAS_LAMENT(1560),
QUEST_ENLIGHTENED_JOURNEY(2866),
QUEST_THE_EYES_OF_GLOUPHRIE(2497),
QUEST_FAIRYTALE_I_GROWING_PAINS(1803),
QUEST_FAIRYTALE_II_CURE_A_QUEEN(2326),
QUEST_THE_FEUD(334), // 14 = able to pickpocket
QUEST_FORGETTABLE_TALE(822),
QUEST_GARDEN_OF_TRANQUILLITY(961),
QUEST_GHOSTS_AHOY(217),
QUEST_THE_GIANT_DWARF(571),
QUEST_THE_GOLEM(346),
QUEST_HORROR_FROM_THE_DEEP(34),
QUEST_ICTHLARINS_LITTLE_HELPER(418),
QUEST_IN_AID_OF_THE_MYREQUE(1990),
QUEST_THE_LOST_TRIBE(532),
QUEST_LUNAR_DIPLOMACY(2448),
QUEST_MAKING_HISTORY(1383),
QUEST_MOUNTAIN_DAUGHTER(260),
QUEST_MOURNINGS_END_PART_II(1103),
QUEST_MY_ARMS_BIG_ADVENTURE(2790),
QUEST_RATCATCHERS(1404),
QUEST_RECIPE_FOR_DISASTER(1850),
QUEST_RECRUITMENT_DRIVE(657),
QUEST_ROYAL_TROUBLE(2140),
QUEST_THE_SLUG_MENACE(2610),
QUEST_SHADOW_OF_THE_STORM(1372),
QUEST_A_SOULS_BANE(2011),
QUEST_SPIRITS_OF_THE_ELID(1444),
QUEST_SWAN_SONG(2098),
QUEST_A_TAIL_OF_TWO_CATS(1028),
QUEST_TEARS_OF_GUTHIX(451),
QUEST_WANTED(1051),
QUEST_COLD_WAR(3293),
QUEST_THE_FREMENNIK_ISLES(3311),
QUEST_TOWER_OF_LIFE(3337),
QUEST_WHAT_LIES_BELOW(3523),
QUEST_OLAFS_QUEST(3534),
QUEST_ANOTHER_SLICE_OF_HAM(3550),
QUEST_DREAM_MENTOR(3618),
QUEST_GRIM_TALES(2783),
QUEST_KINGS_RANSOM(3888),
QUEST_MONKEY_MADNESS_II(5027),
QUEST_CLIENT_OF_KOUREND(5619),
QUEST_BONE_VOYAGE(5795),
QUEST_THE_QUEEN_OF_THIEVES(6037),
QUEST_THE_DEPTHS_OF_DESPAIR(6027),
QUEST_DRAGON_SLAYER_II(6104),
QUEST_TALE_OF_THE_RIGHTEOUS(6358),
QUEST_A_TASTE_OF_HOPE(6396),
QUEST_MAKING_FRIENDS_WITH_MY_ARM(6528),
QUEST_THE_ASCENT_OF_ARCEUUS(7856),
QUEST_THE_FORSAKEN_TOWER(7796),
//TODO
QUEST_SONG_OF_THE_ELVES(7796),
/**
* mini-quest varbits, these don't hold the completion value.
*/
QUEST_ARCHITECTURAL_ALLIANCE(4982),
QUEST_BEAR_YOUR_SOUL(5078),
QUEST_CURSE_OF_THE_EMPTY_LORD(821),
QUEST_ENCHANTED_KEY(1391),
QUEST_THE_GENERALS_SHADOW(3330),
QUEST_SKIPPY_AND_THE_MOGRES(1344),
QUEST_LAIR_OF_TARN_RAZORLOR(3290),
QUEST_FAMILY_PEST(5347),
QUEST_THE_MAGE_ARENA_II(6067),
//TODO
QUEST_IN_SEARCH_OF_KNOWLEDGE(6067),
/**
* Spellbook filtering (1 = unfiltered, 0 = filtered)
*/
FILTER_SPELLBOOK(6718),
/**
* POH Building mode (1 = yes, 0 = no)
*/
BUILDING_MODE(2176),
WINTERTODT_TIMER(7980),
/**
* 1 if in game, 0 if not
*/
LMS_IN_GAME(5314),
/**
* Amount of pvp kills in current game
*/
LMS_KILLS(5315),
/**
* The x coordinate of the final safespace (world coord)
*/
LMS_SAFE_X(5316),
/**
* League relics
*/
@@ -791,6 +579,15 @@ public enum Varbits
MUTED_SOUND_EFFECT_VOLUME(9674),
MUTED_AREA_EFFECT_VOLUME(9675),
/**
* Parasite infection status during nightmare of ashihama bossfight
*
* 0 = not infected
* 1 = infected
*
*/
PARASITE(10151),
/**
* Whether the Special Attack orb is disabled due to being in a PvP area
*
@@ -799,69 +596,7 @@ public enum Varbits
*
* @see <a href="https://oldschool.runescape.wiki/w/Minimap#Special_attack_orb">The OSRS Wiki's Minimap page</a>
*/
PVP_SPEC_ORB(8121),
LMS_POISON_PROGRESS(5317),
/**
* The y coordinate of the final safespace (world coord)
*/
LMS_SAFE_Y(5320),
/**
* 1 is true, 0 is false.
*/
GAUNTLET_FINAL_ROOM_ENTERED(9177),
/**
* 1 is true, 0 is false.
*/
GAUNTLET_ENTERED(9178),
WITHDRAW_X_AMOUNT(3960),
IN_PVP_AREA(8121),
/**
* Value of hotkey varbits can be 0-13
* 0 corresponds to no hotkey set
* 1-12 correspond to F1-F12 respectively
* 13 corresponds to escape
*/
COMBAT_TAB_HOTKEY(4675),
STATS_TAB_HOTKEY(4676),
QUESTS_TAB_HOTKEY(4677),
INVENTORY_TAB_HOTKEY(4678),
EQUIPMENT_TAB_HOTKEY(4679),
PRAYER_TAB_HOTKEY(4680),
SPELLBOOK_TAB_HOTKEY(4682),
FRIENDS_TAB_HOTKEY(4684),
ACCOUNT_MANAGEMENT_TAB_HOTKEY(6517),
LOGOUT_TAB_HOTKEY(4689),
OPTIONS_TAB_HOTKEY(4686),
EMOTES_TAB_HOTKEY(4687),
CLAN_TAB_HOTKEY(4683),
MUSIC_TAB_HOTKEY(4688),
/**
* Chat Notifications settings
* <br>
* LOOT_DROP_NOTIFICATIONS: 1 is true, 0 is false
* LOOT_DROP_NOTIFICATIONS_VALUE: gp value
* UNTRADEABLE_LOOT_NOTIFICATIONS: 1 is true, 0 is false
* BOSS_KILL_COUNT_UPDATES: 1 is filtered, 0 is unfiltered
* DROP_ITEM_WARNINGS: 1 is true, 0 is false
* DROP_ITEM_WARNINGS_VALUE: gp value
*/
LOOT_DROP_NOTIFICATIONS(5399),
LOOT_DROP_NOTIFICATIONS_VALUE(5400),
UNTRADEABLE_LOOT_NOTIFICATIONS(5402),
BOSS_KILL_COUNT_UPDATES(4930),
DROP_ITEM_WARNINGS(5411),
DROP_ITEM_WARNINGS_VALUE(5412),
PARASITE(10151),
;
PVP_SPEC_ORB(8121);
/**
* The raw varbit ID.
@@ -1,14 +1,34 @@
/*
* Copyright (c) 2020 Abex
* 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.api.events;
import lombok.Value;
import net.runelite.api.Player;
import net.runelite.api.PlayerComposition;
/**
* This will fire whenever the {@link PlayerComposition} hash changes.
*/
@Value
public class PlayerChanged implements Event
public class PlayerChanged
{
Player player;
private final Player player;
}
@@ -38,4 +38,4 @@ public class PostStructComposition
* The newly created struct.
*/
private StructComposition structComposition;
}
}
@@ -46,4 +46,4 @@ public class WidgetClosed
* If the interface will be unloaded or if it will be immediately reloaded
*/
private final boolean unload;
}
}
@@ -26,7 +26,7 @@ package net.runelite.api.kit;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.runelite.api.widgets.WidgetInfo;
import com.openosrs.api.widgets.WidgetInfo;
/**
* Represents an equipment slot in a players composition.
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
import net.runelite.api.Client;
import net.runelite.api.QueryResults;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import com.openosrs.api.widgets.WidgetInfo;
import net.runelite.api.widgets.WidgetItem;
public class ShopItemQuery extends WidgetItemQuery
@@ -25,7 +25,7 @@
package net.runelite.api.widgets;
import java.awt.Rectangle;
import java.util.List;
import java.util.Collection;
import net.runelite.api.FontTypeFace;
import net.runelite.api.Point;
import net.runelite.api.SpritePixels;
@@ -68,12 +68,6 @@ public interface Widget
*/
void setType(int type);
int getButtonType();
boolean isWidgetItemDragged(int index);
Point getWidgetItemDragOffsets();
/**
* Gets the type of content displayed by the widget.
*/
@@ -185,18 +179,6 @@ public interface Widget
@Deprecated
void setRelativeY(int y);
String getSpellName();
/**
* You probably want {@link Widget#getText()} instead
*/
String getRSButtonText();
/**
* You probably want {@link Widget#getText()} instead
*/
String getButtonText();
/**
* Gets the text displayed on this widget.
*
@@ -253,12 +235,6 @@ public interface Widget
*/
String getName();
/**
* Gets the internal field returned by getName unfiltered
* @return the unfiltered name
*/
String getRSName();
/**
* Sets the name of the widget.
*
@@ -266,11 +242,114 @@ public interface Widget
*/
void setName(String name);
/**
* Gets the Model/NPC/Item ID displayed in the widget.
*
* @see WidgetModelType
*/
int getModelId();
/**
* Sets the Model/NPC/Item ID displayed in the widget.
*
* @see WidgetModelType
*/
void setModelId(int id);
/**
* Gets the model type of the widget.
*
* @see WidgetModelType
*/
int getModelType();
/**
* Sets the model type of the widget.
*
* @param type the new model type
* @see WidgetModelType
*/
void setModelType(int type);
/**
* Gets the sequence ID used to animate the model in the widget
*
* @see net.runelite.api.AnimationID
*/
int getAnimationId();
/**
* Sets the sequence ID used to animate the model in the widget
*
* @see net.runelite.api.AnimationID
*/
void setAnimationId(int animationId);
/**
* Gets the x rotation of the model displayed in the widget.
* 0 = no rotation, 2047 = full rotation
*/
int getRotationX();
/**
* Sets the x rotation of the model displayed in the widget.
* <br>
* Note: Setting this value outside of the input range defined by {@link Widget#getRotationX()} will cause a client
* crash.
*
* @param modelX the new model x rotation value
*/
void setRotationX(int modelX);
/**
* Gets the y rotation of the model displayed in the widget.
* 0 = no rotation, 2047 = full rotation
*/
int getRotationY();
/**
* Sets the y rotation of the model displayed in the widget.
* <br>
* Note: Setting this value outside of the input range defined by {@link Widget#getRotationY()} will cause a client
* crash.
*
* @param modelY the new model y rotation value
*/
void setRotationY(int modelY);
/**
* Gets the z rotation of the model displayed in the widget.
* 0 = no rotation, 2047 = full rotation
*/
int getRotationZ();
/**
* Sets the z rotation of the model displayed in the widget.
* <br>
* Note: Setting this value outside of the input range defined by {@link Widget#getRotationZ()} will cause a client
* crash.
*
* @param modelZ the new model z rotation value
*/
void setRotationZ(int modelZ);
/**
* Gets the amount zoomed in on the model displayed in the widget.
*/
int getModelZoom();
/**
* Sets the amount zoomed in on the model displayed in the widget.
*
* @param modelZoom the new model zoom value
*/
void setModelZoom(int modelZoom);
/**
* Gets the sprite ID displayed in the widget.
*
* @return the sprite ID
* SpriteID
* @see net.runelite.api.SpriteID
*/
int getSpriteId();
@@ -288,7 +367,7 @@ public interface Widget
* Sets the sprite ID displayed in the widget.
*
* @param spriteId the sprite ID
* SpriteID
* @see net.runelite.api.SpriteID
*/
void setSpriteId(int spriteId);
@@ -321,105 +400,6 @@ public interface Widget
*/
int getIndex();
/**
* Gets the Model/NPC/Item ID displayed in the widget.
*
* @see WidgetModelType
*/
int getModelId();
/**
* Sets the Model/NPC/Item ID displayed in the widget.
*
* @see WidgetModelType
*/
void setModelId(int id);
/**
* Gets the model type of the widget.
*
* @see WidgetModelType
*/
int getModelType();
/**
* Sets the model type of the widget.
*
* @param type the new model type
* @see WidgetModelType
*/
void setModelType(int type);
/**
* Gets the sequence ID used to animate the model in the widget
*
* @see net.runelite.api.AnimationID
*/
int getAnimationId();
/**
* Sets the sequence ID used to animate the model in the widget
*
* @see net.runelite.api.AnimationID
*/
void setAnimationId(int animationId);
/**
* Gets the x rotation of the model displayed in the widget
*
* @return the x rotation
*/
int getRotationX();
/**
* Sets the x rotation of the model displayed in the widget
*
* @param rotationX 0 = no rotation, 2047 = full rotation, outside range = crash
*/
void setRotationX(int rotationX);
/**
* Gets the y rotation of the model displayed in the widget
*
* @return the y rotation
*/
int getRotationY();
/**
* Sets the y rotation of the model displayed in the widget
*
* @param rotationY 0 = no rotation, 2047 = full rotation, outside range = crash
*/
void setRotationY(int rotationY);
/**
* Gets the z rotation of the model displayed in the widget
*
* @return the z rotation
*/
int getRotationZ();
/**
* Sets the z rotation of the model displayed in the widget
*
* @param rotationZ 0 = no rotation, 2047 = full rotation, outside range = crash
*/
void setRotationZ(int rotationZ);
/**
* Gets the amount zoomed in on the model displayed in the widget
*
* @return the amount zoomed in
*/
int getModelZoom();
/**
* Sets the amount zoomed in on the model displayed in the widget
*
* @param modelZoom the new zoom amount
*/
void setModelZoom(int modelZoom);
/**
* Gets the location the widget is being drawn on the canvas.
* <p>
@@ -433,7 +413,7 @@ public interface Widget
/**
* Gets the width of the widget.
* <p>
* If this widget is storing any {@link // WidgetItem}s, this value is
* If this widget is storing any {@link WidgetItem}s, this value is
* used to store the number of item slot columns.
*
* @return the width
@@ -479,7 +459,7 @@ public interface Widget
*
* @return any items displayed, or null if there are no items
*/
List<WidgetItem> getWidgetItems();
Collection<WidgetItem> getWidgetItems();
/**
* Gets a widget item at a specific index.
@@ -629,8 +609,6 @@ public interface Widget
*/
String[] getActions();
String[] getItemActions();
/**
* Creates a dynamic widget child
*
@@ -762,6 +740,11 @@ public interface Widget
*/
Object[] getOnLoadListener();
/**
* Gets the script and arguments to be ran when one of the listened for inventories changes.
*
* @return
*/
Object[] getOnInvTransmitListener();
/**
@@ -964,36 +947,6 @@ public interface Widget
*/
void setNoScrollThrough(boolean noScrollThrough);
/**
* Changes the parent ID for the widget
*/
void setParentId(int id);
/**
* Changes the ID of the widget
*/
void setId(int id);
/**
* Sets the index of this element
*/
void setIndex(int index);
/**
* Seems like this needs to set to true when creating new widgets
*/
void setIsIf3(boolean isIf3);
/**
* Returns yes if your mouse pointer is over this widget or any of it's children.
*/
boolean containsMouse();
/**
* Gets the image which is (or should be) drawn on this widget
*/
SpritePixels getSprite();
/**
* {@link net.runelite.api.VarPlayer}s that triggers this widgets varTransmitListener
*/
@@ -1051,4 +1004,62 @@ public interface Widget
* @param args A ScriptID, then the args for the script
*/
void setOnVarTransmitListener(Object ...args);
}
//////////////////////////////////// OPRS
int getButtonType();
boolean isWidgetItemDragged(int index);
Point getWidgetItemDragOffsets();
String getSpellName();
/**
* You probably want {@link Widget#getText()} instead
*/
String getRSButtonText();
/**
* You probably want {@link Widget#getText()} instead
*/
String getButtonText();
/**
* Gets the internal field returned by getName unfiltered
* @return the unfiltered name
*/
String getRSName();
String[] getItemActions();
/**
* Changes the parent ID for the widget
*/
void setParentId(int id);
/**
* Changes the ID of the widget
*/
void setId(int id);
/**
* Sets the index of this element
*/
void setIndex(int index);
/**
* Seems like this needs to set to true when creating new widgets
*/
void setIsIf3(boolean isIf3);
/**
* Returns yes if your mouse pointer is over this widget or any of it's children.
*/
boolean containsMouse();
/**
* Gets the image which is (or should be) drawn on this widget
*/
SpritePixels getSprite();
}
@@ -41,12 +41,10 @@ public class WidgetID
public static final int LOGOUT_PANEL_ID = 182;
public static final int BANK_GROUP_ID = 12;
public static final int BANK_INVENTORY_GROUP_ID = 15;
public static final int BANK_PIN_GROUP_ID = 213;
public static final int GRAND_EXCHANGE_INVENTORY_GROUP_ID = 467;
public static final int GRAND_EXCHANGE_GROUP_ID = 465;
public static final int DEPOSIT_BOX_GROUP_ID = 192;
public static final int INVENTORY_GROUP_ID = 149;
public static final int PLAYER_TRADE_CONFIRM_GROUP_ID = 334;
public static final int PLAYER_TRADE_SCREEN_GROUP_ID = 335;
public static final int PLAYER_TRADE_INVENTORY_GROUP_ID = 336;
public static final int FRIENDS_LIST_GROUP_ID = 429;
@@ -59,8 +57,6 @@ public class WidgetID
public static final int ACHIEVEMENT_DIARY_GROUP_ID = 259;
public static final int PEST_CONTROL_BOAT_GROUP_ID = 407;
public static final int PEST_CONTROL_GROUP_ID = 408;
public static final int PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID = 243;
public static final int DIALOG_MINIGAME_GROUP_ID = 229;
public static final int FRIENDS_CHAT_GROUP_ID = 7;
public static final int MINIMAP_GROUP_ID = 160;
public static final int LOGIN_CLICK_TO_PLAY_GROUP_ID = 378;
@@ -87,7 +83,6 @@ public class WidgetID
public static final int BA_DEFENDER_GROUP_ID = 487;
public static final int BA_HEALER_GROUP_ID = 488;
public static final int BA_REWARD_GROUP_ID = 497;
public static final int BA_HORN_OF_GLORY = 484;
public static final int LEVEL_UP_GROUP_ID = 233;
public static final int DIALOG_SPRITE_GROUP_ID = 193;
public static final int QUEST_COMPLETED_GROUP_ID = 153;
@@ -96,7 +91,6 @@ public class WidgetID
public static final int RAIDS_GROUP_ID = 513;
public static final int TOB_PARTY_GROUP_ID = 28;
public static final int MOTHERLODE_MINE_GROUP_ID = 382;
public static final int MOTHERLODE_MINE_FULL_INVENTORY_GROUP_ID = 229;
public static final int EXPERIENCE_DROP_GROUP_ID = 122;
public static final int PUZZLE_BOX_GROUP_ID = 306;
public static final int LIGHT_BOX_GROUP_ID = 322;
@@ -121,19 +115,15 @@ public class WidgetID
public static final int VARROCK_MUSEUM_QUIZ_GROUP_ID = 533;
public static final int KILL_LOGS_GROUP_ID = 549;
public static final int DIARY_QUEST_GROUP_ID = 119;
public static final int THEATRE_OF_BLOOD_GROUP_ID = 28;
public static final int THEATRE_OF_BLOOD_GROUP_ID = 23;
public static final int WORLD_SWITCHER_GROUP_ID = 69;
public static final int DIALOG_PLAYER_GROUP_ID = 217;
public static final int DIALOG_OPTION_GROUP_ID = 219;
public static final int DIALOG_NOTIFICATION_GROUP_ID = 229;
public static final int FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID = 608;
public static final int DIALOG_PLAYER_GROUP_ID = 217;
public static final int DRIFT_NET_FISHING_REWARD_GROUP_ID = 607;
public static final int FOSSIL_ISLAND_OXYGENBAR_ID = 609;
public static final int MINIGAME_TAB_ID = 76;
public static final int SPELLBOOK_GROUP_ID = 218;
public static final int PVP_GROUP_ID = 90;
public static final int PERFORMERS_FOR_THE_THEATRE_GROUPS_GROUP_ID = 364;
public static final int PERFORMERS_FOR_THE_THEATRE_PLAYERS_GROUP_ID = 50;
public static final int FISHING_TRAWLER_GROUP_ID = 366;
public static final int FISHING_TRAWLER_REWARD_GROUP_ID = 367;
public static final int ZEAH_MESS_HALL_GROUP_ID = 235;
@@ -141,14 +131,10 @@ public class WidgetID
public static final int LOOTING_BAG_GROUP_ID = 81;
public static final int SKOTIZO_GROUP_ID = 308;
public static final int ENTERING_HOUSE_GROUP_ID = 71;
public static final int FULLSCREEN_CONTAINER_TLI = 165;
public static final int FULLSCREEN_CONTAINER_TLI = 165;
public static final int QUESTLIST_GROUP_ID = 399;
public static final int SKILLS_GROUP_ID = 320;
public static final int DIALOG_SPRITE2_ID = 11;
public static final int EQUIPMENT_PAGE_GROUP_ID = 84;
public static final int QUESTTAB_GROUP_ID = 629;
public static final int MUSIC_GROUP_ID = 239;
public static final int MUSICTAB_GROUP_ID = 239;
public static final int BARROWS_PUZZLE_GROUP_ID = 25;
public static final int KEPT_ON_DEATH_GROUP_ID = 4;
public static final int GUIDE_PRICE_GROUP_ID = 464;
@@ -161,18 +147,16 @@ public class WidgetID
public static final int SEED_BOX_GROUP_ID = 128;
public static final int SEED_VAULT_GROUP_ID = 631;
public static final int EXPLORERS_RING_ALCH_GROUP_ID = 483;
public static final int SETTINGS_SIDE_GROUP_ID = 116;
public static final int SETTINGS_GROUP_ID = 134;
public static final int GWD_KC_GROUP_ID = 406;
public static final int LMS_GROUP_ID = 333;
public static final int LMS_INGAME_GROUP_ID = 328;
public static final int JEWELLERY_BOX_GROUP_ID = 590;
public static final int OPTIONS_GROUP_ID = 261;
public static final int MULTISKILL_MENU_GROUP_ID = 270;
public static final int THEATRE_OF_BLOOD_PARTY_GROUP_ID = 28;
public static final int GWD_KC_GROUP_ID = 406;
public static final int ADVENTURE_LOG_ID = 187;
public static final int GENERIC_SCROLL_GROUP_ID = 625;
public static final int GAUNTLET_TIMER_GROUP_ID = 637;
public static final int GAUNTLET_MAP_GROUP_ID = 638;
public static final int HALLOWED_SEPULCHRE_TIMER_GROUP_ID = 668;
public static final int BANK_PIN_GROUP_ID = 213;
public static final int HEALTH_OVERLAY_BAR_GROUP_ID = 303;
public static final int CHAMBERS_OF_XERIC_STORAGE_UNIT_PRIVATE_GROUP_ID = 271;
public static final int CHAMBERS_OF_XERIC_STORAGE_UNIT_SHARED_GROUP_ID = 550;
@@ -181,22 +165,6 @@ public class WidgetID
public static final int DUEL_INVENTORY_OTHER_GROUP_ID = 481;
public static final int TRAILBLAZER_AREAS_GROUP_ID = 512;
public static final int SETTINGS_SIDE_GROUP_ID = 116;
public static final int SETTINGS_GROUP_ID = 134;
static class SettingsSide
{
static final int CAMERA_ZOOM_SLIDER_TRACK = 59;
static final int MUSIC_SLIDER = 13;
static final int SOUND_EFFECT_SLIDER = 17;
static final int AREA_SOUND_SLIDER = 21;
}
static class Settings
{
static final int INIT = 1;
}
static class WorldMap
{
static final int MAPVIEW = 7;
@@ -220,66 +188,21 @@ public class WidgetID
static final int TEXT = 4;
}
static class DialogPlayer
{
static final int HEAD_MODEL = 1;
static final int NAME = 2;
static final int CONTINUE = 3;
static final int TEXT = 4;
}
static class DialogNotification
{
static final int TEXT = 0;
static final int CONTINUE = 1;
}
static class DialogOption
{
static final int TEXT = 0;
static final int OPTION1 = 1;
static final int OPTION2 = 2;
static final int OPTION3 = 3;
static final int OPTION4 = 4;
static final int OPTION5 = 5;
}
static class LogoutPanel
{
static final int WORLD_SWITCHER_BUTTON = 3;
static final int LOGOUT_BUTTON = 8;
static final int LOGOUT_BUTTON = 6;
}
static class PestControlBoat
{
static final int INFO = 3;
static final int NEXT_DEPARTURE = 4;
static final int PLAYERS_READY = 5;
static final int POINTS = 6;
}
static class PestControlExchangeWindow
{
static final int ITEM_LIST = 2;
static final int BOTTOM = 5;
static final int POINTS = 8;
static final int CONFIRM_BUTTON = 6;
}
static class MinigameDialog
{
static final int TEXT = 1;
static final int CONTINUE = 2;
}
static class PestControl
{
static final int INFO = 3;
static final int TIME = 6;
static final int ACTIVITY_BAR = 12;
static final int ACTIVITY_PROGRESS = 14;
@@ -346,8 +269,6 @@ public class WidgetID
static final int TAB_CONTAINER = 10;
static final int ITEM_CONTAINER = 12;
static final int SCROLLBAR = 13;
static final int UNNOTED_BUTTON = 21;
static final int NOTED_BUTTON = 23;
static final int SEARCH_BUTTON_BACKGROUND = 39;
static final int DEPOSIT_INVENTORY = 41;
static final int DEPOSIT_EQUIPMENT = 43;
@@ -364,14 +285,6 @@ public class WidgetID
static final int WINDOW_BORDERS = 2;
static final int HISTORY_BUTTON = 3;
static final int BACK_BUTTON = 4;
static final int OFFER1 = 7;
static final int OFFER2 = 8;
static final int OFFER3 = 9;
static final int OFFER4 = 10;
static final int OFFER5 = 11;
static final int OFFER6 = 12;
static final int OFFER7 = 13;
static final int OFFER8 = 14;
static final int OFFER_CONTAINER = 24;
static final int OFFER_DESCRIPTION = 25;
static final int OFFER_PRICE = 26;
@@ -390,47 +303,12 @@ public class WidgetID
static class Shop
{
static final int ITEMS_CONTAINER = 2;
static final int INVENTORY_ITEM_CONTAINER = 0;
}
static class Smithing
{
static final int INVENTORY_ITEM_CONTAINER = 0;
static final int QTY_1 = 3;
static final int QTY_5 = 4;
static final int QTY_10 = 5;
static final int QTY_X = 6;
static final int QTY_ALL = 7;
static final int DAGGER = 9;
static final int SWORD = 10;
static final int SCIMITAR = 11;
static final int LONG_SWORD = 12;
static final int TWO_H_SWORD = 13;
static final int AXE = 14;
static final int MACE = 15;
static final int WARHAMMER = 16;
static final int BATTLE_AXE = 17;
static final int CLAWS = 18;
static final int CHAIN_BODY = 19;
static final int PLATE_LEGS = 20;
static final int PLATE_SKIRT = 21;
static final int PLATE_BODY = 22;
static final int NAILS = 23;
static final int MED_HELM = 24;
static final int FULL_HELM = 25;
static final int SQ_SHIELD = 26;
static final int KITE_SHIELD = 27;
static final int EXCLUSIVE1 = 28;
static final int DART_TIPS = 29;
static final int ARROW_HEADS = 30;
static final int KNIVES = 31;
static final int EXCLUSIVE2 = 32;
static final int JAVELIN_HEADS = 33;
static final int BOLTS = 34;
static final int LIMBS = 35;
}
static class GuidePrices
@@ -441,17 +319,6 @@ public class WidgetID
static class Equipment
{
static final int HELMET = 14;
static final int CAPE = 15;
static final int AMULET = 16;
static final int WEAPON = 17;
static final int BODY = 18;
static final int SHIELD = 19;
static final int LEGS = 20;
static final int GLOVES = 21;
static final int BOOTS = 22;
static final int RING = 23;
static final int AMMO = 24;
static final int INVENTORY_ITEM_CONTAINER = 0;
}
@@ -479,7 +346,6 @@ public class WidgetID
static final int TOGGLE_RUN_ORB = 22; // Has the "Toggle run" name
static final int RUN_ORB_TEXT = 23;
static final int SPEC_ORB = 28;
static final int SPEC_CLICKBOX = 30;
static final int WORLDMAP_ORB = 41;
static final int WIKI_BANNER = 43;
}
@@ -500,11 +366,11 @@ public class WidgetID
static final int RESIZABLE_VIEWPORT_BOTTOM_LINE = 14;
}
static class FixedViewport
public static class FixedViewport
{
static final int MINIMAP = 3;
static final int MINIMAP_DRAW_AREA = 8;
static final int MULTICOMBAT_INDICATOR = 21;
public static final int MULTICOMBAT_INDICATOR = 21;
static final int FRIENDS_CHAT_TAB = 34;
static final int FRIENDS_TAB = 36;
static final int IGNORES_TAB = 35;
@@ -539,9 +405,9 @@ public class WidgetID
static final int INVENTORY_CONTAINER = 72;
}
static class ResizableViewport
public static class ResizableViewport
{
static final int MULTICOMBAT_INDICATOR = 17;
public static final int MULTICOMBAT_INDICATOR = 18;
static final int FRIENDS_CHAT_TAB = 38;
static final int FRIENDS_TAB = 40;
static final int IGNORES_TAB = 39;
@@ -574,7 +440,7 @@ public class WidgetID
static final int INVENTORY_CONTAINER = 74;
}
static class ResizableViewportBottomLine
public static class ResizableViewportBottomLine
{
static final int LOGOUT_BUTTON_OVERLAY = 32;
static final int CMB_TAB = 50;
@@ -589,7 +455,7 @@ public class WidgetID
static final int EQUIP_ICON = 64;
static final int PRAYER_TAB = 58;
static final int PRAYER_ICON = 65;
static final int SPELL_TAB = 56;
public static final int SPELL_TAB = 56;
static final int SPELL_ICON = 53;
static final int FC_TAB = 35;
static final int FC_ICON = 44;
@@ -716,9 +582,6 @@ public class WidgetID
static final int SPELL_ICON = 28;
static final int SPELL_TEXT = 29;
static final int AUTO_RETALIATE = 30;
static final int SPECIAL_ATTACK_BAR = 34;
static final int SPECIAL_ATTACK_CLICKBOX = 36;
static final int TOOLTIP = 41;
}
static class VolcanicMine
@@ -742,13 +605,13 @@ public class WidgetID
{
static class ATK
{
static final int LISTEN_TOP = 7;
static final int LISTEN_BOTTOM = 8;
static final int CALL_TEXT = 8;
static final int TO_CALL_WIDGET = 9;
static final int TO_CALL = 10;
static final int ROLE_SPRITE = 11;
static final int ROLE = 12;
}
static class HLR
{
static final int TEAMMATE1 = 18;
@@ -756,38 +619,12 @@ public class WidgetID
static final int TEAMMATE3 = 26;
static final int TEAMMATE4 = 30;
}
static class HORN_GLORY
{
static final int ATTACKER = 5;
static final int DEFENDER = 6;
static final int COLLECTOR = 7;
static final int HEALER = 8;
}
static class REWARD_VALUES
{
static final int RUNNERS_PASSED = 14;
static final int HITPOINTS_REPLENISHED = 19;
static final int WRONG_POISON_PACKS_USED = 20;
static final int EGGS_COLLECTED = 21;
static final int FAILED_ATTACKER_ATTACKS = 22;
static final int RUNNERS_PASSED_POINTS = 24;
static final int RANGERS_KILLED = 25;
static final int FIGHTERS_KILLED = 26;
static final int HEALERS_KILLED = 27;
static final int RUNNERS_KILLED = 28;
static final int HITPOINTS_REPLENISHED_POINTS = 29;
static final int WRONG_POISON_PACKS_USED_POINTS = 30;
static final int EGGS_COLLECTED_POINTS = 31;
static final int FAILED_ATTACKER_ATTACKS_POINTS = 32;
static final int BASE_POINTS = 33;
static final int HONOUR_POINTS_REWARD = 49;
}
static final int CORRECT_STYLE = 3;
static final int GAME_WIDGET = 3;
static final int CURRENT_WAVE_WIDGET = 4;
static final int CURRENT_WAVE = 5;
static final int LISTEN_WIDGET = 6;
static final int LISTEN = 7;
static final int CALL_WIDGET = 6;
static final int CALL_TEXT = 7;
static final int TO_CALL_WIDGET = 8;
static final int TO_CALL = 9;
static final int ROLE_SPRITE = 10;
@@ -804,12 +641,11 @@ public class WidgetID
{
static final int SKILL = 1;
static final int LEVEL = 2;
static final int CONTINUE = 3;
}
static class QuestCompleted
{
static final int NAME_TEXT = 2;
static final int NAME_TEXT = 4;
}
static class Raids
@@ -817,33 +653,21 @@ public class WidgetID
static final int POINTS_INFOBOX = 7;
}
static class TheatreOfBlood
{
static final int RAIDING_PARTY = 9;
static final int ORB_BOX = 10;
static final int BOSS_HEALTH_BAR = 35;
}
static class TheatreOfBloodParty
{
static final int CONTAINER = 10;
}
static class Tob
{
static final int PARTY_INTERFACE = 6;
static final int PARTY_STATS = 10;
}
static class ExperienceDrop
public static class ExperienceDrop
{
static final int DROP_1 = 15;
static final int DROP_2 = 16;
static final int DROP_3 = 17;
static final int DROP_4 = 18;
static final int DROP_5 = 19;
static final int DROP_6 = 20;
static final int DROP_7 = 21;
public static final int DROP_1 = 15;
public static final int DROP_2 = 16;
public static final int DROP_3 = 17;
public static final int DROP_4 = 18;
public static final int DROP_5 = 19;
public static final int DROP_6 = 20;
public static final int DROP_7 = 21;
}
static class PuzzleBox
@@ -856,7 +680,6 @@ public class WidgetID
static final int LIGHT_BOX = 1;
static final int LIGHT_BOX_WINDOW = 2;
static final int LIGHT_BULB_CONTAINER = 3;
static final int LIGHT_BOX_BUTTON_CONTAINER = 6;
static final int BUTTON_A = 8;
static final int BUTTON_B = 9;
static final int BUTTON_C = 10;
@@ -924,28 +747,6 @@ public class WidgetID
static final int DESTROY_ITEM_NO = 3;
}
static class EquipmentWidgetIdentifiers
{
static final int EQUIP_YOUR_CHARACTER = 3;
static final int STAB_ATTACK_BONUS = 24;
static final int SLASH_ATTACK_BONUS = 25;
static final int CRUSH_ATTACK_BONUS = 26;
static final int MAGIC_ATTACK_BONUS = 27;
static final int RANGED_ATTACK_BONUS = 28;
static final int STAB_DEFENCE_BONUS = 30;
static final int SLASH_DEFENCE_BONUS = 31;
static final int CRUSH_DEFENCE_BONUS = 32;
static final int MAGIC_DEFENCE_BONUS = 33;
static final int RANGED_DEFENCE_BONUS = 34;
static final int MELEE_STRENGTH = 36;
static final int RANGED_STRENGTH = 37;
static final int MAGIC_DAMAGE = 38;
static final int PRAYER_BONUS = 39;
static final int UNDEAD_DAMAGE_BONUS = 41;
static final int SLAYER_DAMAGE_BONUS = 42;
static final int WEIGHT = 49;
}
static class VarrockMuseum
{
static final int VARROCK_MUSEUM_QUESTION = 28;
@@ -964,9 +765,7 @@ public class WidgetID
static class WorldSwitcher
{
static final int CONTAINER = 1;
static final int WORLD_LIST = 16;
static final int LOGOUT_BUTTON = 23;
}
static class FossilOxygen
@@ -974,203 +773,15 @@ public class WidgetID
static final int FOSSIL_ISLAND_OXYGEN_BAR = 4;
}
static class FossilMushroomTeleport
{
static final int ROOT = 2;
static final int HOUSE_ON_HILL = 4;
static final int VERDANT_VALLEY = 8;
static final int SWAMP = 12;
static final int MUSHROOM_MEADOW = 16;
}
static class Minigames
{
static final int TELEPORT_BUTTON = 26;
}
static class SpellBook
{
static final int FILTERED_SPELLS_BOUNDS = 3;
static final int TOOLTIP = 189;
// NORMAL SPELLS
static final int LUMBRIDGE_HOME_TELEPORT = 5;
static final int WIND_STRIKE = 6;
static final int CONFUSE = 7;
static final int ENCHANT_CROSSBOW_BOLT = 8;
static final int WATER_STRIKE = 9;
static final int LVL_1_ENCHANT = 10;
static final int EARTH_STRIKE = 11;
static final int WEAKEN = 12;
static final int FIRE_STRIKE = 13;
static final int BONES_TO_BANANAS = 14;
static final int WIND_BOLT = 15;
static final int CURSE = 16;
static final int BIND = 17;
static final int LOW_LEVEL_ALCHEMY = 18;
static final int WATER_BOLT = 19;
static final int VARROCK_TELEPORT = 20;
static final int LVL_2_ENCHANT = 21;
static final int EARTH_BOLT = 22;
static final int LUMBRIDGE_TELEPORT = 23;
static final int TELEKINETIC_GRAB = 24;
static final int FIRE_BOLT = 25;
static final int FALADOR_TELEPORT = 26;
static final int CRUMBLE_UNDEAD = 27;
static final int TELEPORT_TO_HOUSE = 28;
static final int WIND_BLAST = 29;
static final int SUPERHEAT_ITEM = 30;
static final int CAMELOT_TELEPORT = 31;
static final int WATER_BLAST = 32;
static final int LVL_3_ENCHANT = 33;
static final int IBAN_BLAST = 34;
static final int SNARE = 35;
static final int MAGIC_DART = 36;
static final int ARDOUGNE_TELEPORT = 37;
static final int EARTH_BLAST = 38;
static final int HIGH_LEVEL_ALCHEMY = 39;
static final int CHARGE_WATER_ORB = 40;
static final int LVL_4_ENCHANT = 41;
static final int WATCHTOWER_TELEPORT = 42;
static final int FIRE_BLAST = 43;
static final int CHARGE_EARTH_ORB = 44;
static final int BONES_TO_PEACHES = 45;
static final int SARADOMIN_STRIKE = 46;
static final int CLAWS_OF_GUTHIX = 47;
static final int FLAMES_OF_ZAMORAK = 48;
static final int TROLLHEIM_TELEPORT = 49;
static final int WIND_WAVE = 50;
static final int CHARGE_FIRE_ORB = 51;
static final int TELEPORT_TO_APE_ATOLL = 52;
static final int WATER_WAVE = 53;
static final int CHARGE_AIR_ORB = 54;
static final int VULNERABILITY = 55;
static final int LVL_5_ENCHANT = 56;
static final int TELEPORT_TO_KOUREND = 57;
static final int EARTH_WAVE = 58;
static final int ENFEEBLE = 59;
static final int TELEOTHER_LUMBRIDGE = 60;
static final int FIRE_WAVE = 61;
static final int ENTANGLE = 62;
static final int STUN = 63;
static final int CHARGE = 64;
static final int WIND_SURGE = 65;
static final int TELEOTHER_FALADOR = 66;
static final int WATER_SURGE = 67;
static final int TELE_BLOCK = 68;
static final int BOUNTY_TARGET_TELEPORT = 69;
static final int LVL_6_ENCHANT = 70;
static final int TELEOTHER_CAMELOT = 71;
static final int EARTH_SURGE = 72;
static final int LVL_7_ENCHANT = 73;
static final int FIRE_SURGE = 74;
// ANCIENT SPELLS
static final int ICE_RUSH = 75;
static final int ICE_BLITZ = 76;
static final int ICE_BURST = 77;
static final int ICE_BARRAGE = 78;
static final int BLOOD_RUSH = 79;
static final int BLOOD_BLITZ = 80;
static final int BLOOD_BURST = 81;
static final int BLOOD_BARRAGE = 82;
static final int SMOKE_RUSH = 83;
static final int SMOKE_BLITZ = 84;
static final int SMOKE_BURST = 85;
static final int SMOKE_BARRAGE = 86;
static final int SHADOW_RUSH = 87;
static final int SHADOW_BLITZ = 88;
static final int SHADOW_BURST = 89;
static final int SHADOW_BARRAGE = 90;
static final int PADDEWWA_TELEPORT = 91;
static final int SENNTISTEN_TELEPORT = 92;
static final int KHARYRLL_TELEPORT = 93;
static final int LASSAR_TELEPORT = 94;
static final int DAREEYAK_TELEPORT = 95;
static final int CARRALLANGER_TELEPORT = 96;
static final int ANNAKARL_TELEPORT = 97;
static final int GHORROCK_TELEPORT = 98;
static final int EDGEVILLE_HOME_TELEPORT = 99;
// LUNAR SPELLS
static final int LUNAR_HOME_TELEPORT = 100;
static final int BAKE_PIE = 101;
static final int CURE_PLANT = 102;
static final int MONSTER_EXAMINE = 103;
static final int NPC_CONTACT = 104;
static final int CURE_OTHER = 105;
static final int HUMIDIFY = 106;
static final int MOONCLAN_TELEPORT = 107;
static final int TELE_GROUP_MOONCLAN = 108;
static final int CURE_ME = 109;
static final int HUNTER_KIT = 110;
static final int WATERBIRTH_TELEPORT = 111;
static final int TELE_GROUP_WATERBIRTH = 112;
static final int CURE_GROUP = 113;
static final int STAT_SPY = 114;
static final int BARBARIAN_TELEPORT = 115;
static final int TELE_GROUP_BARBARIAN = 116;
static final int SUPERGLASS_MAKE = 117;
static final int TAN_LEATHER = 118;
static final int KHAZARD_TELEPORT = 119;
static final int TELE_GROUP_KHAZARD = 120;
static final int DREAM = 121;
static final int STRING_JEWELLERY = 122;
static final int STAT_RESTORE_POT_SHARE = 123;
static final int MAGIC_IMBUE = 124;
static final int FERTILE_SOIL = 125;
static final int BOOST_POTION_SHARE = 126;
static final int FISHING_GUILD_TELEPORT = 127;
static final int TELE_GROUP_FISHING_GUILD = 128;
static final int PLANK_MAKE = 129;
static final int CATHERBY_TELEPORT = 130;
static final int TELE_GROUP_CATHERBY = 131;
static final int RECHARGE_DRAGONSTONE = 132;
static final int ICE_PLATEAU_TELEPORT = 133;
static final int TELE_GROUP_ICE_PLATEAU = 134;
static final int ENERGY_TRANSFER = 135;
static final int HEAL_OTHER = 136;
static final int VENGEANCE_OTHER = 137;
static final int VENGEANCE = 138;
static final int HEAL_GROUP = 139;
static final int SPELLBOOK_SWAP = 140;
static final int GEOMANCY = 141;
static final int SPIN_FLAX = 142;
static final int OURANIA_TELEPORT = 143;
// ARCEUUS SPELLS
static final int ARCEUUS_HOME_TELEPORT = 144;
static final int BATTLEFRONT_TELEPORT = 179;
// HEADS
static final int REANIMATE_GOBLIN = 145;
static final int REANIMATE_MONKEY = 147;
static final int REANIMATE_IMP = 148;
static final int REANIMATE_MINOTAUR = 149;
static final int REANIMATE_SCORPION = 151;
static final int REANIMATE_BEAR = 152;
static final int REANIMATE_UNICORN = 153;
static final int REANIMATE_DOG = 154;
static final int REANIMATE_CHAOS_DRUID = 156;
static final int REANIMATE_GIANT = 158;
static final int REANIMATE_OGRE = 160;
static final int REANIMATE_ELF = 161;
static final int REANIMATE_TROLL = 162;
static final int REANIMATE_HORROR = 164;
static final int REANIMATE_KALPHITE = 165;
static final int REANIMATE_DAGANNOTH = 167;
static final int REANIMATE_BLOODVELD = 168;
static final int REANIMATE_TZHAAR = 170;
static final int REANIMATE_DEMON = 172;
static final int REANIMATE_AVIANSIE = 173;
static final int REANIMATE_ABYSSAL = 176;
static final int REANIMATE_DRAGON = 178;
}
static class StandardSpellBook
public static class StandardSpellBook
{
static final int LUMBRIDGE_HOME_TELEPORT = 5;
static final int KOUREND_HOME_TELEPORT = 4;
public static final int KOUREND_HOME_TELEPORT = 4;
}
static class AncientSpellBook
@@ -1190,10 +801,6 @@ public class WidgetID
static class Pvp
{
static final int FOG_OVERLAY = 1;
static final int PVP_WIDGET_CONTAINER = 54; // OUTDATED?
static final int SKULL = 56; // OUTDATED?
static final int ATTACK_RANGE = 59; // OUTDATED?
static final int BOUNTY_HUNTER_INFO = 6;
static final int KILLDEATH_RATIO = 28;
static final int SKULL_CONTAINER = 48;
@@ -1221,9 +828,9 @@ public class WidgetID
static final int CONTAINER = 3;
}
static class FullScreenMap
public static class FullScreenMap
{
static final int ROOT = 27;
public static final int ROOT = 27;
}
static class QuestList
@@ -1236,19 +843,6 @@ public class WidgetID
static final int MINIQUEST_CONTAINER = 8;
}
static class DialogSprite2
{
static final int SPRITE1 = 1;
static final int TEXT = 2;
static final int SPRITE2 = 3;
static final int CONTINUE = 4;
}
static class QuestTab
{
static final int QUEST_TAB = 3;
}
static class Music
{
static final int CONTAINER = 0;
@@ -1278,63 +872,6 @@ public class WidgetID
static final int ANSWER3 = 17;
}
public static class TradeScreen
{
public static final int FIRST_TRADING_WITH = 31;
public static final int SECOND_ACCEPT_FUNC = 13;
public static final int SECOND_DECLINE_FUNC = 14;
public static final int SECOND_MY_OFFER = 23;
public static final int SECOND_THEIR_OFFER = 24;
public static final int SECOND_ACCEPT_TEXT = 25;
public static final int SECOND_DECLINE_TEXT = 26;
public static final int SECOND_MY_ITEMS = 28;
public static final int SECOND_THEIR_ITEMS = 29;
public static final int SECOND_TRADING_WITH = 30;
}
public static class DuelConfig
{
public static final int CONFIG_GROUP_IP = 482;
public static final int TITLE = 35;
public static final int OPPONENT_ATT = 9;
public static final int OPPONENT_STR = 13;
public static final int OPPONENT_DEF = 17;
public static final int OPPONENT_HP = 21;
}
public static class DuelResult
{
public static final int RESULT_GROUP_ID = 372;
public static final int TITLE = 16;
public static final int TOTAL_STAKED = 32;
public static final int TOTAL_TAX = 39;
public static final int WINNINGS = 40;
}
// Also used for many other interfaces!
static class BankPin
{
static final int CONTAINER = 0;
static final int TOP_LEFT_TEXT = 2;
static final int FIRST_ENTERED = 3;
static final int SECOND_ENTERED = 4;
static final int THIRD_ENTERED = 5;
static final int FOURTH_ENTERED = 6;
static final int INSTRUCTION_TEXT = 10;
static final int EXIT_BUTTON = 13;
static final int FORGOT_BUTTON = 15;
static final int BUTTON_1 = 16;
static final int BUTTON_2 = 18;
static final int BUTTON_3 = 20;
static final int BUTTON_4 = 22;
static final int BUTTON_5 = 24;
static final int BUTTON_6 = 26;
static final int BUTTON_7 = 28;
static final int BUTTON_8 = 30;
static final int BUTTON_9 = 32;
static final int BUTTON_10 = 34;
}
static class SeedVault
{
static final int INVENTORY_ITEM_CONTAINER = 1;
@@ -1348,23 +885,17 @@ public class WidgetID
static final int INVENTORY = 7;
}
static class JewelBox
static class SettingsSide
{
static final int DUEL_RING = 2;
static final int GAME_NECK = 3;
static final int COMB_BRAC = 4;
static final int SKIL_NECK = 5;
static final int RING_OFGP = 6;
static final int AMUL_GLOR = 7; // yes
static final int CAMERA_ZOOM_SLIDER_TRACK = 59;
static final int MUSIC_SLIDER = 13;
static final int SOUND_EFFECT_SLIDER = 17;
static final int AREA_SOUND_SLIDER = 21;
}
static class Options
static class Settings
{
static final int CAMERA_ZOOM_SLIDER_HANDLE = 15;
static final int MUSIC_SLIDER = 37;
static final int SOUND_EFFECT_SLIDER = 43;
static final int AREA_SOUND_SLIDER = 49;
static final int INIT = 1;
}
static class AchievementDiary
@@ -1402,16 +933,16 @@ public class WidgetID
static final int CONTAINER = 2;
}
static class GauntletMap
{
static final int CONTAINER = 4;
}
static class HallowedSepulchreTimer
{
static final int CONTAINER = 2;
}
static class BankPin
{
static final int CONTAINER = 0;
}
static class EncounterHealthBar
{
static final int CONTAINER = 6;
@@ -55,7 +55,6 @@ public enum WidgetInfo
WORLD_MAP_SURFACE_SELECTOR(WidgetID.WORLD_MAP_GROUP_ID, WidgetID.WorldMap.SURFACE_SELECTOR),
WORLD_MAP_TOOLTIP(WidgetID.WORLD_MAP_GROUP_ID, WidgetID.WorldMap.TOOLTIP),
WORLD_MAP_OPTION(WidgetID.WORLD_MAP_MENU_GROUP_ID, WidgetID.WorldMap.OPTION),
WORLD_MAP_BUTTON_BORDER(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.WORLDMAP_ORB),
CLUE_SCROLL_TEXT(WidgetID.CLUE_SCROLL_GROUP_ID, WidgetID.Cluescroll.CLUE_TEXT),
CLUE_SCROLL_REWARD_ITEM_CONTAINER(WidgetID.CLUE_SCROLL_REWARD_GROUP_ID, WidgetID.Cluescroll.CLUE_SCROLL_ITEM_CONTAINER),
@@ -63,18 +62,6 @@ public enum WidgetInfo
EQUIPMENT(WidgetID.EQUIPMENT_GROUP_ID, 0),
EQUIPMENT_INVENTORY_ITEMS_CONTAINER(WidgetID.EQUIPMENT_INVENTORY_GROUP_ID, WidgetID.Equipment.INVENTORY_ITEM_CONTAINER),
EQUIPMENT_HELMET(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.HELMET),
EQUIPMENT_CAPE(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.CAPE),
EQUIPMENT_AMULET(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.AMULET),
EQUIPMENT_WEAPON(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.WEAPON),
EQUIPMENT_BODY(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.BODY),
EQUIPMENT_SHIELD(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.SHIELD),
EQUIPMENT_LEGS(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.LEGS),
EQUIPMENT_GLOVES(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.GLOVES),
EQUIPMENT_BOOTS(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.BOOTS),
EQUIPMENT_RING(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.RING),
EQUIPMENT_AMMO(WidgetID.EQUIPMENT_GROUP_ID, WidgetID.Equipment.AMMO),
EMOTE_WINDOW(WidgetID.EMOTES_GROUP_ID, WidgetID.Emotes.EMOTE_WINDOW),
EMOTE_CONTAINER(WidgetID.EMOTES_GROUP_ID, WidgetID.Emotes.EMOTE_CONTAINER),
EMOTE_SCROLLBAR(WidgetID.EMOTES_GROUP_ID, WidgetID.Emotes.EMOTE_SCROLLBAR),
@@ -86,15 +73,8 @@ public enum WidgetInfo
DIARY_QUEST_WIDGET_TITLE(WidgetID.DIARY_QUEST_GROUP_ID, WidgetID.Diary.DIARY_TITLE),
DIARY_QUEST_WIDGET_TEXT(WidgetID.DIARY_QUEST_GROUP_ID, WidgetID.Diary.DIARY_TEXT),
MINIGAME_DIALOG(WidgetID.DIALOG_MINIGAME_GROUP_ID, 0),
MINIGAME_DIALOG_TEXT(WidgetID.DIALOG_MINIGAME_GROUP_ID, WidgetID.MinigameDialog.TEXT),
MINIGAME_DIALOG_CONTINUE(WidgetID.DIALOG_MINIGAME_GROUP_ID, WidgetID.MinigameDialog.CONTINUE),
PEST_CONTROL_EXCHANGE_WINDOW(WidgetID.PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID, 0),
PEST_CONTROL_EXCHANGE_WINDOW_POINTS(WidgetID.PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID, WidgetID.PestControlExchangeWindow.POINTS),
PEST_CONTROL_BOAT_INFO(WidgetID.PEST_CONTROL_BOAT_GROUP_ID, WidgetID.PestControlBoat.INFO),
PEST_CONTROL_BOAT_INFO_POINTS(WidgetID.PEST_CONTROL_BOAT_GROUP_ID, WidgetID.PestControlBoat.POINTS),
PEST_CONTROL_INFO(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.INFO),
PEST_CONTROL_INFO_TIME(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.TIME),
PEST_CONTROL_PURPLE_SHIELD(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.PURPLE_SHIELD),
PEST_CONTROL_BLUE_SHIELD(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.BLUE_SHIELD),
PEST_CONTROL_YELLOW_SHIELD(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.YELLOW_SHIELD),
@@ -154,8 +134,6 @@ public enum WidgetInfo
BANK_CONTAINER(WidgetID.BANK_GROUP_ID, WidgetID.Bank.BANK_CONTAINER),
BANK_SEARCH_BUTTON_BACKGROUND(WidgetID.BANK_GROUP_ID, WidgetID.Bank.SEARCH_BUTTON_BACKGROUND),
BANK_ITEM_CONTAINER(WidgetID.BANK_GROUP_ID, WidgetID.Bank.ITEM_CONTAINER),
BANK_UNNOTED_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.UNNOTED_BUTTON),
BANK_NOTED_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.NOTED_BUTTON),
BANK_INVENTORY_ITEMS_CONTAINER(WidgetID.BANK_INVENTORY_GROUP_ID, WidgetID.Bank.INVENTORY_ITEM_CONTAINER),
BANK_TITLE_BAR(WidgetID.BANK_GROUP_ID, WidgetID.Bank.BANK_TITLE_BAR),
BANK_INCINERATOR(WidgetID.BANK_GROUP_ID, WidgetID.Bank.INCINERATOR),
@@ -175,57 +153,17 @@ public enum WidgetInfo
BANK_TUTORIAL_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.TUTORIAL_BUTTON),
GRAND_EXCHANGE_WINDOW_CONTAINER(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.WINDOW_CONTAINER),
GRAND_EXCHANGE_HISTORY_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.HISTORY_BUTTON),
GRAND_EXCHANGE_BACK_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.BACK_BUTTON),
GRAND_EXCHANGE_OFFER1(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER1),
GRAND_EXCHANGE_OFFER2(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER2),
GRAND_EXCHANGE_OFFER3(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER3),
GRAND_EXCHANGE_OFFER4(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER4),
GRAND_EXCHANGE_OFFER5(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER5),
GRAND_EXCHANGE_OFFER6(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER6),
GRAND_EXCHANGE_OFFER7(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER7),
GRAND_EXCHANGE_OFFER8(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER8),
GRAND_EXCHANGE_OFFER_CONTAINER(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER_CONTAINER),
GRAND_EXCHANGE_OFFER_TEXT(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER_DESCRIPTION),
GRAND_EXCHANGE_OFFER_PRICE(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER_PRICE),
GRAND_EXCHANGE_OFFER_CONFIRM_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER_CONFIRM_BUTTON),
GRAND_EXCHANGE_INVENTORY_ITEMS_CONTAINER(WidgetID.GRAND_EXCHANGE_INVENTORY_GROUP_ID, WidgetID.GrandExchangeInventory.INVENTORY_ITEM_CONTAINER),
DEPOSIT_BOX_INVENTORY_ITEMS_CONTAINER(WidgetID.DEPOSIT_BOX_GROUP_ID, WidgetID.DepositBox.INVENTORY_ITEM_CONTAINER),
SHOP_ITEMS_CONTAINER(WidgetID.SHOP_GROUP_ID, WidgetID.Shop.ITEMS_CONTAINER),
SHOP_INVENTORY_ITEMS_CONTAINER(WidgetID.SHOP_INVENTORY_GROUP_ID, WidgetID.Shop.INVENTORY_ITEM_CONTAINER),
SMITHING_INVENTORY_ITEMS_CONTAINER(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.INVENTORY_ITEM_CONTAINER),
SMITHING_ANVIL_DAGGER(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.DAGGER),
SMITHING_ANVIL_SWORD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.SWORD),
SMITHING_ANVIL_SCIMITAR(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.SCIMITAR),
SMITHING_ANVIL_LONG_SWORD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.LONG_SWORD),
SMITHING_ANVIL_TWO_H_SWORD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.TWO_H_SWORD),
SMITHING_ANVIL_AXE(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.AXE),
SMITHING_ANVIL_MACE(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.MACE),
SMITHING_ANVIL_WARHAMMER(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.WARHAMMER),
SMITHING_ANVIL_BATTLE_AXE(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.BATTLE_AXE),
SMITHING_ANVIL_CLAWS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.CLAWS),
SMITHING_ANVIL_CHAIN_BODY(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.CHAIN_BODY),
SMITHING_ANVIL_PLATE_LEGS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.PLATE_LEGS),
SMITHING_ANVIL_PLATE_SKIRT(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.PLATE_SKIRT),
SMITHING_ANVIL_PLATE_BODY(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.PLATE_BODY),
SMITHING_ANVIL_NAILS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.NAILS),
SMITHING_ANVIL_MED_HELM(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.MED_HELM),
SMITHING_ANVIL_FULL_HELM(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.FULL_HELM),
SMITHING_ANVIL_SQ_SHIELD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.SQ_SHIELD),
SMITHING_ANVIL_KITE_SHIELD(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.KITE_SHIELD),
SMITHING_ANVIL_DART_TIPS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.DART_TIPS),
SMITHING_ANVIL_ARROW_HEADS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.ARROW_HEADS),
SMITHING_ANVIL_KNIVES(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.KNIVES),
SMITHING_ANVIL_JAVELIN_HEADS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.JAVELIN_HEADS),
SMITHING_ANVIL_BOLTS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.BOLTS),
SMITHING_ANVIL_LIMBS(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.LIMBS),
SMITHING_ANVIL_EXCLUSIVE1(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.EXCLUSIVE1),
SMITHING_ANVIL_EXCLUSIVE2(WidgetID.SMITHING_GROUP_ID, WidgetID.Smithing.EXCLUSIVE2),
GUIDE_PRICES_ITEMS_CONTAINER(WidgetID.GUIDE_PRICES_GROUP_ID, WidgetID.GuidePrices.ITEM_CONTAINER),
GUIDE_PRICES_INVENTORY_ITEMS_CONTAINER(WidgetID.GUIDE_PRICES_INVENTORY_GROUP_ID, WidgetID.GuidePrices.INVENTORY_ITEM_CONTAINER),
@@ -242,9 +180,7 @@ public enum WidgetInfo
MINIMAP_RUN_ORB_TEXT(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.RUN_ORB_TEXT),
MINIMAP_HEALTH_ORB(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.HEALTH_ORB),
MINIMAP_SPEC_ORB(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.SPEC_ORB),
MINIMAP_SPEC_CLICKBOX(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.SPEC_CLICKBOX),
MINIMAP_WORLDMAP_ORB(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.WORLDMAP_ORB),
MINIMAP_WORLD_ORB(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.WORLDMAP_ORB),
MINIMAP_WIKI_BANNER(WidgetID.MINIMAP_GROUP_ID, WidgetID.Minimap.WIKI_BANNER),
LMS_INFO(WidgetID.LMS_GROUP_ID, WidgetID.Lms.INFO),
@@ -338,7 +274,6 @@ public enum WidgetInfo
RESIZABLE_VIEWPORT_BOTTOM_LINE_EQUIPMENT_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.EQUIP_ICON),
RESIZABLE_VIEWPORT_BOTTOM_LINE_COMBAT_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.CMB_ICON),
RESIZABLE_VIEWPORT_BOTTOM_LINE_STATS_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.SKILLS_ICON),
RESIZABLE_VIEWPORT_BOTTOM_LINE_MAGIC_TAB(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.SPELL_TAB),
RESIZABLE_VIEWPORT_BOTTOM_LINE_MAGIC_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.MAGIC_ICON),
RESIZABLE_VIEWPORT_BOTTOM_LINE_FRIEND_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.FRIEND_ICON),
RESIZABLE_VIEWPORT_BOTTOM_LINE_FRIEND_CHAT_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.FC_ICON),
@@ -383,7 +318,6 @@ public enum WidgetInfo
QUICK_PRAYER_PRAYERS(WidgetID.QUICK_PRAYERS_GROUP_ID, WidgetID.QuickPrayer.PRAYERS),
COMBAT_LEVEL(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.LEVEL),
COMBAT_WEAPON(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.WEAPON_NAME),
COMBAT_STYLE_ONE(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.STYLE_ONE),
COMBAT_STYLE_TWO(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.STYLE_TWO),
COMBAT_STYLE_THREE(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.STYLE_THREE),
@@ -397,21 +331,12 @@ public enum WidgetInfo
COMBAT_SPELL_ICON(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPELL_ICON),
COMBAT_SPELL_TEXT(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPELL_TEXT),
COMBAT_AUTO_RETALIATE(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.AUTO_RETALIATE),
COMBAT_SPECIAL_ATTACK(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPECIAL_ATTACK_BAR),
COMBAT_SPECIAL_ATTACK_CLICKBOX(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.SPECIAL_ATTACK_CLICKBOX),
COMBAT_TOOLTIP(WidgetID.COMBAT_GROUP_ID, WidgetID.Combat.TOOLTIP),
DIALOG_OPTION(WidgetID.DIALOG_OPTION_GROUP_ID, 0),
MULTI_SKILL_MENU(WidgetID.MULTISKILL_MENU_GROUP_ID, 0),
DIALOG_SPRITE(WidgetID.DIALOG_SPRITE_GROUP_ID, 0),
DIALOG_SPRITE_SPRITE(WidgetID.DIALOG_SPRITE_GROUP_ID, WidgetID.DialogSprite.SPRITE),
DIALOG_SPRITE_TEXT(WidgetID.DIALOG_SPRITE_GROUP_ID, WidgetID.DialogSprite.TEXT),
DIALOG2_SPRITE(WidgetID.DIALOG_SPRITE2_ID, 0),
DIALOG2_SPRITE_SPRITE1(WidgetID.DIALOG_SPRITE2_ID, WidgetID.DialogSprite2.SPRITE1),
DIALOG2_SPRITE_SPRITE2(WidgetID.DIALOG_SPRITE2_ID, WidgetID.DialogSprite2.SPRITE2),
DIALOG2_SPRITE_TEXT(WidgetID.DIALOG_SPRITE2_ID, WidgetID.DialogSprite2.TEXT),
DIALOG2_SPRITE_CONTINUE(WidgetID.DIALOG_SPRITE2_ID, WidgetID.DialogSprite2.CONTINUE),
DIALOG_NPC(WidgetID.DIALOG_NPC_GROUP_ID, 0),
DIALOG_NPC_NAME(WidgetID.DIALOG_NPC_GROUP_ID, WidgetID.DialogNPC.NAME),
@@ -419,21 +344,6 @@ public enum WidgetInfo
DIALOG_NPC_HEAD_MODEL(WidgetID.DIALOG_NPC_GROUP_ID, WidgetID.DialogNPC.HEAD_MODEL),
DIALOG_NPC_CONTINUE(WidgetID.DIALOG_NPC_GROUP_ID, WidgetID.DialogNPC.CONTINUE),
DIALOG_PLAYER_NAME(WidgetID.DIALOG_PLAYER_GROUP_ID, WidgetID.DialogPlayer.NAME),
DIALOG_PLAYER_TEXT(WidgetID.DIALOG_PLAYER_GROUP_ID, WidgetID.DialogPlayer.TEXT),
DIALOG_PLAYER_HEAD_MODEL(WidgetID.DIALOG_PLAYER_GROUP_ID, WidgetID.DialogPlayer.HEAD_MODEL),
DIALOG_PLAYER_CONTINUE(WidgetID.DIALOG_PLAYER_GROUP_ID, WidgetID.DialogPlayer.CONTINUE),
DIALOG_NOTIFICATION_TEXT(WidgetID.DIALOG_NOTIFICATION_GROUP_ID, WidgetID.DialogNotification.TEXT),
DIALOG_NOTIFICATION_CONTINUE(WidgetID.DIALOG_NOTIFICATION_GROUP_ID, WidgetID.DialogNotification.CONTINUE),
DIALOG_OPTION_TEXT(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.TEXT),
DIALOG_OPTION_OPTION1(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION1),
DIALOG_OPTION_OPTION2(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION2),
DIALOG_OPTION_OPTION3(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION3),
DIALOG_OPTION_OPTION4(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION4),
DIALOG_OPTION_OPTION5(WidgetID.DIALOG_OPTION_GROUP_ID, WidgetID.DialogOption.OPTION5),
DIALOG_PLAYER(WidgetID.DIALOG_PLAYER_GROUP_ID, 0),
PRIVATE_CHAT_MESSAGE(WidgetID.PRIVATE_CHAT, 0),
@@ -463,8 +373,7 @@ public enum WidgetInfo
BA_HEAL_WAVE_TEXT(WidgetID.BA_HEALER_GROUP_ID, WidgetID.BarbarianAssault.CURRENT_WAVE),
BA_HEAL_CALL_TEXT(WidgetID.BA_HEALER_GROUP_ID, WidgetID.BarbarianAssault.TO_CALL),
BA_HEAL_LISTEN_TEXT(WidgetID.BA_HEALER_GROUP_ID, WidgetID.BarbarianAssault.LISTEN),
BA_HEAL_HORN_LISTEN_TEXT(WidgetID.BA_HORN_OF_GLORY, WidgetID.BarbarianAssault.HORN_GLORY.HEALER),
BA_HEAL_LISTEN_TEXT(WidgetID.BA_HEALER_GROUP_ID, WidgetID.BarbarianAssault.CORRECT_STYLE),
BA_HEAL_ROLE_TEXT(WidgetID.BA_HEALER_GROUP_ID, WidgetID.BarbarianAssault.ROLE),
BA_HEAL_ROLE_SPRITE(WidgetID.BA_HEALER_GROUP_ID, WidgetID.BarbarianAssault.ROLE_SPRITE),
@@ -475,64 +384,39 @@ public enum WidgetInfo
BA_COLL_WAVE_TEXT(WidgetID.BA_COLLECTOR_GROUP_ID, WidgetID.BarbarianAssault.CURRENT_WAVE),
BA_COLL_CALL_TEXT(WidgetID.BA_COLLECTOR_GROUP_ID, WidgetID.BarbarianAssault.TO_CALL),
BA_COLL_LISTEN_TEXT(WidgetID.BA_COLLECTOR_GROUP_ID, WidgetID.BarbarianAssault.LISTEN),
BA_COLL_HORN_LISTEN_TEXT(WidgetID.BA_HORN_OF_GLORY, WidgetID.BarbarianAssault.HORN_GLORY.COLLECTOR),
BA_COLL_LISTEN_TEXT(WidgetID.BA_COLLECTOR_GROUP_ID, WidgetID.BarbarianAssault.CORRECT_STYLE),
BA_COLL_ROLE_TEXT(WidgetID.BA_COLLECTOR_GROUP_ID, WidgetID.BarbarianAssault.ROLE),
BA_COLL_ROLE_SPRITE(WidgetID.BA_COLLECTOR_GROUP_ID, WidgetID.BarbarianAssault.ROLE_SPRITE),
BA_ATK_LISTEN_TEXT(WidgetID.BA_ATTACKER_GROUP_ID, WidgetID.BarbarianAssault.CORRECT_STYLE),
BA_ATK_WAVE_TEXT(WidgetID.BA_ATTACKER_GROUP_ID, WidgetID.BarbarianAssault.CURRENT_WAVE),
BA_ATK_CALL_TEXT(WidgetID.BA_ATTACKER_GROUP_ID, WidgetID.BarbarianAssault.ATK.TO_CALL),
BA_ATK_LISTEN_TOP_TEXT(WidgetID.BA_ATTACKER_GROUP_ID, WidgetID.BarbarianAssault.ATK.LISTEN_TOP),
BA_ATK_LISTEN_BOTTOM_TEXT(WidgetID.BA_ATTACKER_GROUP_ID, WidgetID.BarbarianAssault.ATK.LISTEN_BOTTOM),
BA_ATK_HORN_LISTEN_TEXT(WidgetID.BA_HORN_OF_GLORY, WidgetID.BarbarianAssault.HORN_GLORY.ATTACKER),
BA_ATK_LISTEN_TEXT(WidgetID.BA_ATTACKER_GROUP_ID, WidgetID.BarbarianAssault.CORRECT_STYLE),
BA_ATK_ROLE_TEXT(WidgetID.BA_ATTACKER_GROUP_ID, WidgetID.BarbarianAssault.ATK.ROLE),
BA_ATK_ROLE_SPRITE(WidgetID.BA_ATTACKER_GROUP_ID, WidgetID.BarbarianAssault.ATK.ROLE_SPRITE),
BA_DEF_WAVE_TEXT(WidgetID.BA_DEFENDER_GROUP_ID, WidgetID.BarbarianAssault.CURRENT_WAVE),
BA_DEF_CALL_TEXT(WidgetID.BA_DEFENDER_GROUP_ID, WidgetID.BarbarianAssault.TO_CALL),
BA_DEF_LISTEN_TEXT(WidgetID.BA_DEFENDER_GROUP_ID, WidgetID.BarbarianAssault.LISTEN),
BA_DEF_HORN_LISTEN_TEXT(WidgetID.BA_HORN_OF_GLORY, WidgetID.BarbarianAssault.HORN_GLORY.DEFENDER),
BA_DEF_LISTEN_TEXT(WidgetID.BA_DEFENDER_GROUP_ID, WidgetID.BarbarianAssault.CORRECT_STYLE),
BA_DEF_ROLE_TEXT(WidgetID.BA_DEFENDER_GROUP_ID, WidgetID.BarbarianAssault.ROLE),
BA_DEF_ROLE_SPRITE(WidgetID.BA_DEFENDER_GROUP_ID, WidgetID.BarbarianAssault.ROLE_SPRITE),
BA_REWARD_TEXT(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_TEXT),
BA_RUNNERS_PASSED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.RUNNERS_PASSED),
BA_HITPOINTS_REPLENISHED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.HITPOINTS_REPLENISHED),
BA_WRONG_POISON_PACKS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.WRONG_POISON_PACKS_USED),
BA_EGGS_COLLECTED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.EGGS_COLLECTED),
BA_FAILED_ATTACKER_ATTACKS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.FAILED_ATTACKER_ATTACKS),
BA_RUNNERS_PASSED_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.RUNNERS_PASSED_POINTS),
BA_RANGERS_KILLED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.RANGERS_KILLED),
BA_FIGHTERS_KILLED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.FIGHTERS_KILLED),
BA_HEALERS_KILLED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.HEALERS_KILLED),
BA_RUNNERS_KILLED(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.RUNNERS_KILLED),
BA_HITPOINTS_REPLENISHED_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.HITPOINTS_REPLENISHED_POINTS),
BA_WRONG_POISON_PACKS_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.WRONG_POISON_PACKS_USED_POINTS),
BA_EGGS_COLLECTED_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.EGGS_COLLECTED_POINTS),
BA_FAILED_ATTACKER_ATTACKS_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.FAILED_ATTACKER_ATTACKS_POINTS),
BA_HONOUR_POINTS_REWARD(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.HONOUR_POINTS_REWARD),
BA_BASE_POINTS(WidgetID.BA_REWARD_GROUP_ID, WidgetID.BarbarianAssault.REWARD_VALUES.BASE_POINTS),
LEVEL_UP(WidgetID.LEVEL_UP_GROUP_ID, 0),
LEVEL_UP_SKILL(WidgetID.LEVEL_UP_GROUP_ID, WidgetID.LevelUp.SKILL),
LEVEL_UP_LEVEL(WidgetID.LEVEL_UP_GROUP_ID, WidgetID.LevelUp.LEVEL),
LEVEL_UP_CONTINUE(WidgetID.LEVEL_UP_GROUP_ID, WidgetID.LevelUp.CONTINUE),
QUEST_COMPLETED(WidgetID.QUEST_COMPLETED_GROUP_ID, 0),
QUEST_COMPLETED_NAME_TEXT(WidgetID.QUEST_COMPLETED_GROUP_ID, WidgetID.QuestCompleted.NAME_TEXT),
MOTHERLODE_MINE(WidgetID.MOTHERLODE_MINE_GROUP_ID, 0),
THEATRE_OF_BLOOD_PARTY(WidgetID.THEATRE_OF_BLOOD_PARTY_GROUP_ID, WidgetID.TheatreOfBloodParty.CONTAINER),
GWD_KC(WidgetID.GWD_KC_GROUP_ID, WidgetID.GWD.CONTAINER),
PUZZLE_BOX(WidgetID.PUZZLE_BOX_GROUP_ID, WidgetID.PuzzleBox.VISIBLE_BOX),
LIGHT_BOX(WidgetID.LIGHT_BOX_GROUP_ID, WidgetID.LightBox.LIGHT_BOX),
LIGHT_BOX_CONTENTS(WidgetID.LIGHT_BOX_GROUP_ID, WidgetID.LightBox.LIGHT_BULB_CONTAINER),
LIGHT_BOX_BUTTON_CONTAINER(WidgetID.LIGHT_BOX_GROUP_ID, WidgetID.LightBox.LIGHT_BOX_BUTTON_CONTAINER),
LIGHT_BOX_BUTTON_A(WidgetID.LIGHT_BOX_GROUP_ID, WidgetID.LightBox.BUTTON_A),
LIGHT_BOX_BUTTON_B(WidgetID.LIGHT_BOX_GROUP_ID, WidgetID.LightBox.BUTTON_B),
LIGHT_BOX_BUTTON_C(WidgetID.LIGHT_BOX_GROUP_ID, WidgetID.LightBox.BUTTON_C),
@@ -550,10 +434,6 @@ public enum WidgetInfo
RAIDS_POINTS_INFOBOX(WidgetID.RAIDS_GROUP_ID, WidgetID.Raids.POINTS_INFOBOX),
THEATRE_OF_BLOOD_HEALTH_ORBS(WidgetID.THEATRE_OF_BLOOD_GROUP_ID, WidgetID.TheatreOfBlood.ORB_BOX),
THEATRE_OF_BLOOD_BOSS_HEALTH(WidgetID.THEATRE_OF_BLOOD_GROUP_ID, WidgetID.TheatreOfBlood.BOSS_HEALTH_BAR),
THEATRE_OF_BLOOD_RAIDING_PARTY(WidgetID.THEATRE_OF_BLOOD_GROUP_ID, WidgetID.TheatreOfBlood.RAIDING_PARTY),
TOB_PARTY_INTERFACE(WidgetID.TOB_PARTY_GROUP_ID, WidgetID.Tob.PARTY_INTERFACE),
TOB_PARTY_STATS(WidgetID.TOB_PARTY_GROUP_ID, WidgetID.Tob.PARTY_STATS),
@@ -611,212 +491,25 @@ public enum WidgetInfo
GENERIC_SCROLL_TEXT(WidgetID.GENERIC_SCROLL_GROUP_ID, WidgetID.GenericScroll.TEXT),
WORLD_SWITCHER_CONTAINER(WidgetID.WORLD_SWITCHER_GROUP_ID, WidgetID.WorldSwitcher.CONTAINER),
WORLD_SWITCHER_LIST(WidgetID.WORLD_SWITCHER_GROUP_ID, WidgetID.WorldSwitcher.WORLD_LIST),
WORLD_SWITCHER_LOGOUT_BUTTON(WidgetID.WORLD_SWITCHER_GROUP_ID, WidgetID.WorldSwitcher.LOGOUT_BUTTON),
FOSSIL_ISLAND_OXYGENBAR(WidgetID.FOSSIL_ISLAND_OXYGENBAR_ID, WidgetID.FossilOxygen.FOSSIL_ISLAND_OXYGEN_BAR),
FOSSIL_MUSHROOM_TELEPORT(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.ROOT),
FOSSIL_MUSHROOM_HOUSE(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.HOUSE_ON_HILL),
FOSSIL_MUSHROOM_VALLEY(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.VERDANT_VALLEY),
FOSSIL_MUSHROOM_SWAMP(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.SWAMP),
FOSSIL_MUSHROOM_MEADOW(WidgetID.FOSSIL_ISLAND_MUSHROOM_TELE_GROUP_ID, WidgetID.FossilMushroomTeleport.MUSHROOM_MEADOW),
MINIGAME_TELEPORT_BUTTON(WidgetID.MINIGAME_TAB_ID, WidgetID.Minigames.TELEPORT_BUTTON),
PVP_FOG_OVERLAY(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.FOG_OVERLAY),
PVP_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.PVP_WIDGET_CONTAINER),
SPELL_LUMBRIDGE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.StandardSpellBook.LUMBRIDGE_HOME_TELEPORT),
SPELL_EDGEVILLE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.AncientSpellBook.EDGEVILLE_HOME_TELEPORT),
SPELL_LUNAR_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.LunarSpellBook.LUNAR_HOME_TELEPORT),
SPELL_ARCEUUS_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.ArceuusSpellBook.ARCEUUS_HOME_TELEPORT),
SPELL_KOUREND_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.StandardSpellBook.KOUREND_HOME_TELEPORT),
PVP_SKULL_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL_CONTAINER),
PVP_SKULL(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL),
PVP_ATTACK_RANGE(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.ATTACK_RANGE),
PVP_WORLD_SAFE_ZONE(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SAFE_ZONE),
PVP_WILDERNESS_LEVEL(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.WILDERNESS_LEVEL),
PVP_BOUNTY_HUNTER_INFO(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.BOUNTY_HUNTER_INFO),
PVP_KILLDEATH_COUNTER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.KILLDEATH_RATIO),
SPELLBOOK(WidgetID.SPELLBOOK_GROUP_ID, 0),
SPELLBOOK_FILTERED_BOUNDS(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTERED_SPELLS_BOUNDS),
/* STANDARD SPELL BOOK WIDGETS*/
SPELL_LUMBRIDGE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUMBRIDGE_HOME_TELEPORT),
SPELL_WIND_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_STRIKE),
SPELL_CONFUSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CONFUSE),
SPELL_ENCHANT_CROSSBOW_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENCHANT_CROSSBOW_BOLT),
SPELL_WATER_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_STRIKE),
SPELL_LVL_1_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_1_ENCHANT),
SPELL_EARTH_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_STRIKE),
SPELL_WEAKEN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WEAKEN),
SPELL_FIRE_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_STRIKE),
SPELL_BONES_TO_BANANAS(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BONES_TO_BANANAS),
SPELL_WIND_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_BOLT),
SPELL_CURSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURSE),
SPELL_BIND(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BIND),
SPELL_LOW_LEVEL_ALCHEMY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LOW_LEVEL_ALCHEMY),
SPELL_WATER_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_BOLT),
SPELL_VARROCK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VARROCK_TELEPORT),
SPELL_LVL_2_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_2_ENCHANT),
SPELL_EARTH_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_BOLT),
SPELL_LUMBRIDGE_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUMBRIDGE_TELEPORT),
SPELL_TELEKINETIC_GRAB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEKINETIC_GRAB),
SPELL_FIRE_BOLT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_BOLT),
SPELL_FALADOR_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FALADOR_TELEPORT),
SPELL_CRUMBLE_UNDEAD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CRUMBLE_UNDEAD),
SPELL_TELEPORT_TO_HOUSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEPORT_TO_HOUSE),
SPELL_WIND_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_BLAST),
SPELL_SUPERHEAT_ITEM(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SUPERHEAT_ITEM),
SPELL_CAMELOT_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CAMELOT_TELEPORT),
SPELL_WATER_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_BLAST),
SPELL_LVL_3_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_3_ENCHANT),
SPELL_IBAN_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.IBAN_BLAST),
SPELL_SNARE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SNARE),
SPELL_MAGIC_DART(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MAGIC_DART),
SPELL_ARDOUGNE_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ARDOUGNE_TELEPORT),
SPELL_EARTH_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_BLAST),
SPELL_HIGH_LEVEL_ALCHEMY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HIGH_LEVEL_ALCHEMY),
SPELL_CHARGE_WATER_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_WATER_ORB),
SPELL_LVL_4_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_4_ENCHANT),
SPELL_WATCHTOWER_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATCHTOWER_TELEPORT),
SPELL_FIRE_BLAST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_BLAST),
SPELL_CHARGE_EARTH_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_EARTH_ORB),
SPELL_BONES_TO_PEACHES(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BONES_TO_PEACHES),
SPELL_SARADOMIN_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SARADOMIN_STRIKE),
SPELL_CLAWS_OF_GUTHIX(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CLAWS_OF_GUTHIX),
SPELL_FLAMES_OF_ZAMORAK(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FLAMES_OF_ZAMORAK),
SPELL_TROLLHEIM_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TROLLHEIM_TELEPORT),
SPELL_WIND_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_WAVE),
SPELL_CHARGE_FIRE_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_FIRE_ORB),
SPELL_TELEPORT_TO_APE_ATOLL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEPORT_TO_APE_ATOLL),
SPELL_WATER_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_WAVE),
SPELL_CHARGE_AIR_ORB(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE_AIR_ORB),
SPELL_VULNERABILITY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VULNERABILITY),
SPELL_LVL_5_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_5_ENCHANT),
SPELL_TELEPORT_TO_KOUREND(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEPORT_TO_KOUREND),
SPELL_EARTH_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_WAVE),
SPELL_ENFEEBLE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENFEEBLE),
SPELL_FIRE_WAVE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_WAVE),
SPELL_ENTANGLE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENTANGLE),
SPELL_TELEOTHER_LUMBRIDGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEOTHER_LUMBRIDGE),
SPELL_STUN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STUN),
SPELL_CHARGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CHARGE),
SPELL_WIND_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_SURGE),
SPELL_TELEOTHER_FALADOR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEOTHER_FALADOR),
SPELL_WATER_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATER_SURGE),
SPELL_TELE_BLOCK(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_BLOCK),
SPELL_LVL_6_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_6_ENCHANT),
SPELL_TELEOTHER_CAMELOT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELEOTHER_CAMELOT),
SPELL_EARTH_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EARTH_SURGE),
SPELL_LVL_7_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_7_ENCHANT),
SPELL_FIRE_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_SURGE),
SPELL_BOUNTY_TARGET_TELEPORT2(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
/* END OF STANDARD SPELL BOOK WIDGETS*/
/* ANCIENT SPELL BOOK WIDGETS*/
SPELL_ICE_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_RUSH),
SPELL_ICE_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_BLITZ),
SPELL_ICE_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_BURST),
SPELL_ICE_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_BARRAGE),
SPELL_BLOOD_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_RUSH),
SPELL_BLOOD_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_BLITZ),
SPELL_BLOOD_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_BURST),
SPELL_BLOOD_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BLOOD_BARRAGE),
SPELL_SMOKE_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_RUSH),
SPELL_SMOKE_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_BLITZ),
SPELL_SMOKE_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_BURST),
SPELL_SMOKE_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SMOKE_BARRAGE),
SPELL_SHADOW_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_RUSH),
SPELL_SHADOW_BLITZ(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_BLITZ),
SPELL_SHADOW_BURST(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_BURST),
SPELL_SHADOW_BARRAGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SHADOW_BARRAGE),
SPELL_PADDEWWA_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.PADDEWWA_TELEPORT),
SPELL_SENNTISTEN_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SENNTISTEN_TELEPORT),
SPELL_KHARYRLL_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.KHARYRLL_TELEPORT),
SPELL_LASSAR_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LASSAR_TELEPORT),
SPELL_DAREEYAK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.DAREEYAK_TELEPORT),
SPELL_CARRALLANGER_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CARRALLANGER_TELEPORT),
SPELL_ANNAKARL_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ANNAKARL_TELEPORT),
SPELL_GHORROCK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GHORROCK_TELEPORT),
SPELL_EDGEVILLE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EDGEVILLE_HOME_TELEPORT),
SPELL_BOUNTY_TARGET_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
/* END OF ANCIENT SPELL BOOK WIDGETS*/
/* LUNAR SPELL BOOK WIDGETS*/
SPELL_LUNAR_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUNAR_HOME_TELEPORT),
SPELL_VENGEANCE_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE_OTHER),
SPELL_VENGEANCE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE),
SPELL_BOUNTY_TARGET_TELEPORT3(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
SPELL_BAKE_PIE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BAKE_PIE),
SPELL_CURE_PLANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_PLANT),
SPELL_MONSTER_EXAMINE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MONSTER_EXAMINE),
SPELL_NPC_CONTACT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.NPC_CONTACT),
SPELL_CURE_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_OTHER),
SPELL_HUMIDIFY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HUMIDIFY),
SPELL_MOONCLAN_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MOONCLAN_TELEPORT),
SPELL_TELE_GROUP_MOONCLAN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_MOONCLAN),
SPELL_CURE_ME(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_ME),
SPELL_HUNTER_KIT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HUNTER_KIT),
SPELL_WATERBIRTH_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WATERBIRTH_TELEPORT),
SPELL_TELE_GROUP_WATERBIRTH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_WATERBIRTH),
SPELL_CURE_GROUP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CURE_GROUP),
SPELL_STAT_SPY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STAT_SPY),
SPELL_BARBARIAN_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BARBARIAN_TELEPORT),
SPELL_TELE_GROUP_BARBARIAN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_BARBARIAN),
SPELL_SUPERGLASS_MAKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SUPERGLASS_MAKE),
SPELL_TAN_LEATHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TAN_LEATHER),
SPELL_KHAZARD_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.KHAZARD_TELEPORT),
SPELL_TELE_GROUP_KHAZARD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_KHAZARD),
SPELL_DREAM(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.DREAM),
SPELL_STRING_JEWELLERY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STRING_JEWELLERY),
SPELL_STAT_RESTORE_POT_SHARE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.STAT_RESTORE_POT_SHARE),
SPELL_MAGIC_IMBUE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.MAGIC_IMBUE),
SPELL_FERTILE_SOIL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FERTILE_SOIL),
SPELL_BOOST_POTION_SHARE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOOST_POTION_SHARE),
SPELL_FISHING_GUILD_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FISHING_GUILD_TELEPORT),
SPELL_TELE_GROUP_FISHING_GUILD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_FISHING_GUILD),
SPELL_PLANK_MAKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.PLANK_MAKE),
SPELL_CATHERBY_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CATHERBY_TELEPORT),
SPELL_TELE_GROUP_CATHERBY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_CATHERBY),
SPELL_RECHARGE_DRAGONSTONE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.RECHARGE_DRAGONSTONE),
SPELL_ICE_PLATEAU_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_PLATEAU_TELEPORT),
SPELL_TELE_GROUP_ICE_PLATEAU(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TELE_GROUP_ICE_PLATEAU),
SPELL_ENERGY_TRANSFER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ENERGY_TRANSFER),
SPELL_HEAL_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HEAL_OTHER),
SPELL_HEAL_GROUP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.HEAL_GROUP),
SPELL_SPELLBOOK_SWAP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SPELLBOOK_SWAP),
SPELL_GEOMANCY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GEOMANCY),
SPELL_SPIN_FLAX(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SPIN_FLAX),
SPELL_OURANIA_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.OURANIA_TELEPORT),
/* END OF LUNAR SPELL BOOK WIDGETS*/
SPELL_TOOLTIP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TOOLTIP),
/* ARCEUUS SPELL BOOK WIDGETS*/
SPELL_KOUREND_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.StandardSpellBook.KOUREND_HOME_TELEPORT),
SPELL_ARCEUUS_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ARCEUUS_HOME_TELEPORT),
SPELL_BATTLEFRONT_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BATTLEFRONT_TELEPORT),
SPELL_REANIMATE_GOBLIN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_GOBLIN),
SPELL_REANIMATE_MONKEY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_MONKEY),
SPELL_REANIMATE_IMP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_IMP),
SPELL_REANIMATE_MINOTAUR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_MINOTAUR),
SPELL_REANIMATE_SCORPION(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_SCORPION),
SPELL_REANIMATE_BEAR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_BEAR),
SPELL_REANIMATE_UNICORN(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_UNICORN),
SPELL_REANIMATE_DOG(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_DOG),
SPELL_REANIMATE_CHAOS_DRUID(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_CHAOS_DRUID),
SPELL_REANIMATE_GIANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_GIANT),
SPELL_REANIMATE_OGRE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_OGRE),
SPELL_REANIMATE_ELF(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_ELF),
SPELL_REANIMATE_TROLL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_TROLL),
SPELL_REANIMATE_HORROR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_HORROR),
SPELL_REANIMATE_KALPHITE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_KALPHITE),
SPELL_REANIMATE_DAGANNOTH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_DAGANNOTH),
SPELL_REANIMATE_BLOODVELD(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_BLOODVELD),
SPELL_REANIMATE_TZHAAR(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_TZHAAR),
SPELL_REANIMATE_DEMON(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_DEMON),
SPELL_REANIMATE_AVIANSIE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_AVIANSIE),
SPELL_REANIMATE_ABYSSAL(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_ABYSSAL),
SPELL_REANIMATE_DRAGON(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.REANIMATE_DRAGON),
/* END OF ARCEUUS SPELL BOOK WIDGETS*/
KOUREND_FAVOUR_OVERLAY(WidgetID.KOUREND_FAVOUR_GROUP_ID, WidgetID.KourendFavour.KOUREND_FAVOUR_OVERLAY),
ZEAH_MESS_HALL_COOKING_DISPLAY(WidgetID.ZEAH_MESS_HALL_GROUP_ID, WidgetID.Zeah.MESS_HALL_COOKING_DISPLAY),
@@ -824,11 +517,6 @@ public enum WidgetInfo
SKOTIZO_CONTAINER(WidgetID.SKOTIZO_GROUP_ID, WidgetID.Skotizo.CONTAINER),
MULTICOMBAT_FIXED(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MULTICOMBAT_INDICATOR),
MULTICOMBAT_RESIZEABLE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewport.MULTICOMBAT_INDICATOR),
FULLSCREEN_MAP_ROOT(WidgetID.FULLSCREEN_CONTAINER_TLI, WidgetID.FullScreenMap.ROOT),
QUESTLIST_BOX(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.BOX),
QUESTLIST_CONTAINER(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.CONTAINER),
QUESTLIST_SCROLLBAR(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.SCROLLBAR),
@@ -836,54 +524,6 @@ public enum WidgetInfo
QUESTLIST_MEMBERS_CONTAINER(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.MEMBERS_CONTAINER),
QUESTLIST_MINIQUEST_CONTAINER(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.MINIQUEST_CONTAINER),
MUSICTAB_INTERFACE(WidgetID.MUSICTAB_GROUP_ID, 1),
MUSICTAB_SONG_BOX(WidgetID.MUSICTAB_GROUP_ID, 2),
MUSICTAB_ALL_SONGS(WidgetID.MUSICTAB_GROUP_ID, 3),
MUSICTAB_SCROLLBAR(WidgetID.MUSICTAB_GROUP_ID, 4),
MUSICTAB_PLAYING(WidgetID.MUSICTAB_GROUP_ID, 5),
MUSICTAB_CURRENT_SONG_NAME(WidgetID.MUSICTAB_GROUP_ID, 6),
MUSICTAB_AUTO_BUTTON_LISTENER(WidgetID.MUSICTAB_GROUP_ID, 7),
MUSICTAB_AUTO_BUTTON(WidgetID.MUSICTAB_GROUP_ID, 8),
MUSICTAB_MANUAL_BUTTON_LISTENER(WidgetID.MUSICTAB_GROUP_ID, 9),
MUSICTAB_MANUAL_BUTTON(WidgetID.MUSICTAB_GROUP_ID, 10),
MUSICTAB_LOOP_BUTTON_LISTENER(WidgetID.MUSICTAB_GROUP_ID, 11),
MUSICTAB_LOOP_BUTTON(WidgetID.MUSICTAB_GROUP_ID, 12),
MUSICTAB_UNLOCKED_SONGS(WidgetID.MUSICTAB_GROUP_ID, 13),
QUESTTAB_QUEST_TAB(WidgetID.QUESTTAB_GROUP_ID, WidgetID.QuestTab.QUEST_TAB),
EQUIPMENT_MELEE_STRENGTH(WidgetID.EQUIPMENT_PAGE_GROUP_ID, WidgetID.EquipmentWidgetIdentifiers.MELEE_STRENGTH),
EQUIPMENT_RANGED_STRENGTH(WidgetID.EQUIPMENT_PAGE_GROUP_ID, WidgetID.EquipmentWidgetIdentifiers.RANGED_STRENGTH),
EQUIPMENT_MAGIC_DAMAGE(WidgetID.EQUIPMENT_PAGE_GROUP_ID, WidgetID.EquipmentWidgetIdentifiers.MAGIC_DAMAGE),
EQUIP_YOUR_CHARACTER(WidgetID.EQUIPMENT_PAGE_GROUP_ID, WidgetID.EquipmentWidgetIdentifiers.EQUIP_YOUR_CHARACTER),
BANK_PIN_TOP_LEFT_TEXT(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.TOP_LEFT_TEXT),
BANK_PIN_EXIT_BUTTON(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.EXIT_BUTTON),
BANK_PIN_FORGOT_BUTTON(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.FORGOT_BUTTON),
BANK_PIN_FIRST_ENTERED(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.FIRST_ENTERED),
BANK_PIN_SECOND_ENTERED(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.SECOND_ENTERED),
BANK_PIN_THIRD_ENTERED(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.THIRD_ENTERED),
BANK_PIN_FOURTH_ENTERED(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.FOURTH_ENTERED),
BANK_PIN_INSTRUCTION_TEXT(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.INSTRUCTION_TEXT),
BANK_PIN_1(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_1),
BANK_PIN_2(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_2),
BANK_PIN_3(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_3),
BANK_PIN_4(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_4),
BANK_PIN_5(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_5),
BANK_PIN_6(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_6),
BANK_PIN_7(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_7),
BANK_PIN_8(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_8),
BANK_PIN_9(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_9),
BANK_PIN_10(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.BUTTON_10),
XP_DROP_1(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_1),
XP_DROP_2(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_2),
XP_DROP_3(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_3),
XP_DROP_4(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_4),
XP_DROP_5(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_5),
XP_DROP_6(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_6),
XP_DROP_7(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_7),
SEED_VAULT_TITLE_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.TITLE_CONTAINER),
SEED_VAULT_ITEM_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_CONTAINER),
SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT),
@@ -894,40 +534,21 @@ public enum WidgetInfo
SETTINGS_SIDE_SOUND_EFFECT_SLIDER(WidgetID.SETTINGS_SIDE_GROUP_ID, WidgetID.SettingsSide.SOUND_EFFECT_SLIDER),
SETTINGS_SIDE_AREA_SOUND_SLIDER(WidgetID.SETTINGS_SIDE_GROUP_ID, WidgetID.SettingsSide.AREA_SOUND_SLIDER),
JEWELLERY_BOX_DUEL_RING(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.DUEL_RING),
JEWELLERY_BOX_GAME_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.GAME_NECK),
JEWELLERY_BOX_COMB_BRAC(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.COMB_BRAC),
JEWELLERY_BOX_SKIL_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.SKIL_NECK),
JEWELLERY_BOX_RING_OFGP(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.RING_OFGP),
JEWELLERY_BOX_AMUL_GLOR(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.AMUL_GLOR),
OPTIONS_CAMERA_ZOOM_SLIDER_HANDLE(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.CAMERA_ZOOM_SLIDER_HANDLE),
OPTIONS_MUSIC_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.MUSIC_SLIDER),
OPTIONS_SOUND_EFFECT_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.SOUND_EFFECT_SLIDER),
OPTIONS_AREA_SOUND_SLIDER(WidgetID.OPTIONS_GROUP_ID, WidgetID.Options.AREA_SOUND_SLIDER),
SETTINGS_INIT(WidgetID.SETTINGS_GROUP_ID, WidgetID.Settings.INIT),
ACHIEVEMENT_DIARY_CONTAINER(WidgetID.ACHIEVEMENT_DIARY_GROUP_ID, WidgetID.AchievementDiary.CONTAINER),
SKILLS_CONTAINER(WidgetID.SKILLS_GROUP_ID, WidgetID.Skills.CONTAINER),
TRADING_WITH(WidgetID.PLAYER_TRADE_SCREEN_GROUP_ID, WidgetID.TradeScreen.FIRST_TRADING_WITH),
SECOND_TRADING_WITH(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_TRADING_WITH),
SECOND_TRADING_WITH_ACCEPT_BUTTON(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_ACCEPT_FUNC),
SECOND_TRADING_WITH_ACCEPT_TEXT(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_ACCEPT_TEXT),
SECOND_TRADING_WITH_DECLINE_BUTTON(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_DECLINE_FUNC),
SECOND_TRADING_WITH_DECLINE_TEXT(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_DECLINE_TEXT),
SECOND_TRADING_WITH_MY_OFFER(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_MY_OFFER),
SECOND_TRADING_WITH_THEIR_OFFER(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_THEIR_OFFER),
SECOND_TRADING_WITH_MY_ITEMS(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_MY_ITEMS),
SECOND_TRADING_WITH_THEIR_ITEMS(WidgetID.PLAYER_TRADE_CONFIRM_GROUP_ID, WidgetID.TradeScreen.SECOND_THEIR_ITEMS),
GAUNTLET_TIMER_CONTAINER(WidgetID.GAUNTLET_TIMER_GROUP_ID, WidgetID.GauntletTimer.CONTAINER),
GAUNTLET_MAP(WidgetID.GAUNTLET_MAP_GROUP_ID, WidgetID.GauntletMap.CONTAINER),
HALLOWED_SEPULCHRE_TIMER_CONTAINER(WidgetID.HALLOWED_SEPULCHRE_TIMER_GROUP_ID, WidgetID.HallowedSepulchreTimer.CONTAINER),
HEALTH_OVERLAY_BAR(WidgetID.HEALTH_OVERLAY_BAR_GROUP_ID, WidgetID.EncounterHealthBar.CONTAINER),
SETTINGS_INIT(WidgetID.SETTINGS_GROUP_ID, WidgetID.Settings.INIT),
TRAILBLAZER_AREA_TELEPORT(WidgetID.TRAILBLAZER_AREAS_GROUP_ID, WidgetID.TrailblazerAreas.TELEPORT),
MULTICOMBAT_FIXED(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MULTICOMBAT_INDICATOR),
MULTICOMBAT_RESIZEABLE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewport.MULTICOMBAT_INDICATOR),
;
private final int groupId;
@@ -979,11 +600,6 @@ public enum WidgetInfo
return groupId << 16 | childId;
}
public static int PACK(int groupId, int childId)
{
return groupId << 16 | childId;
}
/**
* Utility method that converts an ID returned by {@link #getId()} back
* to its group ID.
@@ -1007,4 +623,17 @@ public enum WidgetInfo
{
return id & 0xFFFF;
}
/**
* Packs the group and child IDs into a single integer.
*
* @param groupId the group ID
* @param childId the child ID
* @return the packed ID
*/
public static int PACK(int groupId, int childId)
{
return groupId << 16 | childId;
}
}
@@ -29,4 +29,4 @@ public class WidgetModalMode
public static final int MODAL_NOCLICKTHROUGH = 0;
public static final int NON_MODAL = 1;
public static final int MODAL_CLICKTHROUGH = 3;
}
}
@@ -29,37 +29,15 @@ package com.openosrs.client.plugins.openosrs;
import ch.qos.logback.classic.Logger;
import com.openosrs.client.plugins.openosrs.externals.ExternalPluginManagerPanel;
import com.openosrs.client.config.OpenOSRSConfig;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import static net.runelite.api.ScriptID.BANK_PIN_OP;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.widgets.WidgetID;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_1;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_10;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_2;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_3;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_4;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_5;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_6;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_7;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_8;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_9;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_EXIT_BUTTON;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_FIRST_ENTERED;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_FORGOT_BUTTON;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_FOURTH_ENTERED;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_INSTRUCTION_TEXT;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_SECOND_ENTERED;
import static net.runelite.api.widgets.WidgetInfo.BANK_PIN_THIRD_ENTERED;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.Keybind;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.input.KeyListener;
import net.runelite.client.input.KeyManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
@@ -78,8 +56,6 @@ import org.slf4j.LoggerFactory;
@Slf4j
public class OpenOSRSPlugin extends Plugin
{
private final openosrsKeyListener keyListener = new openosrsKeyListener();
@Inject
private OpenOSRSConfig config;
@@ -107,9 +83,6 @@ public class OpenOSRSPlugin extends Plugin
client.setOculusOrbNormalSpeed(detach ? 36 : 12);
}
};
private int entered = -1;
private int enterIdx;
private boolean expectInput;
private boolean detach;
private Keybind keybind;
@@ -128,9 +101,6 @@ public class OpenOSRSPlugin extends Plugin
.build();
clientToolbar.addNavigation(navButton);
entered = -1;
enterIdx = 0;
expectInput = false;
this.keybind = config.detachHotkey();
keyManager.registerKeyListener(hotkeyListener);
}
@@ -139,12 +109,6 @@ public class OpenOSRSPlugin extends Plugin
protected void shutDown()
{
clientToolbar.removeNavigation(navButton);
entered = 0;
enterIdx = 0;
expectInput = false;
keyManager.unregisterKeyListener(keyListener);
keyManager.unregisterKeyListener(hotkeyListener);
}
@Subscribe
@@ -157,14 +121,6 @@ public class OpenOSRSPlugin extends Plugin
this.keybind = config.detachHotkey();
if (!config.keyboardPin())
{
entered = 0;
enterIdx = 0;
expectInput = false;
keyManager.unregisterKeyListener(keyListener);
}
if (event.getKey().equals("shareLogs") && !config.shareLogs())
{
final Logger logger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
@@ -172,118 +128,4 @@ public class OpenOSRSPlugin extends Plugin
}
}
@Subscribe
private void onScriptCallbackEvent(ScriptCallbackEvent e)
{
if (!config.keyboardPin())
{
return;
}
if (e.getEventName().equals("bankpin"))
{
int[] intStack = client.getIntStack();
int intStackSize = client.getIntStackSize();
// This'll be anywhere from -1 to 3
// 0 = first number, 1 second, etc
// Anything other than 0123 means the bankpin interface closes
int enterIdx = intStack[intStackSize - 1];
if (enterIdx < 0 || enterIdx > 3)
{
keyManager.unregisterKeyListener(keyListener);
this.enterIdx = 0;
this.entered = 0;
expectInput = false;
return;
}
else if (enterIdx == 0)
{
keyManager.registerKeyListener(keyListener);
}
this.enterIdx = enterIdx;
expectInput = true;
}
}
private void handleKey(char c)
{
if (client.getWidget(WidgetID.BANK_PIN_GROUP_ID, BANK_PIN_INSTRUCTION_TEXT.getChildId()) == null
|| !client.getWidget(BANK_PIN_INSTRUCTION_TEXT).getText().equals("First click the FIRST digit.")
&& !client.getWidget(BANK_PIN_INSTRUCTION_TEXT).getText().equals("Now click the SECOND digit.")
&& !client.getWidget(BANK_PIN_INSTRUCTION_TEXT).getText().equals("Time for the THIRD digit.")
&& !client.getWidget(BANK_PIN_INSTRUCTION_TEXT).getText().equals("Finally, the FOURTH digit."))
{
entered = 0;
enterIdx = 0;
expectInput = false;
keyManager.unregisterKeyListener(keyListener);
return;
}
if (!expectInput)
{
return;
}
int num = Character.getNumericValue(c);
// We gotta copy this cause enteridx changes while the script is executing
int oldEnterIdx = enterIdx;
// Script 685 will call 653, which in turn will set expectInput to true
expectInput = false;
client.runScript(BANK_PIN_OP, num, enterIdx, entered, BANK_PIN_EXIT_BUTTON.getId(), BANK_PIN_FORGOT_BUTTON.getId(), BANK_PIN_1.getId(), BANK_PIN_2.getId(), BANK_PIN_3.getId(), BANK_PIN_4.getId(), BANK_PIN_5.getId(), BANK_PIN_6.getId(), BANK_PIN_7.getId(), BANK_PIN_8.getId(), BANK_PIN_9.getId(), BANK_PIN_10.getId(), BANK_PIN_FIRST_ENTERED.getId(), BANK_PIN_SECOND_ENTERED.getId(), BANK_PIN_THIRD_ENTERED.getId(), BANK_PIN_FOURTH_ENTERED.getId(), BANK_PIN_INSTRUCTION_TEXT.getId());
if (oldEnterIdx == 0)
{
entered = num * 1000;
}
else if (oldEnterIdx == 1)
{
entered += num * 100;
}
else if (oldEnterIdx == 2)
{
entered += num * 10;
}
}
private class openosrsKeyListener implements KeyListener
{
private int lastKeyCycle;
@Override
public void keyTyped(KeyEvent keyEvent)
{
if (!Character.isDigit(keyEvent.getKeyChar()))
{
return;
}
if (client.getGameCycle() - lastKeyCycle <= 5)
{
keyEvent.consume();
return;
}
lastKeyCycle = client.getGameCycle();
clientThread.invoke(() -> handleKey(keyEvent.getKeyChar()));
keyEvent.consume();
}
@Override
public void keyPressed(KeyEvent keyEvent)
{
}
@Override
public void keyReleased(KeyEvent keyEvent)
{
}
}
}
@@ -32,6 +32,7 @@ import net.runelite.api.Constants;
import net.runelite.client.Notifier;
import net.runelite.client.ui.ContainableFrame;
import net.runelite.client.ui.overlay.components.ComponentConstants;
import net.runelite.client.util.OSType;
@ConfigGroup(RuneLiteConfig.GROUP_NAME)
public interface RuneLiteConfig extends Config
@@ -122,14 +123,14 @@ public interface RuneLiteConfig extends Config
@ConfigItem(
keyName = "uiEnableCustomChrome",
name = "Enable custom window chrome",
description = "Use Runelite's custom window title and borders.",
description = "Use RuneLite's custom window title and borders.",
warning = "Please restart your client after changing this setting",
position = 15,
section = windowSettings
)
default boolean enableCustomChrome()
{
return true;
return OSType.getOSType() == OSType.Windows;
}
@Range(
@@ -150,7 +151,7 @@ public interface RuneLiteConfig extends Config
@ConfigItem(
keyName = "gameAlwaysOnTop",
name = "Enable client always on top",
name = "Always on top",
description = "The game will always be on the top of the screen",
position = 17,
section = windowSettings
@@ -162,8 +163,8 @@ public interface RuneLiteConfig extends Config
@ConfigItem(
keyName = "warningOnExit",
name = "Display warning on exit",
description = "Toggles a warning popup when trying to exit the client",
name = "Exit warning",
description = "Shows a warning popup when trying to exit the client",
position = 18,
section = windowSettings
)
@@ -198,7 +199,7 @@ public interface RuneLiteConfig extends Config
@ConfigItem(
keyName = "notificationRequestFocus",
name = "Request focus on notification",
name = "Request focus",
description = "Configures the window focus request type on notification",
position = 21,
section = notificationSettings
@@ -222,8 +223,8 @@ public interface RuneLiteConfig extends Config
@ConfigItem(
keyName = "notificationGameMessage",
name = "Enable game message notifications",
description = "Puts a notification message in the chatbox",
name = "Game message notifications",
description = "Adds a notification message to the chatbox",
position = 23,
section = notificationSettings
)
@@ -234,7 +235,7 @@ public interface RuneLiteConfig extends Config
@ConfigItem(
keyName = "flashNotification",
name = "Flash notification",
name = "Flash",
description = "Flashes the game frame as a notification",
position = 24,
section = notificationSettings
@@ -259,7 +260,7 @@ public interface RuneLiteConfig extends Config
@Alpha
@ConfigItem(
keyName = "notificationFlashColor",
name = "Notification Flash Color",
name = "Notification Flash",
description = "Sets the color of the notification flashes.",
position = 26,
section = notificationSettings
@@ -295,7 +296,7 @@ public interface RuneLiteConfig extends Config
@ConfigItem(
keyName = "interfaceFontType",
name = "Interface Overlay Font",
name = "Interface Font",
description = "Configures what font type is used for in-game interface overlays such as panels, opponent info, clue scrolls etc.",
position = 32,
section = overlaySettings
@@ -689,6 +689,11 @@ public class ChatboxTextInput extends ChatboxInput implements KeyListener, Mouse
log.warn("Unable to get clipboard", ex);
}
return;
case KeyEvent.VK_A:
selectionStart = 0;
selectionEnd = value.length();
cursorAt(0, selectionEnd);
return;
}
return;
}
@@ -753,11 +758,25 @@ public class ChatboxTextInput extends ChatboxInput implements KeyListener, Mouse
return;
case KeyEvent.VK_LEFT:
ev.consume();
newPos--;
if (cursorStart != cursorEnd)
{
newPos = cursorStart;
}
else
{
newPos--;
}
break;
case KeyEvent.VK_RIGHT:
ev.consume();
newPos++;
if (cursorStart != cursorEnd)
{
newPos = cursorEnd;
}
else
{
newPos++;
}
break;
case KeyEvent.VK_UP:
ev.consume();
@@ -50,9 +50,9 @@ public class KaramjaDiaryRequirement extends GenericDiaryRequirement
add("Claim a ticket from the Agility Arena in Brimhaven.",
new SkillRequirement(Skill.AGILITY, 30));
add("Discover hidden wall in the dungeon below the volcano.",
new QuestRequirement(Quest.DRAGON_SLAYER, true));
new QuestRequirement(Quest.DRAGON_SLAYER_I, true));
add("Visit the Isle of Crandor via the dungeon below the volcano.",
new QuestRequirement(Quest.DRAGON_SLAYER, true));
new QuestRequirement(Quest.DRAGON_SLAYER_I, true));
add("Use Vigroy and Hajedy's cart service.",
new QuestRequirement(Quest.SHILO_VILLAGE));
add("Earn 100% favour in the village of Tai Bwo Wannai.",
@@ -147,7 +147,7 @@ public interface AgilityConfig extends Config
@Alpha
@ConfigItem(
keyName = "portalsHighlight",
name = "Portals Highlight Color",
name = "Portals Color",
description = "Color of highlighted Prifddinas portals",
position = 9
)
@@ -81,7 +81,7 @@ public interface BoostsConfig extends Config
@ConfigItem(
keyName = "displayNextBuffChange",
name = "Display next buff change",
name = "Next buff change",
description = "Configures whether or not to display when the next buffed stat change will be",
position = 4
)
@@ -92,7 +92,7 @@ public interface BoostsConfig extends Config
@ConfigItem(
keyName = "displayNextDebuffChange",
name = "Display next debuff change",
name = "Next debuff change",
description = "Configures whether or not to display when the next debuffed stat change will be",
position = 5
)
@@ -103,7 +103,7 @@ public interface BoostsConfig extends Config
@ConfigItem(
keyName = "boostThreshold",
name = "Boost amount threshold",
name = "Boost threshold",
description = "The threshold at which boosted levels will be displayed in a different color. A value of 0 will disable the feature.",
position = 6
)
@@ -51,7 +51,7 @@ public interface CannonConfig extends Config
)
@ConfigItem(
keyName = "lowWarningThreshold",
name = "Low Warning Threshold",
name = "Low warning threshold",
description = "Configures the number of cannonballs remaining before a notification is sent. <br>Regardless of this value, a notification will still be sent when your cannon is empty.",
position = 2
)
@@ -62,7 +62,7 @@ public interface CannonConfig extends Config
@ConfigItem(
keyName = "showInfobox",
name = "Show Cannonball infobox",
name = "Show cannonball infobox",
description = "Configures whether to show the cannonballs in an infobox",
position = 3
)
@@ -85,7 +85,7 @@ public interface CannonConfig extends Config
@Alpha
@ConfigItem(
keyName = "highlightDoubleHitColor",
name = "Color of double hit spots",
name = "Double hit spots",
description = "Configures the highlight color of double hit spots",
position = 5
)
@@ -156,7 +156,7 @@ public interface ChatFilterConfig extends Config
@ConfigItem(
keyName = "maxRepeatedPublicChats",
name = "Max repeated public chats",
name = "Repeat filter",
description = "Block player chat message if repeated this many times. 0 is off",
position = 11
)
@@ -105,7 +105,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("A crate found in the tower of a church is your next location.", CRATE_357, new WorldPoint(2612, 3304, 1), "Climb the ladder and search the crates on the first floor in the Church in Ardougne."),
new CrypticClue("Covered in shadows, the centre of the circle is where you will find the answer.", new WorldPoint(3488, 3289, 0), "Dig in the centre of Mort'ton, where the roads intersect."),
new CrypticClue("I lie lonely and forgotten in mid wilderness, where the dead rise from their beds. Feel free to quarrel and wind me up, and dig while you shoot their heads.", new WorldPoint(3174, 3663, 0), "Directly under the crossbow respawn in the Graveyard of Shadows in level 18 Wilderness."),
new CrypticClue("In the city where merchants are said to have lived, talk to a man with a splendid cape, but a hat dropped by goblins.", "Head chef", new WorldPoint(3143, 3445, 0), "Talk to the Head chef in Cooks' Guild west of Varrock. You will need a chef hat or cooking cape to enter."),
new CrypticClue("In the city where merchants are said to have lived, talk to a man with a splendid cape, but a hat dropped by goblins.", "Head chef", new WorldPoint(3143, 3445, 0), "Talk to the Head chef in Cooks' Guild west of Varrock. You will need a chef's hat, Varrock armour 3 or 4, or the Cooking cape to enter."),
new CrypticClue("The mother of the reptilian sacrifice.", "Zul-Cheray", new WorldPoint(2204, 3050, 0), "Talk to Zul-Cheray in a house near the sacrificial boat at Zul-Andra."),
new CrypticClue("I watch the sea. I watch you fish. I watch your tree.", "Ellena", new WorldPoint(2860, 3431, 0), "Speak to Ellena at Catherby fruit tree patch."),
new CrypticClue("Dig between some ominous stones in Falador.", new WorldPoint(3040, 3399, 0), "Three standing stones inside a walled area. East of the northern Falador gate."),
@@ -50,7 +50,7 @@ import net.runelite.client.ui.overlay.components.TitleComponent;
public class FaloTheBardClue extends ClueScroll implements TextClueScroll, NpcClueScroll
{
private static final List<FaloTheBardClue> CLUES = ImmutableList.of(
new FaloTheBardClue("A blood red weapon, a strong curved sword, found on the island of primate lords.", item(DRAGON_SCIMITAR)),
new FaloTheBardClue("A blood red weapon, a strong curved sword, found on the island of primate lords.", any("Dragon scimitar", item(DRAGON_SCIMITAR), item(DRAGON_SCIMITAR_OR))),
new FaloTheBardClue("A book that preaches of some great figure, lending strength, might and vigour.", any("Any god book (must be complete)", item(HOLY_BOOK), item(BOOK_OF_BALANCE), item(UNHOLY_BOOK), item(BOOK_OF_LAW), item(BOOK_OF_WAR), item(BOOK_OF_DARKNESS))),
new FaloTheBardClue("A bow of elven craft was made, it shimmers bright, but will soon fade.", any("Crystal Bow", item(CRYSTAL_BOW), item(CRYSTAL_BOW_24123))),
new FaloTheBardClue("A fiery axe of great inferno, when you use it, you'll wonder where the logs go.", item(INFERNAL_AXE)),
@@ -91,7 +91,7 @@ public enum HotColdLocation
FREMENNIK_PROVINCE_FREMMY_ISLES_MINE(new WorldPoint(2374, 3850, 0), FREMENNIK_PROVINCE, "Central Fremennik Isles mine.", ANCIENT_WIZARDS),
FREMENNIK_PROVINCE_WEST_ISLES_MINE(new WorldPoint(2313, 3850, 0), FREMENNIK_PROVINCE, "West Fremennik Isles mine.", ANCIENT_WIZARDS),
FREMENNIK_PROVINCE_WEST_JATIZSO_ENTRANCE(new WorldPoint(2393, 3812, 0), FREMENNIK_PROVINCE, "West of the Jatizso mine entrance.", BRASSICAN_MAGE),
FREMENNIK_PROVINCE_PIRATES_COVE(new WorldPoint(2210, 3814, 0), FREMENNIK_PROVINCE, "Pirates' Cove", ANCIENT_WIZARDS),
FREMENNIK_PROVINCE_PIRATES_COVE(new WorldPoint(2211, 3817, 0), FREMENNIK_PROVINCE, "Pirates' Cove", ANCIENT_WIZARDS),
FREMENNIK_PROVINCE_ASTRAL_ALTER(new WorldPoint(2149, 3865, 0), FREMENNIK_PROVINCE, "Astral altar", ANCIENT_WIZARDS),
FREMENNIK_PROVINCE_LUNAR_VILLAGE(new WorldPoint(2084, 3916, 0), FREMENNIK_PROVINCE, "Lunar Isle, inside the village.", ANCIENT_WIZARDS),
FREMENNIK_PROVINCE_LUNAR_NORTH(new WorldPoint(2106, 3949, 0), FREMENNIK_PROVINCE, "Lunar Isle, north of the village.", ANCIENT_WIZARDS),
@@ -487,15 +487,19 @@ class ConfigPanel extends PluginPanel
if (cid.getType().isEnum())
{
Class<? extends Enum> type = (Class<? extends Enum>) cid.getType();
JComboBox box = new JComboBox(type.getEnumConstants());
JComboBox<Enum<?>> box = new JComboBox<Enum<?>>(type.getEnumConstants()); // NOPMD: UseDiamondOperator
// set renderer prior to calling box.getPreferredSize(), since it will invoke the renderer
// to build components for each combobox element in order to compute the display size of the
// combobox
box.setRenderer(new ComboBoxListRenderer<>());
box.setPreferredSize(new Dimension(box.getPreferredSize().width, 25));
box.setRenderer(new ComboBoxListRenderer());
box.setForeground(Color.WHITE);
box.setFocusable(false);
box.setPrototypeDisplayValue("XXXXXXXX"); //sorry but this is the way to keep the size of the combobox in check.
try
{
Enum selectedItem = Enum.valueOf(type, configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()));
Enum<?> selectedItem = Enum.valueOf(type, configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()));
box.setSelectedItem(selectedItem);
box.setToolTipText(Text.titleCase(selectedItem));
}
@@ -508,7 +512,7 @@ class ConfigPanel extends PluginPanel
if (e.getStateChange() == ItemEvent.SELECTED)
{
changeConfiguration(box, cd, cid);
box.setToolTipText(Text.titleCase((Enum) box.getSelectedItem()));
box.setToolTipText(Text.titleCase((Enum<?>) box.getSelectedItem()));
}
});
item.add(box, BorderLayout.EAST);
@@ -56,4 +56,11 @@ public enum CustomCursor
this.name = name;
this.cursorImage = ImageUtil.loadImageResource(CustomCursorPlugin.class, icon);
}
@Override
public String toString()
{
return name;
}
}
@@ -99,7 +99,7 @@ public interface DriftNetConfig extends Config
@ConfigItem(
keyName = "tagAnnette",
name = "Tag Annette when no nets in inventory",
name = "Tag Annette",
description = "Tag Annette when no nets in inventory",
position = 6
)
@@ -93,7 +93,7 @@ public interface FishingConfig extends Config
@Alpha
@ConfigItem(
keyName = "minnowsOverlayColor",
name = "Minnows Overlay Color",
name = "Minnows Overlay",
description = "Color of overlays for Minnows",
position = 5
)
@@ -105,7 +105,7 @@ public interface FishingConfig extends Config
@Alpha
@ConfigItem(
keyName = "aerialOverlayColor",
name = "Aerial Overlay Color",
name = "Aerial Overlay",
description = "Color of overlays when 1-tick aerial fishing",
position = 6
)
@@ -156,7 +156,7 @@ public interface GroundItemsConfig extends Config
@ConfigItem(
keyName = "notifyTier",
name = "Notify >= Tier",
name = "Notify tier",
description = "Configures which price tiers will trigger a notification on drop",
position = 8
)
@@ -211,7 +211,7 @@ public interface GroundItemsConfig extends Config
@ConfigItem(
keyName = "hideUnderValue",
name = "Hide < Value",
name = "Hide under value",
description = "Configures hidden ground items under both GE and HA value",
position = 13
)
@@ -223,7 +223,7 @@ public interface GroundItemsConfig extends Config
@Alpha
@ConfigItem(
keyName = "defaultColor",
name = "Default items color",
name = "Default items",
description = "Configures the color for default, non-highlighted items",
position = 14
)
@@ -235,7 +235,7 @@ public interface GroundItemsConfig extends Config
@Alpha
@ConfigItem(
keyName = "highlightedColor",
name = "Highlighted items color",
name = "Highlighted items",
description = "Configures the color for highlighted items",
position = 15
)
@@ -247,7 +247,7 @@ public interface GroundItemsConfig extends Config
@Alpha
@ConfigItem(
keyName = "hiddenColor",
name = "Hidden items color",
name = "Hidden items",
description = "Configures the color for hidden items in right-click menu and when holding ALT",
position = 16
)
@@ -259,7 +259,7 @@ public interface GroundItemsConfig extends Config
@Alpha
@ConfigItem(
keyName = "lowValueColor",
name = "Low value items color",
name = "Low value items",
description = "Configures the color for low value items",
position = 17
)
@@ -282,7 +282,7 @@ public interface GroundItemsConfig extends Config
@Alpha
@ConfigItem(
keyName = "mediumValueColor",
name = "Medium value items color",
name = "Medium value items",
description = "Configures the color for medium value items",
position = 19
)
@@ -305,7 +305,7 @@ public interface GroundItemsConfig extends Config
@Alpha
@ConfigItem(
keyName = "highValueColor",
name = "High value items color",
name = "High value items",
description = "Configures the color for high value items",
position = 21
)
@@ -328,7 +328,7 @@ public interface GroundItemsConfig extends Config
@Alpha
@ConfigItem(
keyName = "insaneValueColor",
name = "Insane value items color",
name = "Insane value items",
description = "Configures the color for insane value items",
position = 23
)
@@ -361,8 +361,8 @@ public interface GroundItemsConfig extends Config
@ConfigItem(
keyName = "doubleTapDelay",
name = "Delay for double-tap ALT to hide",
description = "Decrease this number if you accidentally hide ground items often. (0 = Disabled)",
name = "Double-tap delay",
description = "Delay for the double-tap ALT to hide ground items. 0 to disable.",
position = 26
)
@Units(Units.MILLISECONDS)
@@ -373,7 +373,7 @@ public interface GroundItemsConfig extends Config
@ConfigItem(
keyName = "collapseEntries",
name = "Collapse ground item menu entries",
name = "Collapse ground item menu",
description = "Collapses ground item menu entries together and appends count",
position = 27
)
@@ -90,7 +90,7 @@ public interface IdleNotifierConfig extends Config
@ConfigItem(
keyName = "hitpoints",
name = "Hitpoints Notification Threshold",
name = "Hitpoints Threshold",
description = "The amount of hitpoints to send a notification at. A value of 0 will disable notification.",
position = 6
)
@@ -101,7 +101,7 @@ public interface IdleNotifierConfig extends Config
@ConfigItem(
keyName = "prayer",
name = "Prayer Notification Threshold",
name = "Prayer Threshold",
description = "The amount of prayer points to send a notification at. A value of 0 will disable notification.",
position = 7
)
@@ -112,7 +112,7 @@ public interface IdleNotifierConfig extends Config
@ConfigItem(
keyName = "oxygen",
name = "Oxygen Notification Threshold",
name = "Oxygen Threshold",
position = 8,
description = "The amount of remaining oxygen to send a notification at. A value of 0 will disable notification."
)
@@ -124,9 +124,9 @@ public interface IdleNotifierConfig extends Config
@ConfigItem(
keyName = "spec",
name = "Special Attack Energy Notification Threshold",
name = "Spec Threshold",
position = 9,
description = "The amount of spec energy reached to send a notification at. A value of 0 will disable notification."
description = "The amount of special attack energy reached to send a notification at. A value of 0 will disable notification."
)
@Units(Units.PERCENT)
default int getSpecEnergyThreshold()
@@ -55,7 +55,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 1,
keyName = "showbaby",
name = "Show Baby implings",
name = "Baby implings",
description = "Configures whether or not Baby impling tags are displayed",
section = implingSection
)
@@ -80,7 +80,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 3,
keyName = "showyoung",
name = "Show Young implings",
name = "Young implings",
description = "Configures whether or not Young impling tags are displayed",
section = implingSection
)
@@ -105,7 +105,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 5,
keyName = "showgourmet",
name = "Show Gourmet implings",
name = "Gourmet implings",
description = "Configures whether or not Gourmet impling tags are displayed",
section = implingSection
)
@@ -130,7 +130,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 7,
keyName = "showearth",
name = "Show Earth implings",
name = "Earth implings",
description = "Configures whether or not Earth impling tags are displayed",
section = implingSection
)
@@ -155,7 +155,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 9,
keyName = "showessence",
name = "Show Essence implings",
name = "Essence implings",
description = "Configures whether or not Essence impling tags are displayed",
section = implingSection
)
@@ -180,7 +180,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 11,
keyName = "showeclectic",
name = "Show Eclectic implings",
name = "Eclectic implings",
description = "Configures whether or not Eclectic impling tags are displayed",
section = implingSection
)
@@ -205,7 +205,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 13,
keyName = "shownature",
name = "Show Nature implings",
name = "Nature implings",
description = "Configures whether or not Nature impling tags are displayed",
section = implingSection
)
@@ -230,7 +230,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 15,
keyName = "showmagpie",
name = "Show Magpie implings",
name = "Magpie implings",
description = "Configures whether or not Magpie impling tags are displayed",
section = implingSection
)
@@ -255,7 +255,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 17,
keyName = "showninja",
name = "Show Ninja implings",
name = "Ninja implings",
description = "Configures whether or not Ninja impling tags are displayed",
section = implingSection
)
@@ -280,7 +280,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 19,
keyName = "showCrystal",
name = "Show Crystal implings",
name = "Crystal implings",
description = "Configures whether or not Crystal implings are displayed",
section = implingSection
)
@@ -305,7 +305,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 21,
keyName = "showdragon",
name = "Show Dragon implings",
name = "Dragon implings",
description = "Configures whether or not Dragon impling tags are displayed",
section = implingSection
)
@@ -330,7 +330,7 @@ public interface ImplingsConfig extends Config
@ConfigItem(
position = 23,
keyName = "showlucky",
name = "Show Lucky implings",
name = "Lucky implings",
description = "Configures whether or not Lucky impling tags are displayed",
section = implingSection
)
@@ -51,7 +51,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "veryLowWarningColor",
name = "Very Low Warning Color",
name = "Very Low Warning",
description = "The color of the overlay when charges are very low",
position = 1
)
@@ -62,7 +62,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "lowWarningColor",
name = "Low Warning Color",
name = "Low Warning",
description = "The color of the overlay when charges are low",
position = 2
)
@@ -95,7 +95,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showTeleportCharges",
name = "Show Teleport Charges",
name = "Teleport Charges",
description = "Show teleport item charge counts",
position = 5,
section = chargesSection
@@ -149,7 +149,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showImpCharges",
name = "Show Imp-in-a-box charges",
name = "Imp-in-a-box charges",
description = "Show Imp-in-a-box item charges",
position = 8,
section = chargesSection
@@ -161,7 +161,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showFungicideCharges",
name = "Show Fungicide Charges",
name = "Fungicide Charges",
description = "Show Fungicide item charges",
position = 9,
section = chargesSection
@@ -173,7 +173,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showWateringCanCharges",
name = "Show Watering Can Charges",
name = "Watering Can Charges",
description = "Show Watering can item charges",
position = 10,
section = chargesSection
@@ -185,7 +185,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showWaterskinCharges",
name = "Show Waterskin Charges",
name = "Waterskin Charges",
description = "Show Waterskin dose counts",
position = 11,
section = chargesSection
@@ -197,7 +197,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showBellowCharges",
name = "Show Bellows Charges",
name = "Bellows Charges",
description = "Show Ogre bellows item charges",
position = 12,
section = chargesSection
@@ -209,7 +209,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showBasketCharges",
name = "Show Basket Charges",
name = "Basket Charges",
description = "Show Fruit basket item counts",
position = 13,
section = chargesSection
@@ -221,7 +221,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showSackCharges",
name = "Show Sack Charges",
name = "Sack Charges",
description = "Show Sack item counts",
position = 14,
section = chargesSection
@@ -233,7 +233,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showAbyssalBraceletCharges",
name = "Show Abyssal Bracelet Charges",
name = "Abyssal Bracelet Charges",
description = "Show Abyssal bracelet item charges",
position = 15,
section = chargesSection
@@ -245,7 +245,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showAmuletOfChemistryCharges",
name = "Show Amulet of Chemistry Charges",
name = "Amulet of Chemistry Charges",
description = "Show Amulet of chemistry item charges",
position = 16,
section = chargesSection
@@ -275,7 +275,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showAmuletOfBountyCharges",
name = "Show Amulet of Bounty Charges",
name = "Amulet of Bounty Charges",
description = "Show Amulet of bounty item charges",
position = 17,
section = chargesSection
@@ -317,7 +317,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showBindingNecklaceCharges",
name = "Show Binding Necklace Charges",
name = "Binding Necklace Charges",
description = "Show Binding necklace item charges",
position = 19,
section = chargesSection
@@ -359,7 +359,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showExplorerRingCharges",
name = "Show Explorer's Ring Alch Charges",
name = "Explorer's Ring Alch Charges",
description = "Show Explorer's ring alchemy charges",
position = 21,
section = chargesSection
@@ -389,7 +389,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showRingOfForgingCount",
name = "Show Ring of Forging Charges",
name = "Ring of Forging Charges",
description = "Show Ring of forging item charges",
position = 22,
section = chargesSection
@@ -431,7 +431,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showInfoboxes",
name = "Show Infoboxes",
name = "Infoboxes",
description = "Show an infobox with remaining charges for equipped items",
position = 24
)
@@ -442,7 +442,7 @@ public interface ItemChargeConfig extends Config
@ConfigItem(
keyName = "showPotionDoseCount",
name = "Show Potion Doses",
name = "Potion Doses",
description = "Show remaining potion doses",
position = 25,
section = chargesSection
@@ -131,7 +131,7 @@ public class ItemStatChanges
add(boost(DEFENCE, perc(.15, 5)), SUPER_DEFENCE1, SUPER_DEFENCE2, SUPER_DEFENCE3, SUPER_DEFENCE4);
add(boost(MAGIC, 3), MAGIC_ESSENCE1, MAGIC_ESSENCE2, MAGIC_ESSENCE3, MAGIC_ESSENCE4);
add(combo(3, boost(ATTACK, perc(.15, 5)), boost(STRENGTH, perc(.15, 5)), boost(DEFENCE, perc(.15, 5))), SUPER_COMBAT_POTION1, SUPER_COMBAT_POTION2, SUPER_COMBAT_POTION3, SUPER_COMBAT_POTION4);
add(combo(3, boost(ATTACK, perc(.20, 2)), boost(STRENGTH, perc(.12, 2)), heal(PRAYER, perc(.10, 0)), heal(DEFENCE, perc(.10, -2)), new BoostedStatBoost(HITPOINTS, false, perc(-.12, 0))), ZAMORAK_BREW1, ZAMORAK_BREW2, ZAMORAK_BREW3, ZAMORAK_BREW4);
add(combo(3, boost(ATTACK, perc(.20, 2)), boost(STRENGTH, perc(.12, 2)), heal(PRAYER, perc(.10, 0)), new BoostedStatBoost(DEFENCE, false, perc(.10, -2)), new BoostedStatBoost(HITPOINTS, false, perc(-.12, 0))), ZAMORAK_BREW1, ZAMORAK_BREW2, ZAMORAK_BREW3, ZAMORAK_BREW4);
add(new SaradominBrew(0.15, 0.2, 0.1, 2, 2), SARADOMIN_BREW1, SARADOMIN_BREW2, SARADOMIN_BREW3, SARADOMIN_BREW4);
add(boost(RANGED, perc(.15, 5)), SUPER_RANGING_1, SUPER_RANGING_2, SUPER_RANGING_3, SUPER_RANGING_4);
add(boost(MAGIC, perc(.15, 5)), SUPER_MAGIC_POTION_1, SUPER_MAGIC_POTION_2, SUPER_MAGIC_POTION_3, SUPER_MAGIC_POTION_4);
@@ -214,6 +214,10 @@ public class ItemStatChanges
add(heal(HITPOINTS, 20), PADDLEFISH);
add(new GauntletPotion(), EGNIOL_POTION_1, EGNIOL_POTION_2, EGNIOL_POTION_3, EGNIOL_POTION_4);
// Soul Wars
add(combo(2, heal(HITPOINTS, perc(.20, 2)), heal(RUN_ENERGY, 100)), BANDAGES_25202);
add(combo(6, boost(ATTACK, perc(.15, 5)), boost(STRENGTH, perc(.15, 5)), boost(DEFENCE, perc(.15, 5)), boost(RANGED, perc(.15, 5)), boost(MAGIC, perc(.15, 5)), heal(PRAYER, perc(.25, 8))), POTION_OF_POWER1, POTION_OF_POWER2, POTION_OF_POWER3, POTION_OF_POWER4);
log.debug("{} items; {} behaviours loaded", effects.size(), new HashSet<>(effects.values()).size());
}
@@ -227,6 +227,10 @@ public class LootTrackerPlugin extends Plugin
private static final String CASKET_EVENT = "Casket";
// Soul Wars
private static final String SPOILS_OF_WAR_EVENT = "Spoils of war";
private static final Set<Integer> SOUL_WARS_REGIONS = ImmutableSet.of(8493, 8749, 9005);
private static final Set<Character> VOWELS = ImmutableSet.of('a', 'e', 'i', 'o', 'u');
@Inject
@@ -487,8 +491,8 @@ public class LootTrackerPlugin extends Plugin
@Subscribe
public void onPlayerLootReceived(final PlayerLootReceived playerLootReceived)
{
// Ignore Last Man Standing player loots
if (isPlayerWithinMapRegion(LAST_MAN_STANDING_REGIONS))
// Ignore Last Man Standing and Soul Wars player loots
if (isPlayerWithinMapRegion(LAST_MAN_STANDING_REGIONS) || isPlayerWithinMapRegion(SOUL_WARS_REGIONS))
{
return;
}
@@ -763,6 +767,7 @@ public class LootTrackerPlugin extends Plugin
|| SEEDPACK_EVENT.equals(eventType)
|| CASKET_EVENT.equals(eventType)
|| BIRDNEST_EVENT.equals(eventType)
|| SPOILS_OF_WAR_EVENT.equals(eventType)
|| eventType.endsWith("Bird House")
|| eventType.startsWith("H.A.M. chest")
|| lootRecordType == LootRecordType.PICKPOCKET)
@@ -808,6 +813,12 @@ public class LootTrackerPlugin extends Plugin
setEvent(LootRecordType.EVENT, CASKET_EVENT);
takeInventorySnapshot();
}
if (event.getMenuOption().equals("Open") && event.getId() == ItemID.SPOILS_OF_WAR)
{
setEvent(LootRecordType.EVENT, SPOILS_OF_WAR_EVENT);
takeInventorySnapshot();
}
}
@Schedule(
@@ -606,4 +606,15 @@ public interface MenuEntrySwapperConfig extends Config
{
return false;
}
@ConfigItem(
keyName = "swapRockCake",
name = "Dwarven rock cake",
description = "Swap Eat with Guzzle on the Dwarven rock cake",
section = itemSection
)
default boolean swapRockCake()
{
return false;
}
}
@@ -355,6 +355,8 @@ public class MenuEntrySwapperPlugin extends Plugin
swapTeleport("camelot teleport", "seers'");
swapTeleport("watchtower teleport", "yanille");
swapTeleport("teleport to house", "outside");
swap("eat", "guzzle", config::swapRockCake);
}
private void swap(String option, String swappedOption, Supplier<Boolean> enabled)
@@ -44,7 +44,7 @@ public interface OpponentInfoConfig extends Config
@ConfigItem(
keyName = "hitpointsDisplayStyle",
name = "Hitpoints display style",
name = "Display style",
description = "Show opponent's hitpoints as a value (if known), percentage, or both",
position = 1
)
@@ -55,7 +55,7 @@ public interface PlayerIndicatorsConfig extends Config
@ConfigItem(
position = 1,
keyName = "ownNameColor",
name = "Own player color",
name = "Own player",
description = "Color of your own player",
section = highlightSection
)
@@ -79,7 +79,7 @@ public interface PlayerIndicatorsConfig extends Config
@ConfigItem(
position = 3,
keyName = "friendNameColor",
name = "Friend color",
name = "Friend",
description = "Color of friend names",
section = highlightSection
)
@@ -103,7 +103,7 @@ public interface PlayerIndicatorsConfig extends Config
@ConfigItem(
position = 5,
keyName = "clanMemberColor",
name = "Friends chat member color",
name = "Friends chat",
description = "Color of friends chat members",
section = highlightSection
)
@@ -127,7 +127,7 @@ public interface PlayerIndicatorsConfig extends Config
@ConfigItem(
position = 7,
keyName = "teamMemberColor",
name = "Team member color",
name = "Team member",
description = "Color of team members",
section = highlightSection
)
@@ -151,7 +151,7 @@ public interface PlayerIndicatorsConfig extends Config
@ConfigItem(
position = 9,
keyName = "nonClanMemberColor",
name = "Others color",
name = "Others",
description = "Color of other players names",
section = highlightSection
)
@@ -133,7 +133,7 @@ public interface PrayerConfig extends Config
@ConfigItem(
position = 9,
keyName = "replaceOrbText",
name = "Replace orb text with prayer time left",
name = "Show time left",
description = "Show time remaining of current prayers in the prayer orb."
)
default boolean replaceOrbText()
@@ -69,7 +69,7 @@ public interface PyramidPlunderConfig extends Config
@ConfigItem(
position = 3,
keyName = "highlightDoorsColor",
name = "Highlight doors color",
name = "Highlight doors",
description = "Selects the color for highlighting tomb doors"
)
default Color highlightDoorsColor()
@@ -92,7 +92,7 @@ public interface PyramidPlunderConfig extends Config
@ConfigItem(
position = 5,
keyName = "highlightSpeartrapColor",
name = "Highlight speartrap color",
name = "Highlight speartrap",
description = "Selects the color for highlighting speartraps"
)
default Color highlightSpeartrapsColor()
@@ -115,7 +115,7 @@ public interface PyramidPlunderConfig extends Config
@ConfigItem(
position = 7,
keyName = "highlightContainersColor",
name = "Highlight containers color",
name = "Highlight containers",
description = "Selects the color for highlighting urns, chests and sarcophagus"
)
default Color highlightContainersColor()
@@ -47,7 +47,7 @@ public interface RaidsConfig extends Config
@ConfigItem(
position = 1,
keyName = "pointsMessage",
name = "Display points in chatbox after raid",
name = "Display points in chatbox",
description = "Display a message with total points, individual points and percentage at the end of a raid"
)
default boolean pointsMessage()
@@ -69,8 +69,8 @@ public interface RaidsConfig extends Config
@ConfigItem(
position = 3,
keyName = "scoutOverlayAtBank",
name = "Show scout overlay outside lobby",
description = "Keep the overlay active while at the raids area"
name = "Show scout overlay outside",
description = "Keep the overlay active outside of the raid starting room"
)
default boolean scoutOverlayAtBank()
{
@@ -168,8 +168,8 @@ public interface RaidsConfig extends Config
@ConfigItem(
position = 12,
keyName = "layoutMessage",
name = "Send raid layout message when entering raid",
description = "Sends game message with raid layout on entering new raid"
name = "Raid layout message",
description = "Sends a game message with the raid layout on entering a raid"
)
default boolean layoutMessage()
{
@@ -179,7 +179,7 @@ public interface RaidsConfig extends Config
@ConfigItem(
position = 13,
keyName = "screenshotHotkey",
name = "Scouter screenshot hotkey",
name = "Screenshot hotkey",
description = "Hotkey used to screenshot the scouting overlay"
)
default Keybind screenshotHotkey()
@@ -190,7 +190,7 @@ public interface RaidsConfig extends Config
@ConfigItem(
position = 14,
keyName = "uploadScreenshot",
name = "Upload scouting screenshot",
name = "Upload screenshot",
description = "Uploads the scouting screenshot to Imgur or the clipboard"
)
default ImageUploadStyle uploadScreenshot()
@@ -52,7 +52,7 @@ public interface RegenMeterConfig extends Config
@ConfigItem(
keyName = "showWhenNoChange",
name = "Show hitpoints regen at full hitpoints",
name = "Show at full hitpoints",
description = "Always show the hitpoints regen orb, even if there will be no stat change")
default boolean showWhenNoChange()
{
@@ -61,7 +61,7 @@ public interface RegenMeterConfig extends Config
@ConfigItem(
keyName = "notifyBeforeHpRegenDuration",
name = "Hitpoint Regen Notification",
name = "Hitpoint Notification",
description = "Notify approximately when your next hitpoint is about to regen. A value of 0 will disable notification."
)
@Units(Units.SECONDS)
@@ -64,7 +64,7 @@ public interface StatusBarsConfig extends Config
@ConfigItem(
keyName = "leftBarMode",
name = "Left Status Bar",
name = "Left Bar",
description = "Configures the left status bar"
)
default BarMode leftBarMode()
@@ -74,7 +74,7 @@ public interface StatusBarsConfig extends Config
@ConfigItem(
keyName = "rightBarMode",
name = "Right Status Bar",
name = "Right Bar",
description = "Configures the right status bar"
)
default BarMode rightBarMode()
@@ -36,8 +36,9 @@ public interface TileIndicatorsConfig extends Config
@Alpha
@ConfigItem(
keyName = "highlightDestinationColor",
name = "Color of current destination highlighting",
description = "Configures the highlight color of current destination"
name = "Destination tile",
description = "Configures the highlight color of current destination",
position = 1
)
default Color highlightDestinationColor()
{
@@ -47,7 +48,8 @@ public interface TileIndicatorsConfig extends Config
@ConfigItem(
keyName = "highlightDestinationTile",
name = "Highlight destination tile",
description = "Highlights tile player is walking to"
description = "Highlights tile player is walking to",
position = 2
)
default boolean highlightDestinationTile()
{
@@ -57,8 +59,9 @@ public interface TileIndicatorsConfig extends Config
@Alpha
@ConfigItem(
keyName = "highlightHoveredColor",
name = "Color of current hovered highlighting",
description = "Configures the highlight color of hovered tile"
name = "Hovered tile",
description = "Configures the highlight color of hovered tile",
position = 3
)
default Color highlightHoveredColor()
{
@@ -68,7 +71,8 @@ public interface TileIndicatorsConfig extends Config
@ConfigItem(
keyName = "highlightHoveredTile",
name = "Highlight hovered tile",
description = "Highlights tile player is hovering with mouse"
description = "Highlights tile player is hovering with mouse",
position = 4
)
default boolean highlightHoveredTile()
{
@@ -78,8 +82,9 @@ public interface TileIndicatorsConfig extends Config
@Alpha
@ConfigItem(
keyName = "highlightCurrentColor",
name = "Color of current true tile highlighting",
description = "Configures the highlight color of current true tile"
name = "True tile",
description = "Configures the highlight color of current true tile",
position = 5
)
default Color highlightCurrentColor()
{
@@ -88,8 +93,9 @@ public interface TileIndicatorsConfig extends Config
@ConfigItem(
keyName = "highlightCurrentTile",
name = "Highlight current true tile",
description = "Highlights true tile player is on as seen by server"
name = "Highlight true tile",
description = "Highlights true tile player is on as seen by server",
position = 6
)
default boolean highlightCurrentTile()
{
@@ -110,7 +110,7 @@ public interface TimeTrackingConfig extends Config
@ConfigItem(
keyName = "timerWarningThreshold",
name = "Timer Warning Threshold",
name = "Warning Threshold",
description = "The time at which to change the timer color to the warning color",
position = 6
)
@@ -51,7 +51,7 @@ public interface WintertodtConfig extends Config
@ConfigItem(
position = 1,
keyName = "damageNotificationColor",
name = "Damage Notification Color",
name = "Damage Notification",
description = "Color of damage notification text in chat"
)
default Color damageNotificationColor()
@@ -62,7 +62,7 @@ public interface WintertodtConfig extends Config
@ConfigItem(
position = 2,
keyName = "roundNotification",
name = "Wintertodt round notification",
name = "Round notification",
description = "Notifies you before the round starts (in seconds)"
)
@Range(
@@ -71,7 +71,13 @@ enum MinigameLocation
CATAPULT_ROOM("Catapult Room", new WorldPoint(2842, 3545, 0)),
SHOT_PUT_ROOM("Shot Put Room", new WorldPoint(2863, 3550, 0)),
HALLOWED_SEPULCHRE("Hallowed Sepulchre", new WorldPoint(3653, 3386, 1)),
THE_GAUNTLET("The Gauntlet", new WorldPoint(3223, 12505, 1));
THE_GAUNTLET("The Gauntlet", new WorldPoint(3223, 12505, 1)),
MAHOGANY_HOMES_ARDOUGNE("Mahogany Homes", new WorldPoint(2634, 3295, 0)),
MAHOGANY_HOMES_FALADOR("Mahogany Homes", new WorldPoint(2989, 3363, 0)),
MAHOGANY_HOMES_HOSIDIUS("Mahogany Homes", new WorldPoint(1780, 3623, 0)),
MAHOGANY_HOMES_VARROCK("Mahogany Homes", new WorldPoint(3240, 3471, 0)),
SOUL_WARS("Soul Wars", new WorldPoint(2209, 2855, 0)),
SOUL_WARS_EDGEVILLE_PORTAL("Soul Wars", new WorldPoint(3082, 3474, 0));
private final String tooltip;
private final WorldPoint location;
@@ -38,7 +38,7 @@ enum QuestStartLocation
THE_CORSAIR_CURSE(Quest.THE_CORSAIR_CURSE, new WorldPoint(3029, 3273, 0)),
DEMON_SLAYER(Quest.DEMON_SLAYER, new WorldPoint(3204, 3424, 0)),
DORICS_QUEST(Quest.DORICS_QUEST, new WorldPoint(2952, 3450, 0)),
DRAGON_SLAYER(Quest.DRAGON_SLAYER, new WorldPoint(3190, 3362, 0)),
DRAGON_SLAYER_I(Quest.DRAGON_SLAYER_I, new WorldPoint(3190, 3362, 0)),
ERNEST_THE_CHICKEN(Quest.ERNEST_THE_CHICKEN, new WorldPoint(3109, 3330, 0)),
GOBLIN_DIPLOMACY(Quest.GOBLIN_DIPLOMACY, new WorldPoint(2957, 3509, 0)),
IMP_CATCHER(Quest.IMP_CATCHER, new WorldPoint(3108, 3160, 0)),
@@ -136,7 +136,7 @@ enum QuestStartLocation
A_PORCINE_OF_INTEREST(Quest.A_PORCINE_OF_INTEREST, new WorldPoint(3085, 3251, 0)),
PRIEST_IN_PERIL(Quest.PRIEST_IN_PERIL, new WorldPoint(3219, 3473, 0)),
THE_QUEEN_OF_THIEVES(Quest.THE_QUEEN_OF_THIEVES, new WorldPoint(1795, 3782, 0)),
RAG_AND_BONE_MAN(new Quest[]{Quest.RAG_AND_BONE_MAN, Quest.RAG_AND_BONE_MAN_II}, new WorldPoint(3359, 3504, 0)),
RAG_AND_BONE_MAN_I(new Quest[]{Quest.RAG_AND_BONE_MAN_I, Quest.RAG_AND_BONE_MAN_II}, new WorldPoint(3359, 3504, 0)),
RECRUITMENT_DRIVE_BLACK_KNIGHTS_FORTRESS(new Quest[]{Quest.BLACK_KNIGHTS_FORTRESS, Quest.RECRUITMENT_DRIVE}, new WorldPoint(2959, 3336, 0)),
ROVING_ELVES(Quest.ROVING_ELVES, new WorldPoint(2288, 3146, 0)),
RUM_DEAL(Quest.RUM_DEAL, new WorldPoint(3679, 3535, 0)),
@@ -192,6 +192,7 @@ enum TransportationPointLocation
MUSHTREE_TAR_SWAMP("Mushtree", new WorldPoint(3676, 3755, 0)),
MUSHTREE_VERDANT_VALLEY("Mushtree", new WorldPoint(3757, 3756, 0)),
MYTHS_GUILD_PORTAL("Portal to Guilds", new WorldPoint(2456, 2856, 0)),
SOUL_WARS_PORTAL("Portal to Edgeville/Ferox Enclave", new WorldPoint(2204, 2858, 0)),
TRAIN_KELDAGRIM("Railway Station", new WorldPoint(2941, 10179, 0)),
WILDERNESS_LEVER_ARDOUGNE("Wilderness Lever to Deserted Keep", new WorldPoint(2559, 3309, 0), new WorldPoint(3154, 3924, 0)),
WILDERNESS_LEVER_EDGEVILLE("Wilderness Lever to Deserted Keep", new WorldPoint(3088, 3474, 0), new WorldPoint(3154, 3924, 0)),
@@ -34,7 +34,7 @@ public interface WorldMapConfig extends Config
{
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_FAIRY_RING_TOOLTIPS,
name = "Show fairy ring codes in tooltip",
name = "Fairy ring code tooltip",
description = "Display the code for fairy rings in the icon tooltip",
position = 1
)
@@ -45,7 +45,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_FAIRY_RING_ICON,
name = "Show fairy ring travel icon",
name = "Fairy ring travel icon",
description = "Override the travel icon for fairy rings",
position = 2
)
@@ -56,7 +56,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_AGILITY_SHORTCUT_TOOLTIPS,
name = "Show agility level requirement",
name = "Agility level requirement",
description = "Display the required Agility level in the icon tooltip",
position = 3
)
@@ -78,7 +78,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_AGILITY_COURSE_TOOLTIPS,
name = "Show agility course in tooltip",
name = "Agility course tooltip",
description = "Displays the name of the agility course in the tooltip",
position = 5
)
@@ -100,7 +100,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_NORMAL_TELEPORT_ICON,
name = "Show Standard Spellbook destinations",
name = "Standard Spellbook destinations",
description = "Show icons at the destinations for teleports in the Standard Spellbook",
position = 7
)
@@ -111,7 +111,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_MINIGAME_TOOLTIP,
name = "Show minigame name in tooltip",
name = "Minigame names",
description = "Display the name of the minigame in the icon tooltip",
position = 8
)
@@ -122,7 +122,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_ANCIENT_TELEPORT_ICON,
name = "Show Ancient Magicks destinations",
name = "Ancient Magicks destinations",
description = "Show icons at the destinations for teleports in the Ancient Spellbook",
position = 9
)
@@ -133,7 +133,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_LUNAR_TELEPORT_ICON,
name = "Show Lunar Spellbook destinations",
name = "Lunar Spellbook destinations",
description = "Show icons at the destinations for teleports in the Lunar Spellbook",
position = 10
)
@@ -144,7 +144,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_ARCEUUS_TELEPORT_ICON,
name = "Show Arceuus Spellbook destinations",
name = "Arceuus Spellbook destinations",
description = "Show icons at the destinations for teleports in the Arceuus Spellbook",
position = 11
)
@@ -155,7 +155,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_JEWELLERY_TELEPORT_ICON,
name = "Show jewellery teleport locations",
name = "Jewellery teleport destinations",
description = "Show icons at the destinations for teleports from jewellery",
position = 12
)
@@ -166,7 +166,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_SCROLL_TELEPORT_ICON,
name = "Show teleport scroll locations",
name = "Teleport scroll destinations",
description = "Show icons at the destinations for teleports from scrolls",
position = 13
)
@@ -177,7 +177,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_MISC_TELEPORT_ICON,
name = "Show misc teleport locations",
name = "Misc teleport destinations",
description = "Show icons at the destinations for miscellaneous teleport items",
position = 14
)
@@ -188,7 +188,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_QUEST_START_TOOLTIPS,
name = "Show quest names and status",
name = "Quest names and status",
description = "Indicates the names of quests and shows completion status",
position = 15
)
@@ -199,7 +199,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_FARMING_PATCH_TOOLTIPS,
name = "Show farming patch type",
name = "Farming patch type",
description = "Display the type of farming patches in the icon tooltip",
position = 16
)
@@ -210,7 +210,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_RARE_TREE_TOOLTIPS,
name = "Show rare tree type",
name = "Rare tree type",
description = "Display the type of rare tree in the icon tooltip",
position = 17
)
@@ -232,7 +232,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_TRANSPORTATION_TELEPORT_TOOLTIPS,
name = "Show transportation tooltips",
name = "Transportation tooltips",
description = "Indicates types and destinations of Transportation",
position = 19
)
@@ -243,7 +243,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_RUNECRAFTING_ALTAR_ICON,
name = "Show runecrafting altar locations",
name = "Runecrafting altar locations",
description = "Show the icons of runecrafting altars",
position = 20
)
@@ -254,7 +254,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_MINING_SITE_TOOLTIPS,
name = "Show mining site tooltips",
name = "Mining site tooltips",
description = "Indicates the ore available at mining sites",
position = 21
)
@@ -265,7 +265,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_DUNGEON_TOOLTIPS,
name = "Show dungeon tooltips",
name = "Dungeon tooltips",
description = "Indicates the names of dungeons",
position = 22
)
@@ -276,7 +276,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_HUNTER_AREA_TOOLTIPS,
name = "Show hunter area tooltips",
name = "Hunter area tooltips",
description = "Indicates the creatures inside a hunting area",
position = 23
)
@@ -287,7 +287,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_FISHING_SPOT_TOOLTIPS,
name = "Show fishing spot tooltips",
name = "Fishing spot tooltips",
description = "Indicates the type of fish fishable at the fishing spot",
position = 24
)
@@ -298,7 +298,7 @@ public interface WorldMapConfig extends Config
@ConfigItem(
keyName = WorldMapPlugin.CONFIG_KEY_KOUREND_TASK_TOOLTIPS,
name = "Show Kourend task tooltips",
name = "Kourend task tooltips",
description = "Indicates the task or unlock for Kourend Favour locations",
position = 25
)
@@ -69,7 +69,7 @@ public class SplashScreen extends JFrame implements ActionListener
private SplashScreen() throws IOException
{
BufferedImage logo = ImageUtil.getResourceStreamFromClass(SplashScreen.class, "runelite_transparent.png");
BufferedImage logo = ImageUtil.loadImageResource(SplashScreen.class, "runelite_transparent.png");
setTitle("RuneLite Launcher");
@@ -39,11 +39,11 @@ import net.runelite.client.util.Text;
* was very hard to see in the dark gray background, this makes the selected
* item white and adds some padding to the elements for more readable list.
*/
public final class ComboBoxListRenderer extends JLabel implements ListCellRenderer
public final class ComboBoxListRenderer<T> extends JLabel implements ListCellRenderer<T>
{
@Override
public Component getListCellRendererComponent(JList list, Object o, int index, boolean isSelected, boolean cellHasFocus)
public Component getListCellRendererComponent(JList<? extends T> list, T o, int index, boolean isSelected, boolean cellHasFocus)
{
if (isSelected)
{
@@ -0,0 +1 @@
5464D17DCD348F352EFFE6AA6AEEC5A5609ECBA30EAC2CB2B3D479D2C0DDDA9A
@@ -0,0 +1,75 @@
.id 3898
.int_stack_count 6
.string_stack_count 0
.int_var_count 11
.string_var_count 0
get_varbit 4606
iconst 0
if_icmpne LABEL4
jump LABEL5
LABEL4:
return
LABEL5:
iconst 512
istore 6
iconst 512
istore 7
iload 2
iconst 16
sub
istore 8
iconst 0
iload 3
invoke 1045
istore 3
iload 2
iconst 16
sub
iload 3
invoke 1046
istore 3
iconst 896
sconst "innerZoomLimit"
runelite_callback
iconst 128
sconst "outerZoomLimit"
runelite_callback
sub
istore 9
iconst 896
sconst "innerZoomLimit"
runelite_callback
iconst 128
sconst "outerZoomLimit"
runelite_callback
sub
istore 10
iload 3
iload 9
multiply
iload 8
div
iconst 128
sconst "outerZoomLimit"
runelite_callback
add
istore 6
iload 3
iload 10
multiply
iload 8
div
iconst 128
sconst "outerZoomLimit"
runelite_callback
add
istore 7
iload 0
iload 1
iload 7
iload 6
iload 2
iload 4
iload 5
invoke 3899
return
@@ -0,0 +1 @@
AA98471D04D9CB1172253D0B479EFD2D58394BDD2852F3AE8CD2B2D46FA826C3
@@ -0,0 +1,96 @@
.id 3899
.int_stack_count 7
.string_stack_count 0
.int_var_count 11
.string_var_count 0
get_varbit 4606
iconst 0
if_icmpne LABEL4
jump LABEL5
LABEL4:
return
LABEL5:
iconst 896
sconst "innerZoomLimit"
runelite_callback
iload 2
invoke 1046
istore 2
iconst 128
sconst "outerZoomLimit"
runelite_callback
iload 2
invoke 1045
istore 2
iconst 896
sconst "innerZoomLimit"
runelite_callback
iload 3
invoke 1046
istore 3
iconst 128
sconst "outerZoomLimit"
runelite_callback
iload 3
invoke 1045
istore 3
iload 2
iload 3
viewport_setfov
iconst 0
istore 7
iconst 0
istore 8
viewport_geteffectivesize
istore 8
istore 7
iload 8
iconst 334
sub
istore 9
iload 9
iconst 0
if_icmplt LABEL39
jump LABEL42
LABEL39:
iconst 0
istore 9
jump LABEL48
LABEL42:
iload 9
iconst 100
if_icmpgt LABEL46
jump LABEL48
LABEL46:
iconst 100
istore 9
LABEL48:
iload 2
iload 3
iload 2
sub
iload 9
multiply
iconst 100
div
add
istore 10
iconst 25
iconst 25
iload 10
multiply
iconst 256
div
add
cam_setfollowheight
iload 2
iload 3
set_varc_int 74
set_varc_int 73
iload 0
iload 1
iload 4
iload 5
iload 6
invoke 3900
return
@@ -0,0 +1 @@
03D7F1AF9E8405CB4A74779254E8C65563123F865CC0181186238B038A740755
@@ -0,0 +1,78 @@
.id 3900
.int_stack_count 5
.string_stack_count 0
.int_var_count 11
.string_var_count 0
iconst 896
sconst "innerZoomLimit"
runelite_callback
iconst 128
sconst "outerZoomLimit"
runelite_callback
sub
istore 5
iconst 896
sconst "innerZoomLimit"
runelite_callback
iconst 128
sconst "outerZoomLimit"
runelite_callback
sub
istore 6
iload 2
iconst 16
sub
istore 7
iconst 0
istore 8
iconst 0
istore 9
viewport_geteffectivesize
istore 9
istore 8
iconst 0
istore 10
iload 8
iconst 334
if_icmpgt LABEL25
jump LABEL34
LABEL25:
get_varc_int 74
iconst 128
sconst "outerZoomLimit"
runelite_callback
sub
iload 7
multiply
iload 5
div
istore 10
jump LABEL42
LABEL34:
get_varc_int 73
iconst 128
sconst "outerZoomLimit"
runelite_callback
sub
iload 7
multiply
iload 6
div
istore 10
LABEL42:
iload 0
iload 1
cc_find
iconst 1
if_icmpeq LABEL48
jump LABEL55
LABEL48:
iload 4
iload 10
add
iload 3
iconst 0
iconst 0
cc_setposition
LABEL55:
return
@@ -0,0 +1 @@
A1B6D1B291AA3594728DDEA47049E17119F5CCB6F8E757E1524FA89DE92F9A34
@@ -0,0 +1,663 @@
/*
* Copyright (c) 2018, 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.chatcommands;
import com.google.common.collect.Sets;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.io.IOException;
import java.util.concurrent.ScheduledExecutorService;
import javax.inject.Inject;
import net.runelite.api.ChatMessageType;
import static net.runelite.api.ChatMessageType.FRIENDSCHATNOTIFICATION;
import static net.runelite.api.ChatMessageType.GAMEMESSAGE;
import static net.runelite.api.ChatMessageType.TRADE;
import net.runelite.api.Client;
import net.runelite.api.MessageNode;
import net.runelite.api.Player;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.WidgetLoaded;
import net.runelite.api.widgets.Widget;
import static net.runelite.api.widgets.WidgetID.ADVENTURE_LOG_ID;
import static net.runelite.api.widgets.WidgetID.GENERIC_SCROLL_GROUP_ID;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.chat.ChatCommandManager;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.config.ChatColorConfig;
import net.runelite.client.config.ConfigManager;
import net.runelite.http.api.chat.ChatClient;
import net.runelite.http.api.hiscore.HiscoreClient;
import net.runelite.http.api.hiscore.HiscoreSkill;
import net.runelite.http.api.hiscore.SingleHiscoreSkillResult;
import net.runelite.http.api.hiscore.Skill;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class ChatCommandsPluginTest
{
private static final String PLAYER_NAME = "Adam";
@Mock
@Bind
Client client;
@Mock
@Bind
ConfigManager configManager;
@Mock
@Bind
ScheduledExecutorService scheduledExecutorService;
@Mock
@Bind
ChatColorConfig chatColorConfig;
@Mock
@Bind
ChatCommandManager chatCommandManager;
@Mock
@Bind
HiscoreClient hiscoreClient;
@Mock
@Bind
ChatMessageManager chatMessageManager;
@Mock
@Bind
ChatClient chatClient;
@Mock
@Bind
ChatCommandsConfig chatCommandsConfig;
@Inject
ChatCommandsPlugin chatCommandsPlugin;
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
Player player = mock(Player.class);
when(player.getName()).thenReturn(PLAYER_NAME);
when(client.getLocalPlayer()).thenReturn(player);
}
@Test
public void testStartupShutdown()
{
chatCommandsPlugin.startUp();
chatCommandsPlugin.shutDown();
ArgumentCaptor<String> registerCaptor = ArgumentCaptor.forClass(String.class);
verify(chatCommandManager, atLeastOnce()).registerCommand(registerCaptor.capture(), any());
verify(chatCommandManager, atLeastOnce()).registerCommandAsync(registerCaptor.capture(), any());
verify(chatCommandManager, atLeastOnce()).registerCommandAsync(registerCaptor.capture(), any(), any());
ArgumentCaptor<String> unregisterCaptor = ArgumentCaptor.forClass(String.class);
verify(chatCommandManager, atLeastOnce()).unregisterCommand(unregisterCaptor.capture());
assertEquals(Sets.newHashSet(registerCaptor.getAllValues()), Sets.newHashSet(unregisterCaptor.getAllValues()));
}
@Test
public void testCorporealBeastKill()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", "Your Corporeal Beast kill count is: <col=ff0000>4</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "corporeal beast", 4);
}
@Test
public void testTheatreOfBlood()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Wave 'The Final Challenge' complete! Duration: <col=ff0000>5:04</col><br>Theatre of Blood wave completion time: <col=ff0000>37:04</col> (Personal best!)", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", "Your completed Theatre of Blood count is: <col=ff0000>73</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "theatre of blood", 73);
verify(configManager).setRSProfileConfiguration("personalbest", "theatre of blood", 37 * 60 + 4);
}
@Test
public void testTheatreOfBloodNoPb()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Wave 'The Final Challenge' complete! Duration: <col=ff0000>5:04</col><br>Theatre of Blood wave completion time: <col=ff0000>38:17</col><br></col>Personal best: 37:04", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", "Your completed Theatre of Blood count is: <col=ff0000>73</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "theatre of blood", 73);
verify(configManager).setRSProfileConfiguration("personalbest", "theatre of blood", 37 * 60 + 4);
}
@Test
public void testWintertodt()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", "Your subdued Wintertodt count is: <col=ff0000>4</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "wintertodt", 4);
}
@Test
public void testKreearra()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", "Your Kree'arra kill count is: <col=ff0000>4</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "kree'arra", 4);
}
@Test
public void testBarrows()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", "Your Barrows chest count is: <col=ff0000>277</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "barrows chests", 277);
}
@Test
public void testHerbiboar()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", "Your herbiboar harvest count is: <col=ff0000>4091</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "herbiboar", 4091);
}
@Test
public void testGauntlet()
{
ChatMessage gauntletMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Gauntlet completion count is: <col=ff0000>123</col>.", null, 0);
chatCommandsPlugin.onChatMessage(gauntletMessage);
verify(configManager).setRSProfileConfiguration("killcount", "gauntlet", 123);
}
@Test
public void testCorruptedGauntlet()
{
ChatMessage corruptedGauntletMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Corrupted Gauntlet completion count is: <col=ff0000>4729</col>.", null, 0);
chatCommandsPlugin.onChatMessage(corruptedGauntletMessage);
verify(configManager).setRSProfileConfiguration("killcount", "corrupted gauntlet", 4729);
}
@Test
public void testPersonalBest()
{
final String FIGHT_DURATION = "Fight duration: <col=ff0000>2:06</col>. Personal best: 1:19.";
// This sets lastBoss
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Kree'arra kill count is: <col=ff0000>4</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", FIGHT_DURATION, null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "kree'arra", 79);
}
@Test
public void testPersonalBestNoTrailingPeriod()
{
final String FIGHT_DURATION = "Fight duration: <col=ff0000>0:59</col>. Personal best: 0:55";
// This sets lastBoss
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Zulrah kill count is: <col=ff0000>4</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", FIGHT_DURATION, null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "zulrah", 55);
}
@Test
public void testNewPersonalBest()
{
final String NEW_PB = "Fight duration: <col=ff0000>3:01</col> (new personal best).";
// This sets lastBoss
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Kree'arra kill count is: <col=ff0000>4</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", NEW_PB, null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "kree'arra", 181);
}
@Test
public void testDuelArenaWin()
{
ChatMessage chatMessageEvent = new ChatMessage(null, TRADE, "", "You won! You have now won 27 duels.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "duel arena wins", 27);
verify(configManager).setRSProfileConfiguration("killcount", "duel arena win streak", 1);
}
@Test
public void testDuelArenaWin2()
{
ChatMessage chatMessageEvent = new ChatMessage(null, TRADE, "", "You were defeated! You have won 22 duels.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "duel arena wins", 22);
}
@Test
public void testDuelArenaLose()
{
ChatMessage chatMessageEvent = new ChatMessage(null, TRADE, "", "You have now lost 999 duels.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessageEvent);
verify(configManager).setRSProfileConfiguration("killcount", "duel arena losses", 999);
}
@Test
public void testAgilityLap()
{
final String NEW_PB = "Lap duration: <col=ff0000>1:01</col> (new personal best).";
// This sets lastBoss
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Prifddinas Agility Course lap count is: <col=ff0000>2</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", NEW_PB, null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "prifddinas agility course", 61);
verify(configManager).setRSProfileConfiguration("killcount", "prifddinas agility course", 2);
}
@Test
public void testZukNewPb()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your TzKal-Zuk kill count is: <col=ff0000>2</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Duration: <col=ff0000>104:31</col> (new personal best)", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "tzkal-zuk", 104 * 60 + 31);
verify(configManager).setRSProfileConfiguration("killcount", "tzkal-zuk", 2);
}
@Test
public void testZukKill()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your TzKal-Zuk kill count is: <col=ff0000>3</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Duration: <col=ff0000>172:18</col>. Personal best: 134:52", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "tzkal-zuk", 134 * 60 + 52);
verify(configManager).setRSProfileConfiguration("killcount", "tzkal-zuk", 3);
}
@Test
public void testGgNewPb()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Fight duration: <col=ff0000>1:36</col> (new personal best)", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Grotesque Guardians kill count is: <col=ff0000>179</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "grotesque guardians", 96);
verify(configManager).setRSProfileConfiguration("killcount", "grotesque guardians", 179);
}
@Test
public void testGgKill()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Fight duration: <col=ff0000>2:41</col>. Personal best: 2:14", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Grotesque Guardians kill count is: <col=ff0000>32</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "grotesque guardians", 2 * 60 + 14);
verify(configManager).setRSProfileConfiguration("killcount", "grotesque guardians", 32);
}
@Test
public void testGuantletPersonalBest()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: <col=ff0000>10:24</col>. Personal best: 7:59.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Gauntlet completion count is: <col=ff0000>124</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("killcount", "gauntlet", 124);
verify(configManager).setRSProfileConfiguration("personalbest", "gauntlet", 7 * 60 + 59);
}
@Test
public void testGuantletNewPersonalBest()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: <col=ff0000>10:24</col> (new personal best).", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Gauntlet completion count is: <col=ff0000>124</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "gauntlet", 10 * 60 + 24);
verify(configManager).setRSProfileConfiguration("killcount", "gauntlet", 124);
}
@Test
public void testCoXKill()
{
ChatMessage chatMessage = new ChatMessage(null, FRIENDSCHATNOTIFICATION, "", "<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>24+ players</col> Duration:</col> <col=ff0000>37:04</col> (new personal best)</col>>", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your completed Chambers of Xeric count is: <col=ff0000>51</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("killcount", "chambers of xeric", 51);
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 37 * 60 + 4);
}
@Test
public void testCoXKillNoPb()
{
ChatMessage chatMessage = new ChatMessage(null, FRIENDSCHATNOTIFICATION, "", "<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>11-15 players</col> Duration:</col> <col=ff0000>23:25</col> Personal best: </col><col=ff0000>20:19</col>", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your completed Chambers of Xeric count is: <col=ff0000>52</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("killcount", "chambers of xeric", 52);
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 20 * 60 + 19);
}
@Test
public void testAdventureLogCountersPage()
{
Widget advLogWidget = mock(Widget.class);
Widget advLogExploitsTextWidget = mock(Widget.class);
when(advLogWidget.getChild(ChatCommandsPlugin.ADV_LOG_EXPLOITS_TEXT_INDEX)).thenReturn(advLogExploitsTextWidget);
when(advLogExploitsTextWidget.getText()).thenReturn("The Exploits of " + PLAYER_NAME);
when(client.getWidget(WidgetInfo.ADVENTURE_LOG)).thenReturn(advLogWidget);
when(configManager.getRSProfileConfiguration(anyString(), anyString(), any(Class.class))).thenReturn(2224);
WidgetLoaded advLogEvent = new WidgetLoaded();
advLogEvent.setGroupId(ADVENTURE_LOG_ID);
chatCommandsPlugin.onWidgetLoaded(advLogEvent);
chatCommandsPlugin.onGameTick(new GameTick());
String COUNTER_TEXT = "Duel Arena<br>Wins: <col=d0c0b0>4</col><br>Losses: <col=d0c0b0>2</col>" +
"<br><br>Last Man Standing<br>Rank: <col=d0c0b0>0</col>" +
"<br><br>Treasure Trails<br>Beginner: <col=d0c0b0>0</col><br>Easy: <col=d0c0b0>7</col>" +
"<br>Medium: <col=d0c0b0>28</col><br>Hard: <col=d0c0b0>108</col><br>Elite: <col=d0c0b0>15</col>" +
"<br>Master: <col=d0c0b0>27</col><br>Rank: <col=d0c0b0>Novice</col>" +
"<br><br>Chompy Hunting<br>Kills: <col=d0c0b0>1,000</col><br>Rank: <col=d0c0b0>Ogre Expert</col>" +
"<br><br>Order of the White Knights<br>Rank: <col=d0c0b0>Master</col><br>with a kill score of <col=d0c0b0>1,300</col>" +
"<br><br>TzHaar Fight Cave<br>Fastest run: <col=d0c0b0>38:10</col>" +
"<br><br>Inferno<br>Fastest run: <col=d0c0b0>-</col><br><br>Zulrah<br>" +
"Fastest kill: <col=d0c0b0>5:48</col><br><br>Vorkath<br>Fastest kill: <col=d0c0b0>1:21</col>" +
"<br><br>Galvek<br>Fastest kill: <col=d0c0b0>-</col><br><br>Grotesque Guardians<br>" +
"Fastest kill: <col=d0c0b0>2:49</col><br><br>Alchemical Hydra<br>Fastest kill: <col=d0c0b0>-</col>" +
"<br><br>Hespori<br>Fastest kill: <col=d0c0b0>0:57</col><br><br>Nightmare<br>" +
"Fastest kill: <col=d0c0b0>3:30</col><br><br>The Gauntlet<br>Fastest run: <col=d0c0b0>-</col>" +
"<br><br>The Corrupted Gauntlet<br>Fastest run: <col=d0c0b0>-</col><br><br>Fragment of Seren<br>Fastest kill: <col=d0c0b0>-</col>" +
"<br><br>Chambers of Xeric<br>Fastest run - (Team size: 24+ players): <col=d0c0b0>24:17</col>" +
"<br><br>Chambers of Xeric - Challenge mode<br>Fastest run - (Team size: Solo): <col=d0c0b0>22:15</col>" +
"<br><br>Barbarian Assault<br>High-level gambles: <col=d0c0b0>0</col><br><br>Fremennik spirits rested: <col=d0c0b0>0</col>";
Widget countersPage = mock(Widget.class);
when(countersPage.getText()).thenReturn(COUNTER_TEXT);
when(client.getWidget(WidgetInfo.GENERIC_SCROLL_TEXT)).thenReturn(countersPage);
WidgetLoaded countersLogEvent = new WidgetLoaded();
countersLogEvent.setGroupId(GENERIC_SCROLL_GROUP_ID);
chatCommandsPlugin.onWidgetLoaded(countersLogEvent);
chatCommandsPlugin.onGameTick(new GameTick());
verify(configManager).setRSProfileConfiguration("personalbest", "tztok-jad", 38 * 60 + 10);
verify(configManager).setRSProfileConfiguration("personalbest", "zulrah", 5 * 60 + 48);
verify(configManager).setRSProfileConfiguration("personalbest", "vorkath", 1 * 60 + 21);
verify(configManager).setRSProfileConfiguration("personalbest", "grotesque guardians", 2 * 60 + 49);
verify(configManager).setRSProfileConfiguration("personalbest", "hespori", 57);
verify(configManager).setRSProfileConfiguration("personalbest", "nightmare", 3 * 60 + 30);
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 24 * 60 + 17);
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric challenge mode", 22 * 60 + 15);
}
@Test
public void testAdventurerLogCountersPage2()
{
Widget advLogWidget = mock(Widget.class);
Widget advLogExploitsTextWidget = mock(Widget.class);
when(advLogWidget.getChild(ChatCommandsPlugin.ADV_LOG_EXPLOITS_TEXT_INDEX)).thenReturn(advLogExploitsTextWidget);
when(advLogExploitsTextWidget.getText()).thenReturn("The Exploits of " + PLAYER_NAME);
when(client.getWidget(WidgetInfo.ADVENTURE_LOG)).thenReturn(advLogWidget);
WidgetLoaded advLogEvent = new WidgetLoaded();
advLogEvent.setGroupId(ADVENTURE_LOG_ID);
chatCommandsPlugin.onWidgetLoaded(advLogEvent);
chatCommandsPlugin.onGameTick(new GameTick());
String COUNTER_TEXT = "Duel Arena<br>Wins: <col=d0c0b0>12</col><br>Losses: <col=d0c0b0>20</col>" +
"<br><br>Last Man Standing<br>Rank: <col=d0c0b0>0</col>" +
"<br><br>Treasure Trails<br>Beginner: <col=d0c0b0>1</col><br>Easy: <col=d0c0b0>4</col>" +
"<br>Medium: <col=d0c0b0>35</col><br>Hard: <col=d0c0b0>66</col><br>Elite: <col=d0c0b0>2</col>" +
"<br>Master: <col=d0c0b0>0</col><br>Rank: <col=d0c0b0>Novice</col>" +
"<br><br>Chompy Hunting<br>Kills: <col=d0c0b0>300</col><br>Rank: <col=d0c0b0>Ogre Forester</col>" +
"<br><br>Order of the White Knights<br>Rank: <col=d0c0b0>Unrated</col><br>with a kill score of <col=d0c0b0>99</col>" +
"<br><br>TzHaar Fight Cave<br>Fastest run: <col=d0c0b0>65:12</col>" +
"<br><br>Inferno<br>Fastest run: <col=d0c0b0>-</col><br><br>Zulrah<br>" +
"Fastest kill: <col=d0c0b0>2:55</col><br><br>Vorkath<br>Fastest kill: <col=d0c0b0>1:37</col>" +
"<br><br>Galvek<br>Fastest kill: <col=d0c0b0>-</col><br><br>Grotesque Guardians<br>" +
"Fastest kill: <col=d0c0b0>-</col><br><br>Alchemical Hydra<br>Fastest kill: <col=d0c0b0>-</col>" +
"<br><br>Hespori<br>Fastest kill: <col=d0c0b0>1:42</col><br><br>Nightmare<br>" +
"Fastest kill: <col=d0c0b0>-</col><br><br>The Gauntlet<br>Fastest run: <col=d0c0b0>-</col>" +
"<br><br>The Corrupted Gauntlet<br>Fastest run: <col=d0c0b0>-</col><br><br>Fragment of Seren<br>Fastest kill: <col=d0c0b0>-</col>" +
"<br><br>Chambers of Xeric<br>Fastest run - (Team size: Solo): <col=d0c0b0>21:23</col><br>Fastest run - (Team size: 3 players): <col=d0c0b0>27:16</col>" +
"<br><br>Chambers of Xeric - Challenge mode<br>Fastest run - (Team size: Solo): <col=d0c0b0>34:30</col><br>Fastest run - (Team size: 4 players): <col=d0c0b0>21:26</col>" +
"<br><br>Barbarian Assault<br>High-level gambles: <col=d0c0b0>0</col><br><br>Fremennik spirits rested: <col=d0c0b0>0</col>";
Widget countersPage = mock(Widget.class);
when(countersPage.getText()).thenReturn(COUNTER_TEXT);
when(client.getWidget(WidgetInfo.GENERIC_SCROLL_TEXT)).thenReturn(countersPage);
WidgetLoaded countersLogEvent = new WidgetLoaded();
countersLogEvent.setGroupId(GENERIC_SCROLL_GROUP_ID);
chatCommandsPlugin.onWidgetLoaded(countersLogEvent);
chatCommandsPlugin.onGameTick(new GameTick());
verify(configManager).setRSProfileConfiguration("personalbest", "tztok-jad", 65 * 60 + 12);
verify(configManager).setRSProfileConfiguration("personalbest", "zulrah", 2 * 60 + 55);
verify(configManager).setRSProfileConfiguration("personalbest", "vorkath", 1 * 60 + 37);
verify(configManager).setRSProfileConfiguration("personalbest", "hespori", 1 * 60 + 42);
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 21 * 60 + 23);
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric challenge mode", 21 * 60 + 26);
}
@Test
public void testNotYourAdventureLogCountersPage()
{
Widget advLogWidget = mock(Widget.class);
Widget advLogExploitsTextWidget = mock(Widget.class);
when(advLogWidget.getChild(ChatCommandsPlugin.ADV_LOG_EXPLOITS_TEXT_INDEX)).thenReturn(advLogExploitsTextWidget);
when(advLogExploitsTextWidget.getText()).thenReturn("The Exploits of " + "not the player");
when(client.getWidget(WidgetInfo.ADVENTURE_LOG)).thenReturn(advLogWidget);
WidgetLoaded advLogEvent = new WidgetLoaded();
advLogEvent.setGroupId(ADVENTURE_LOG_ID);
chatCommandsPlugin.onWidgetLoaded(advLogEvent);
chatCommandsPlugin.onGameTick(new GameTick());
WidgetLoaded countersLogEvent = new WidgetLoaded();
countersLogEvent.setGroupId(GENERIC_SCROLL_GROUP_ID);
chatCommandsPlugin.onWidgetLoaded(countersLogEvent);
chatCommandsPlugin.onGameTick(new GameTick());
verifyNoMoreInteractions(configManager);
}
@Test
public void testPlayerSkillLookup() throws IOException
{
when(chatCommandsConfig.lvl()).thenReturn(true);
SingleHiscoreSkillResult skillResult = new SingleHiscoreSkillResult();
skillResult.setPlayer(PLAYER_NAME);
skillResult.setSkill(new Skill(10, 1000, -1));
when(hiscoreClient.lookup(PLAYER_NAME, HiscoreSkill.ZULRAH, null)).thenReturn(skillResult);
MessageNode messageNode = mock(MessageNode.class);
ChatMessage chatMessage = new ChatMessage();
chatMessage.setType(ChatMessageType.PUBLICCHAT);
chatMessage.setName(PLAYER_NAME);
chatMessage.setMessageNode(messageNode);
chatCommandsPlugin.playerSkillLookup(chatMessage, "!lvl zulrah");
verify(messageNode).setRuneLiteFormatMessage("<colNORMAL>Level <colHIGHLIGHT>Zulrah: 1000<colNORMAL> Rank: <colHIGHLIGHT>10");
}
@Test
public void testHsFloorNoPb()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 1 time: <col=ff0000>1:19</col>. Personal best: 0:28", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 1", 28);
}
@Test
public void testHsFloorPb()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 2 time: <col=ff0000>0:47</col> (new personal best)", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 2", 47);
}
@Test
public void testHsOverallPb_Pb()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 5 time: <col=ff0000>4:46</col> (new personal best)<br>Overall time: <col=ff0000>9:53</col> (new personal best)<br>", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 4 * 60 + 46);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 9 * 60 + 53);
}
@Test
public void testHsOverallPb_NoPb()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 5 time: <col=ff0000>3:26</col> (new personal best)<br>Overall time: <col=ff0000>9:17</col>. Personal best: 9:15<br>", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 3 * 60 + 26);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 9 * 60 + 15);
}
@Test
public void testHsOverallNoPb_NoPb()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 5 time: <col=ff0000>3:56</col>. Personal best: 3:05<br>Overall time: <col=ff0000>9:14</col>. Personal best: 7:49<br>", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 3 * 60 + 5);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 7 * 60 + 49);
}
@Test
public void testHsOverallNoPb_Pb()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 5 time: <col=ff0000>3:10</col>. Personal best: 3:04<br>Overall time: <col=ff0000>7:47</col> (new personal best)<br>", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 3 * 60 + 4);
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 7 * 60 + 47);
}
@Test
public void testHsFloorKc()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "You have completed Floor 5 of the Hallowed Sepulchre! Total completions: <col=ff0000>81</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("killcount", "hallowed sepulchre floor 5", 81);
}
@Test
public void testHsGhcKc()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "You have opened the Grand Hallowed Coffin <col=ff0000>36</col> times!", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("killcount", "hallowed sepulchre", 36);
}
@Test
public void testJadNewPbWithLeagueTask()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your TzTok-Jad kill count is: <col=ff0000>2</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Congratulations, you've completed a master task: <col=7f3700>Complete the Fight Caves in 25:00</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Duration: <col=ff0000>21:58</col> (new personal best)", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration("personalbest", "tztok-jad", 21 * 60 + 58);
verify(configManager).setRSProfileConfiguration("killcount", "tztok-jad", 2);
}
}
@@ -0,0 +1,424 @@
/*
* Copyright (c) 2019, Adam <Adam@sigterm.info>
* Copyright (c) 2019, osrs-music-map <osrs-music-map@users.noreply.github.com>
* 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.chatfilter;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import javax.inject.Inject;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.IterableHashTable;
import net.runelite.api.MessageNode;
import net.runelite.api.Player;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.client.game.FriendChatManager;
import static net.runelite.client.plugins.chatfilter.ChatFilterPlugin.CENSOR_MESSAGE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class ChatFilterPluginTest
{
@Mock
@Bind
private Client client;
@Mock
@Bind
private ChatFilterConfig chatFilterConfig;
@Mock
@Bind
private FriendChatManager friendChatManager;
@Mock
private Player localPlayer;
@Inject
private ChatFilterPlugin chatFilterPlugin;
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_WORDS);
when(chatFilterConfig.filteredWords()).thenReturn("");
when(chatFilterConfig.filteredRegex()).thenReturn("");
when(chatFilterConfig.filteredNames()).thenReturn("");
when(client.getLocalPlayer()).thenReturn(localPlayer);
}
private ScriptCallbackEvent createCallbackEvent(final String sender, final String chatMessage, final ChatMessageType messageType)
{
ScriptCallbackEvent event = new ScriptCallbackEvent();
event.setScript(null);
event.setEventName("chatFilterCheck");
int[] simulatedIntStack =
new int[]{1, messageType.getType(), 1}; // is msg allowed to show, ChatMessageType.PUBLICCHAT, message id
String[] simulatedStringStack = new String[]{chatMessage};
IterableHashTable<MessageNode> messageTable = mock(IterableHashTable.class);
MessageNode mockedMsgNode = mockMessageNode(sender);
when(client.getIntStack()).thenReturn(simulatedIntStack);
when(client.getIntStackSize()).thenReturn(simulatedIntStack.length);
when(client.getStringStack()).thenReturn(simulatedStringStack);
when(client.getStringStackSize()).thenReturn(simulatedStringStack.length);
when(client.getMessages()).thenReturn(messageTable);
when(messageTable.get(1)).thenReturn(mockedMsgNode);
return event;
}
private MessageNode mockMessageNode(String sender)
{
MessageNode node = mock(MessageNode.class);
when(node.getName()).thenReturn(sender);
return node;
}
private MessageNode mockMessageNode(int id)
{
MessageNode node = mock(MessageNode.class);
when(node.getId()).thenReturn(id);
return node;
}
private MessageNode mockMessageNode(int id, String sender, String value)
{
MessageNode node = mock(MessageNode.class);
when(node.getId()).thenReturn(id);
when(node.getName()).thenReturn(sender);
when(node.getValue()).thenReturn(value);
return node;
}
@Test
public void testCensorWords()
{
when(chatFilterConfig.filteredWords()).thenReturn("hat");
chatFilterPlugin.updateFilteredPatterns();
assertEquals("w***s up", chatFilterPlugin.censorMessage("Blue", "whats up"));
}
@Test
public void testCensorRegex()
{
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.REMOVE_MESSAGE);
when(chatFilterConfig.filteredRegex()).thenReturn("5[0-9]x2\n(");
chatFilterPlugin.updateFilteredPatterns();
assertNull(chatFilterPlugin.censorMessage("Blue", "55X2 Dicing | Trusted Ranks | Huge Pay Outs!"));
}
@Test
public void testBrokenRegex()
{
when(chatFilterConfig.filteredRegex()).thenReturn("Test\n)\n73");
chatFilterPlugin.updateFilteredPatterns();
assertEquals("** isn't funny", chatFilterPlugin.censorMessage("Blue", "73 isn't funny"));
}
@Test
public void testCaseSensitivity()
{
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_MESSAGE);
when(chatFilterConfig.filteredWords()).thenReturn("ReGeX!!!");
chatFilterPlugin.updateFilteredPatterns();
assertEquals(CENSOR_MESSAGE, chatFilterPlugin.censorMessage("Blue", "I love regex!!!!!!!!"));
}
@Test
public void testNonPrintableCharacters()
{
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.REMOVE_MESSAGE);
when(chatFilterConfig.filteredWords()).thenReturn("test");
chatFilterPlugin.updateFilteredPatterns();
assertNull(chatFilterPlugin.censorMessage("Blue", "te\u008Cst"));
}
@Test
public void testReplayedMessage()
{
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.REMOVE_MESSAGE);
when(chatFilterConfig.filteredWords()).thenReturn("hello osrs");
chatFilterPlugin.updateFilteredPatterns();
assertNull(chatFilterPlugin.censorMessage("Blue", "hello\u00A0osrs"));
}
@Test
public void testMessageFromFriendIsFiltered()
{
when(friendChatManager.isMember("Iron Mammal")).thenReturn(false);
when(chatFilterConfig.filterFriends()).thenReturn(true);
assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("Iron Mammal"));
}
@Test
public void testMessageFromFriendIsNotFiltered()
{
when(client.isFriended("Iron Mammal", false)).thenReturn(true);
when(chatFilterConfig.filterFriends()).thenReturn(false);
assertFalse(chatFilterPlugin.shouldFilterPlayerMessage("Iron Mammal"));
}
@Test
public void testMessageFromFriendsChatIsFiltered()
{
when(client.isFriended("B0aty", false)).thenReturn(false);
when(chatFilterConfig.filterFriendsChat()).thenReturn(true);
assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("B0aty"));
}
@Test
public void testMessageFromFriendsChatIsNotFiltered()
{
when(friendChatManager.isMember("B0aty")).thenReturn(true);
when(chatFilterConfig.filterFriendsChat()).thenReturn(false);
assertFalse(chatFilterPlugin.shouldFilterPlayerMessage("B0aty"));
}
@Test
public void testMessageFromSelfIsNotFiltered()
{
when(localPlayer.getName()).thenReturn("Swampletics");
assertFalse(chatFilterPlugin.shouldFilterPlayerMessage("Swampletics"));
}
@Test
public void testMessageFromNonFriendNonFCIsFiltered()
{
when(client.isFriended("Woox", false)).thenReturn(false);
when(friendChatManager.isMember("Woox")).thenReturn(false);
assertTrue(chatFilterPlugin.shouldFilterPlayerMessage("Woox"));
}
@Test
public void testShouldFilterByName()
{
when(chatFilterConfig.filteredNames()).thenReturn("Gamble [0-9]*");
chatFilterPlugin.updateFilteredPatterns();
assertTrue(chatFilterPlugin.shouldFilterByName("Gamble 1234"));
assertFalse(chatFilterPlugin.shouldFilterByName("Adam"));
}
@Test
public void testCensorWordsByName()
{
when(chatFilterConfig.filteredNames()).thenReturn("Blue");
chatFilterPlugin.updateFilteredPatterns();
assertEquals("************", chatFilterPlugin.censorMessage("Blue", "Gamble today"));
}
@Test
public void textCensorMessageByName()
{
when(chatFilterConfig.filteredNames()).thenReturn("Blue");
chatFilterPlugin.updateFilteredPatterns();
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_MESSAGE);
assertEquals(CENSOR_MESSAGE,
chatFilterPlugin.censorMessage("Blue", "Meet swampletics, my morytania locked ultimate ironman"));
}
@Test
public void testRemoveMessageByName()
{
when(chatFilterConfig.filteredNames()).thenReturn("Blue");
chatFilterPlugin.updateFilteredPatterns();
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.REMOVE_MESSAGE);
assertNull(
chatFilterPlugin.censorMessage("Blue", "What about now it's time to rock with the biggity buck bumble"));
}
@Test
public void testEventRemoveByName()
{
when(chatFilterConfig.filteredNames()).thenReturn("Gamble [0-9]*");
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.REMOVE_MESSAGE);
chatFilterPlugin.updateFilteredPatterns();
ScriptCallbackEvent event = createCallbackEvent("Gamble 1234", "filterme", ChatMessageType.PUBLICCHAT);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(0, client.getIntStack()[client.getIntStackSize() - 3]);
}
@Test
public void testEventRemoveByText()
{
when(chatFilterConfig.filteredWords()).thenReturn("filterme");
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.REMOVE_MESSAGE);
chatFilterPlugin.updateFilteredPatterns();
ScriptCallbackEvent event = createCallbackEvent("Adam", "please filterme plugin", ChatMessageType.PUBLICCHAT);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(0, client.getIntStack()[client.getIntStackSize() - 3]);
}
@Test
public void testEventCensorWordsByName()
{
when(chatFilterConfig.filteredNames()).thenReturn("Gamble [0-9]*");
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_WORDS);
chatFilterPlugin.updateFilteredPatterns();
ScriptCallbackEvent event = createCallbackEvent("Gamble 1234", "filterme", ChatMessageType.PUBLICCHAT);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals("********", client.getStringStack()[client.getStringStackSize() - 1]);
}
@Test
public void testEventCensorWordsByText()
{
when(chatFilterConfig.filteredWords()).thenReturn("filterme");
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_WORDS);
chatFilterPlugin.updateFilteredPatterns();
ScriptCallbackEvent event = createCallbackEvent("Adam", "please filterme plugin", ChatMessageType.PUBLICCHAT);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals("please ******** plugin", client.getStringStack()[client.getStringStackSize() - 1]);
}
@Test
public void testEventCensorMessageByName()
{
when(chatFilterConfig.filteredNames()).thenReturn("Gamble [0-9]*");
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_MESSAGE);
chatFilterPlugin.updateFilteredPatterns();
ScriptCallbackEvent event = createCallbackEvent("Gamble 1234", "filterme", ChatMessageType.PUBLICCHAT);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(CENSOR_MESSAGE, client.getStringStack()[client.getStringStackSize() - 1]);
}
@Test
public void testEventCensorMessageByText()
{
when(chatFilterConfig.filteredWords()).thenReturn("filterme");
when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.CENSOR_MESSAGE);
chatFilterPlugin.updateFilteredPatterns();
ScriptCallbackEvent event = createCallbackEvent("Adam", "please filterme plugin", ChatMessageType.PUBLICCHAT);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(CENSOR_MESSAGE, client.getStringStack()[client.getStringStackSize() - 1]);
}
@Test
public void testDuplicateChatFiltered()
{
when(chatFilterConfig.collapseGameChat()).thenReturn(true);
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(0, null, "testMessage"), ChatMessageType.GAMEMESSAGE, null, null, null, 0));
ScriptCallbackEvent event = createCallbackEvent(null, "testMessage", ChatMessageType.GAMEMESSAGE);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(0, client.getIntStack()[client.getIntStackSize() - 3]);
}
@Test
public void testNoDuplicate()
{
when(chatFilterConfig.collapseGameChat()).thenReturn(true);
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(1), ChatMessageType.GAMEMESSAGE, null, "testMessage", null, 0));
ScriptCallbackEvent event = createCallbackEvent(null, "testMessage", ChatMessageType.GAMEMESSAGE);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(1, client.getIntStack()[client.getIntStackSize() - 3]);
assertEquals("testMessage", client.getStringStack()[client.getStringStackSize() - 1]);
}
@Test
public void testDuplicateChatCount()
{
when(chatFilterConfig.collapseGameChat()).thenReturn(true);
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(4, null, "testMessage"), ChatMessageType.GAMEMESSAGE, null, null, null, 0));
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(3, null, "testMessage"), ChatMessageType.GAMEMESSAGE, null, null, null, 0));
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(2, null, "testMessage"), ChatMessageType.GAMEMESSAGE, null, null, null, 0));
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(1, null, "testMessage"), ChatMessageType.GAMEMESSAGE, null, null, null, 0));
ScriptCallbackEvent event = createCallbackEvent(null, "testMessage", ChatMessageType.GAMEMESSAGE);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(1, client.getIntStack()[client.getIntStackSize() - 3]);
assertEquals("testMessage (4)", client.getStringStack()[client.getStringStackSize() - 1]);
}
@Test
public void publicChatFilteredOnDuplicate()
{
when(chatFilterConfig.collapsePlayerChat()).thenReturn(true);
when(chatFilterConfig.maxRepeatedPublicChats()).thenReturn(2);
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(1, "testName", "testMessage"), ChatMessageType.PUBLICCHAT, null, null, null, 0));
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(1, "testName", "testMessage"), ChatMessageType.PUBLICCHAT, null, null, null, 0));
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(1, "testName", "testMessage"), ChatMessageType.PUBLICCHAT, null, null, null, 0));
ScriptCallbackEvent event = createCallbackEvent("testName", "testMessage", ChatMessageType.PUBLICCHAT);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(0, client.getIntStack()[client.getIntStackSize() - 3]);
}
@Test
public void testDuplicateChatFilterIgnoresFormatting()
{
when(chatFilterConfig.collapseGameChat()).thenReturn(true);
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(4, null, "<col=000000>testMessage</col>"), ChatMessageType.GAMEMESSAGE, null, null, null, 0));
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(3, null, "<col=000000>testMessage</col>"), ChatMessageType.GAMEMESSAGE, null, null, null, 0));
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(2, null, "<col=000000>testMessage</col>"), ChatMessageType.GAMEMESSAGE, null, null, null, 0));
chatFilterPlugin.onChatMessage(new ChatMessage(mockMessageNode(1, null, "<col=000000>testMessage</col>"), ChatMessageType.GAMEMESSAGE, null, null, null, 0));
ScriptCallbackEvent event = createCallbackEvent(null, "<col=000000>testMessage</col>", ChatMessageType.GAMEMESSAGE);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(1, client.getIntStack()[client.getIntStackSize() - 3]);
assertEquals("<col=000000>testMessage</col> (4)", client.getStringStack()[client.getStringStackSize() - 1]);
}
@Test
public void testChatIcons()
{
when(chatFilterConfig.filteredWords()).thenReturn("test");
// if this test is broken, this stubbing is required to trip the assert
lenient().when(chatFilterConfig.filterType()).thenReturn(ChatFilterType.REMOVE_MESSAGE);
when(friendChatManager.isMember("Lazark")).thenReturn(true);
chatFilterPlugin.updateFilteredPatterns();
ScriptCallbackEvent event = createCallbackEvent("<img=22>Lazark", "test", ChatMessageType.PUBLICCHAT);
chatFilterPlugin.onScriptCallbackEvent(event);
assertEquals(1, client.getIntStack()[client.getIntStackSize() - 3]); // not filtered
}
}
@@ -0,0 +1,289 @@
/*
* Copyright (c) 2018, 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.chatnotifications;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.util.Iterator;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Named;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.MessageNode;
import net.runelite.api.Player;
import net.runelite.api.events.ChatMessage;
import net.runelite.client.Notifier;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.util.Text;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class ChatNotificationsPluginTest
{
@Mock
@Bind
private Client client;
@Mock
@Bind
private ChatNotificationsConfig config;
@Mock
@Bind
private ChatMessageManager chatMessageManager;
@Mock
@Bind
private Notifier notifier;
@Bind
@Named("runelite.title")
private String runeliteTitle = "RuneLite";
@Inject
private ChatNotificationsPlugin chatNotificationsPlugin;
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
}
@Test
public void onChatMessage()
{
when(config.highlightWordsString()).thenReturn("Deathbeam, Deathbeam OSRS , test");
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn("Deathbeam, Deathbeam OSRS");
ChatMessage chatMessage = new ChatMessage();
chatMessage.setType(ChatMessageType.PUBLICCHAT);
chatMessage.setMessageNode(messageNode);
chatNotificationsPlugin.startUp(); // load highlight config
chatNotificationsPlugin.onChatMessage(chatMessage);
verify(messageNode).setValue("<colHIGHLIGHT>Deathbeam<colNORMAL>, <colHIGHLIGHT>Deathbeam<colNORMAL> OSRS");
}
@Test
public void testLtGt()
{
when(config.highlightWordsString()).thenReturn("<test>");
String message = "test <lt>test<gt> test";
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn(message);
ChatMessage chatMessage = new ChatMessage();
chatMessage.setType(ChatMessageType.PUBLICCHAT);
chatMessage.setMessageNode(messageNode);
chatNotificationsPlugin.startUp(); // load highlight config
chatNotificationsPlugin.onChatMessage(chatMessage);
verify(messageNode).setValue("test <colHIGHLIGHT><lt>test<gt><colNORMAL> test");
}
@Test
public void testMatchEntireMessage()
{
when(config.highlightWordsString()).thenReturn(".Your divine potion effect is about to expire.");
String message = ".Your divine potion effect is about to expire.";
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn(message);
ChatMessage chatMessage = new ChatMessage();
chatMessage.setType(ChatMessageType.PUBLICCHAT);
chatMessage.setMessageNode(messageNode);
chatNotificationsPlugin.startUp(); // load highlight config
chatNotificationsPlugin.onChatMessage(chatMessage);
verify(messageNode).setValue("<colHIGHLIGHT>.Your divine potion effect is about to expire.<colNORMAL>");
}
@Test
public void testFullStop()
{
when(config.highlightWordsString()).thenReturn("test");
String message = "foo test. bar";
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn(message);
ChatMessage chatMessage = new ChatMessage();
chatMessage.setType(ChatMessageType.PUBLICCHAT);
chatMessage.setMessageNode(messageNode);
chatNotificationsPlugin.startUp(); // load highlight config
chatNotificationsPlugin.onChatMessage(chatMessage);
verify(messageNode).setValue("foo <colHIGHLIGHT>test<colNORMAL>. bar");
}
@Test
public void testColor()
{
when(config.highlightWordsString()).thenReturn("you. It");
String message = "Your dodgy necklace protects you. <col=ff0000>It has 1 charge left.</col>";
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn(message);
ChatMessage chatMessage = new ChatMessage();
chatMessage.setType(ChatMessageType.PUBLICCHAT);
chatMessage.setMessageNode(messageNode);
chatNotificationsPlugin.startUp(); // load highlight config
chatNotificationsPlugin.onChatMessage(chatMessage);
verify(messageNode).setValue("Your dodgy necklace protects <colHIGHLIGHT>you. It<col=ff0000> has 1 charge left.</col>");
}
@Test
public void testPreceedingColor()
{
when(config.highlightWordsString()).thenReturn("you. It");
String message = "Your dodgy <col=00ff00>necklace protects you. It has 1 charge left.</col>";
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn(message);
ChatMessage chatMessage = new ChatMessage();
chatMessage.setType(ChatMessageType.PUBLICCHAT);
chatMessage.setMessageNode(messageNode);
chatNotificationsPlugin.startUp(); // load highlight config
chatNotificationsPlugin.onChatMessage(chatMessage);
verify(messageNode).setValue("Your dodgy <col=00ff00>necklace protects <colHIGHLIGHT>you. It<col=00ff00> has 1 charge left.</col>");
}
@Test
public void testEmoji()
{
when(config.highlightWordsString()).thenReturn("test");
String message = "emoji test <img=29>";
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn(message);
ChatMessage chatMessage = new ChatMessage();
chatMessage.setType(ChatMessageType.PUBLICCHAT);
chatMessage.setMessageNode(messageNode);
chatNotificationsPlugin.startUp(); // load highlight config
chatNotificationsPlugin.onChatMessage(chatMessage);
verify(messageNode).setValue("emoji <colHIGHLIGHT>test<colNORMAL> <img=29>");
}
@Test
public void testNonMatchedColors()
{
when(config.highlightWordsString()).thenReturn("test");
String message = "<col=ff0000>color</col> test <img=29>";
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn(message);
ChatMessage chatMessage = new ChatMessage();
chatMessage.setType(ChatMessageType.PUBLICCHAT);
chatMessage.setMessageNode(messageNode);
chatNotificationsPlugin.startUp(); // load highlight config
chatNotificationsPlugin.onChatMessage(chatMessage);
verify(messageNode).setValue("<col=ff0000>color</col> <colHIGHLIGHT>test<colNORMAL> <img=29>");
}
@Test
public void highlightListTest()
{
when(config.highlightWordsString()).thenReturn("this,is, a , test, ");
final List<String> higlights = Text.fromCSV(config.highlightWordsString());
assertEquals(4, higlights.size());
final Iterator<String> iterator = higlights.iterator();
assertEquals("this", iterator.next());
assertEquals("is", iterator.next());
assertEquals("a", iterator.next());
assertEquals("test", iterator.next());
}
@Test
public void testStripColor()
{
assertEquals("you. It", ChatNotificationsPlugin.stripColor("you. <col=ff0000>It"));
}
@Test
public void testHighlightOwnName()
{
Player player = mock(Player.class);
when(player.getName()).thenReturn("Logic Knot");
when(client.getLocalPlayer()).thenReturn(player);
when(config.highlightOwnName()).thenReturn(true);
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn("<col=005f00>Logic Knot received a drop: Adamant longsword</col>");
ChatMessage chatMessage = new ChatMessage(messageNode, ChatMessageType.GAMEMESSAGE, "", "", "", 0);
chatNotificationsPlugin.onChatMessage(chatMessage);
verify(messageNode).setValue("<col=005f00><colHIGHLIGHT><u>Logic Knot</u><colNORMAL> received a drop: Adamant longsword</col>");
}
@Test
public void testHighlightOwnNameNbsp()
{
Player player = mock(Player.class);
when(player.getName()).thenReturn("Logic Knot");
when(client.getLocalPlayer()).thenReturn(player);
when(config.highlightOwnName()).thenReturn(true);
MessageNode messageNode = mock(MessageNode.class);
when(messageNode.getValue()).thenReturn("<col=005f00>Logic\u00a0Knot received a drop: Adamant longsword</col>");
ChatMessage chatMessage = new ChatMessage(messageNode, ChatMessageType.GAMEMESSAGE, "", "", "", 0);
chatNotificationsPlugin.onChatMessage(chatMessage);
// set value uses our player name, which has nbsp replaced
verify(messageNode).setValue("<col=005f00><colHIGHLIGHT><u>Logic Knot</u><colNORMAL> received a drop: Adamant longsword</col>");
}
}
@@ -0,0 +1,139 @@
/*
* Copyright (c) 2018, 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.discord;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.UUID;
import javax.inject.Inject;
import javax.inject.Named;
import net.runelite.api.Client;
import net.runelite.client.discord.DiscordPresence;
import net.runelite.client.discord.DiscordService;
import net.runelite.client.ws.PartyService;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import static org.mockito.ArgumentMatchers.any;
import org.mockito.Mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class DiscordStateTest
{
@Inject
DiscordState discordState;
@Mock
@Bind
DiscordConfig discordConfig;
@Mock
@Bind
DiscordService discordService;
@Mock
@Bind
Client client;
@Mock
@Bind
PartyService partyService;
@Bind
@Named("runelite.title")
private String runeliteTitle = "RuneLite";
@Bind
@Named("runelite.version")
private String runeliteVersion = "version";
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
when(partyService.getLocalPartyId()).thenReturn(UUID.nameUUIDFromBytes("test".getBytes(StandardCharsets.UTF_8)));
}
@Test
public void testStatusReset()
{
when(discordConfig.actionTimeout()).thenReturn(-1);
when(discordConfig.elapsedTimeType()).thenReturn(DiscordConfig.ElapsedTimeType.ACTIVITY);
discordState.triggerEvent(DiscordGameEventType.IN_MENU);
verify(discordService).updatePresence(any(DiscordPresence.class));
discordState.checkForTimeout();
ArgumentCaptor<DiscordPresence> captor = ArgumentCaptor.forClass(DiscordPresence.class);
verify(discordService, times(2)).updatePresence(captor.capture());
List<DiscordPresence> captured = captor.getAllValues();
assertNull(captured.get(captured.size() - 1).getEndTimestamp());
}
@Test
public void testStatusTimeout()
{
when(discordConfig.actionTimeout()).thenReturn(-1);
when(discordConfig.elapsedTimeType()).thenReturn(DiscordConfig.ElapsedTimeType.ACTIVITY);
discordState.triggerEvent(DiscordGameEventType.TRAINING_AGILITY);
verify(discordService).updatePresence(any(DiscordPresence.class));
discordState.checkForTimeout();
verify(discordService, times(1)).clearPresence();
}
@Test
public void testAreaChange()
{
when(discordConfig.elapsedTimeType()).thenReturn(DiscordConfig.ElapsedTimeType.TOTAL);
// Start with state of IN_GAME
ArgumentCaptor<DiscordPresence> captor = ArgumentCaptor.forClass(DiscordPresence.class);
discordState.triggerEvent(DiscordGameEventType.IN_GAME);
verify(discordService, times(1)).updatePresence(captor.capture());
assertEquals(DiscordGameEventType.IN_GAME.getState(), captor.getValue().getState());
// IN_GAME -> CITY
discordState.triggerEvent(DiscordGameEventType.CITY_VARROCK);
verify(discordService, times(2)).updatePresence(captor.capture());
assertEquals(DiscordGameEventType.CITY_VARROCK.getState(), captor.getValue().getState());
// CITY -> IN_GAME
discordState.triggerEvent(DiscordGameEventType.IN_GAME);
verify(discordService, times(3)).updatePresence(captor.capture());
assertEquals(DiscordGameEventType.IN_GAME.getState(), captor.getValue().getState());
}
}
@@ -0,0 +1,332 @@
/*
* Copyright (c) 2020, 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.grandexchange;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.GrandExchangeOffer;
import net.runelite.api.GrandExchangeOfferState;
import net.runelite.api.ItemComposition;
import net.runelite.api.ItemID;
import net.runelite.api.WorldType;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GrandExchangeOfferChanged;
import net.runelite.client.Notifier;
import net.runelite.client.account.SessionManager;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.config.RuneLiteConfig;
import net.runelite.client.game.ItemManager;
import net.runelite.client.input.KeyManager;
import net.runelite.client.input.MouseManager;
import static net.runelite.client.plugins.grandexchange.GrandExchangePlugin.findFuzzyIndices;
import static net.runelite.http.api.RuneLiteAPI.GSON;
import net.runelite.http.api.ge.GrandExchangeClient;
import net.runelite.http.api.ge.GrandExchangeTrade;
import net.runelite.http.api.osbuddy.OSBGrandExchangeClient;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import org.mockito.Mock;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class GrandExchangePluginTest
{
@Inject
private GrandExchangePlugin grandExchangePlugin;
@Mock
@Bind
private GrandExchangeConfig grandExchangeConfig;
@Mock
@Bind
private Notifier notifier;
@Mock
@Bind
private SessionManager sessionManager;
@Mock
@Bind
private ConfigManager configManager;
@Mock
@Bind
private ItemManager itemManager;
@Mock
@Bind
private KeyManager keyManager;
@Mock
@Bind
private MouseManager mouseManager;
@Mock
@Bind
private ScheduledExecutorService scheduledExecutorService;
@Mock
@Bind
private GrandExchangeClient grandExchangeClient;
@Mock
@Bind
private OSBGrandExchangeClient osbGrandExchangeClient;
@Mock
@Bind
private Client client;
@Mock
@Bind
private RuneLiteConfig runeLiteConfig;
@Before
public void setUp()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
when(client.getWorldType()).thenReturn(EnumSet.noneOf(WorldType.class));
}
@Test
public void testFindFuzzyIndices()
{
List<Integer> fuzzyIndices = findFuzzyIndices("Ancestral robe bottom", "obby");
// r<u>ob</u>e <u>b</u>ottom
assertEquals(Arrays.asList(11, 12, 15), fuzzyIndices);
}
@Test
public void testSubmitTrade()
{
// 1 @ 25
SavedOffer savedOffer = new SavedOffer();
savedOffer.setItemId(ItemID.ABYSSAL_WHIP);
savedOffer.setQuantitySold(1);
savedOffer.setTotalQuantity(10);
savedOffer.setPrice(1000);
savedOffer.setSpent(25);
savedOffer.setState(GrandExchangeOfferState.BUYING);
when(configManager.getRSProfileConfiguration("geoffer", "0")).thenReturn(GSON.toJson(savedOffer));
// buy 2 @ 10/ea
GrandExchangeOffer grandExchangeOffer = mock(GrandExchangeOffer.class);
when(grandExchangeOffer.getQuantitySold()).thenReturn(1 + 2);
when(grandExchangeOffer.getItemId()).thenReturn(ItemID.ABYSSAL_WHIP);
when(grandExchangeOffer.getTotalQuantity()).thenReturn(10);
when(grandExchangeOffer.getPrice()).thenReturn(1000);
when(grandExchangeOffer.getSpent()).thenReturn(25 + 10 * 2);
when(grandExchangeOffer.getState()).thenReturn(GrandExchangeOfferState.BUYING);
grandExchangePlugin.submitTrade(0, grandExchangeOffer);
ArgumentCaptor<GrandExchangeTrade> captor = ArgumentCaptor.forClass(GrandExchangeTrade.class);
verify(grandExchangeClient).submit(captor.capture());
GrandExchangeTrade trade = captor.getValue();
assertTrue(trade.isBuy());
assertEquals(ItemID.ABYSSAL_WHIP, trade.getItemId());
assertEquals(2, trade.getDqty());
assertEquals(10, trade.getTotal());
assertEquals(45, trade.getSpent());
assertEquals(20, trade.getDspent());
}
@Test
public void testDuplicateTrade()
{
SavedOffer savedOffer = new SavedOffer();
savedOffer.setItemId(ItemID.ABYSSAL_WHIP);
savedOffer.setQuantitySold(1);
savedOffer.setTotalQuantity(10);
savedOffer.setPrice(1000);
savedOffer.setSpent(25);
savedOffer.setState(GrandExchangeOfferState.BUYING);
when(configManager.getRSProfileConfiguration("geoffer", "0")).thenReturn(GSON.toJson(savedOffer));
GrandExchangeOffer grandExchangeOffer = mock(GrandExchangeOffer.class);
when(grandExchangeOffer.getQuantitySold()).thenReturn(1);
when(grandExchangeOffer.getItemId()).thenReturn(ItemID.ABYSSAL_WHIP);
when(grandExchangeOffer.getTotalQuantity()).thenReturn(10);
when(grandExchangeOffer.getPrice()).thenReturn(1000);
lenient().when(grandExchangeOffer.getSpent()).thenReturn(25);
when(grandExchangeOffer.getState()).thenReturn(GrandExchangeOfferState.BUYING);
grandExchangePlugin.submitTrade(0, grandExchangeOffer);
verify(grandExchangeClient, never()).submit(any(GrandExchangeTrade.class));
}
@Test
public void testCancelTrade()
{
SavedOffer savedOffer = new SavedOffer();
savedOffer.setItemId(ItemID.ABYSSAL_WHIP);
savedOffer.setQuantitySold(1);
savedOffer.setTotalQuantity(10);
savedOffer.setPrice(1000);
savedOffer.setSpent(25);
savedOffer.setState(GrandExchangeOfferState.BUYING);
when(configManager.getRSProfileConfiguration("geoffer", "0")).thenReturn(GSON.toJson(savedOffer));
GrandExchangeOffer grandExchangeOffer = mock(GrandExchangeOffer.class);
when(grandExchangeOffer.getQuantitySold()).thenReturn(1);
when(grandExchangeOffer.getItemId()).thenReturn(ItemID.ABYSSAL_WHIP);
when(grandExchangeOffer.getTotalQuantity()).thenReturn(10);
when(grandExchangeOffer.getPrice()).thenReturn(1000);
when(grandExchangeOffer.getSpent()).thenReturn(25);
when(grandExchangeOffer.getState()).thenReturn(GrandExchangeOfferState.CANCELLED_BUY);
grandExchangePlugin.submitTrade(0, grandExchangeOffer);
ArgumentCaptor<GrandExchangeTrade> captor = ArgumentCaptor.forClass(GrandExchangeTrade.class);
verify(grandExchangeClient).submit(captor.capture());
GrandExchangeTrade trade = captor.getValue();
assertTrue(trade.isBuy());
assertTrue(trade.isCancel());
assertEquals(ItemID.ABYSSAL_WHIP, trade.getItemId());
assertEquals(1, trade.getQty());
assertEquals(10, trade.getTotal());
assertEquals(25, trade.getSpent());
}
@Test
public void testHop()
{
when(client.getGameState()).thenReturn(GameState.HOPPING);
GrandExchangeOffer grandExchangeOffer = mock(GrandExchangeOffer.class);
when(grandExchangeOffer.getState()).thenReturn(GrandExchangeOfferState.EMPTY);
GrandExchangeOfferChanged grandExchangeOfferChanged = new GrandExchangeOfferChanged();
grandExchangeOfferChanged.setOffer(grandExchangeOffer);
grandExchangePlugin.onGrandExchangeOfferChanged(grandExchangeOfferChanged);
verify(configManager, never()).unsetRSProfileConfiguration(anyString(), anyString());
}
@Test
public void testLogin()
{
GrandExchangePanel panel = mock(GrandExchangePanel.class);
when(panel.getOffersPanel()).thenReturn(mock(GrandExchangeOffersPanel.class));
grandExchangePlugin.setPanel(panel);
when(itemManager.getItemComposition(anyInt())).thenReturn(mock(ItemComposition.class));
// provide config support so getOffer and setOffer work
final Map<String, Object> config = new HashMap<>();
doAnswer(a ->
{
Object[] arguments = a.getArguments();
config.put((String) arguments[1], arguments[2]);
return null;
}).when(configManager).setRSProfileConfiguration(eq("geoffer"), anyString(), anyString());
when(configManager.getRSProfileConfiguration(eq("geoffer"), anyString())).thenAnswer(a ->
{
Object[] arguments = a.getArguments();
return config.get((String) arguments[1]);
});
// set loginBurstGeUpdates
GameStateChanged gameStateChanged = new GameStateChanged();
gameStateChanged.setGameState(GameState.LOGIN_SCREEN);
grandExchangePlugin.onGameStateChanged(gameStateChanged);
// 8x buy 10 whip @ 1k ea, bought 1 sofar.
for (int i = 0; i < GrandExchangePlugin.GE_SLOTS; ++i)
{
GrandExchangeOffer grandExchangeOffer = mock(GrandExchangeOffer.class);
when(grandExchangeOffer.getQuantitySold()).thenReturn(1);
when(grandExchangeOffer.getItemId()).thenReturn(ItemID.ABYSSAL_WHIP);
when(grandExchangeOffer.getTotalQuantity()).thenReturn(10);
when(grandExchangeOffer.getPrice()).thenReturn(1000);
when(grandExchangeOffer.getSpent()).thenReturn(1000);
when(grandExchangeOffer.getState()).thenReturn(GrandExchangeOfferState.SELLING);
GrandExchangeOfferChanged grandExchangeOfferChanged = new GrandExchangeOfferChanged();
grandExchangeOfferChanged.setSlot(i);
grandExchangeOfferChanged.setOffer(grandExchangeOffer);
grandExchangePlugin.onGrandExchangeOfferChanged(grandExchangeOfferChanged);
}
// Now send update for one of the slots
GrandExchangeOffer grandExchangeOffer = mock(GrandExchangeOffer.class);
when(grandExchangeOffer.getQuantitySold()).thenReturn(2);
when(grandExchangeOffer.getItemId()).thenReturn(ItemID.ABYSSAL_WHIP);
when(grandExchangeOffer.getTotalQuantity()).thenReturn(10);
when(grandExchangeOffer.getPrice()).thenReturn(1000);
when(grandExchangeOffer.getSpent()).thenReturn(2000);
when(grandExchangeOffer.getState()).thenReturn(GrandExchangeOfferState.SELLING);
GrandExchangeOfferChanged grandExchangeOfferChanged = new GrandExchangeOfferChanged();
grandExchangeOfferChanged.setSlot(2);
grandExchangeOfferChanged.setOffer(grandExchangeOffer);
grandExchangePlugin.onGrandExchangeOfferChanged(grandExchangeOfferChanged);
// verify trade update
ArgumentCaptor<GrandExchangeTrade> captor = ArgumentCaptor.forClass(GrandExchangeTrade.class);
verify(grandExchangeClient).submit(captor.capture());
GrandExchangeTrade trade = captor.getValue();
assertFalse(trade.isBuy());
assertEquals(ItemID.ABYSSAL_WHIP, trade.getItemId());
assertEquals(2, trade.getQty());
assertEquals(1, trade.getDqty());
assertEquals(10, trade.getTotal());
assertEquals(1000, trade.getDspent());
assertEquals(2000, trade.getSpent());
assertEquals(1000, trade.getOffer());
assertEquals(2, trade.getSlot());
assertTrue(trade.isLogin());
}
}
@@ -0,0 +1,318 @@
/*
* Copyright (c) 2018, 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.screenshot;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Consumer;
import javax.inject.Inject;
import static net.runelite.api.ChatMessageType.GAMEMESSAGE;
import net.runelite.api.Client;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.WidgetLoaded;
import net.runelite.api.widgets.Widget;
import static net.runelite.api.widgets.WidgetID.DIALOG_SPRITE_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.LEVEL_UP_GROUP_ID;
import static net.runelite.api.widgets.WidgetInfo.DIALOG_SPRITE_TEXT;
import static net.runelite.api.widgets.WidgetInfo.LEVEL_UP_LEVEL;
import net.runelite.client.Notifier;
import net.runelite.client.config.RuneLiteConfig;
import net.runelite.client.ui.ClientUI;
import net.runelite.client.ui.DrawManager;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
import net.runelite.client.util.ImageCapture;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import org.mockito.Mock;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class ScreenshotPluginTest
{
private static final String CLUE_SCROLL = "<col=3300ff>You have completed 28 medium Treasure Trails</col>";
private static final String BARROWS_CHEST = "Your Barrows chest count is <col=ff0000>310</col>";
private static final String CHAMBERS_OF_XERIC_CHEST = "Your completed Chambers of Xeric count is: <col=ff0000>489</col>.";
private static final String THEATRE_OF_BLOOD_CHEST = "Your completed Theatre of Blood count is: <col=ff0000>73</col>.";
private static final String VALUABLE_DROP = "<col=ef1020>Valuable drop: 6 x Bronze arrow (42 coins)</col>";
private static final String UNTRADEABLE_DROP = "<col=ef1020>Untradeable drop: Rusty sword";
private static final String BA_HIGH_GAMBLE_REWARD = "Raw shark (x 300)!<br>High level gamble count: <col=7f0000>100</col>";
private static final String HUNTER_LEVEL_2_TEXT = "<col=000080>Congratulations, you've just advanced a Hunter level.<col=000000><br><br>Your Hunter level is now 2.";
@Mock
@Bind
private Client client;
@Inject
private ScreenshotPlugin screenshotPlugin;
@Mock
@Bind
private ScreenshotConfig screenshotConfig;
@Mock
@Bind
Notifier notifier;
@Mock
@Bind
ClientUI clientUi;
@Mock
@Bind
DrawManager drawManager;
@Mock
@Bind
RuneLiteConfig config;
@Mock
@Bind
ScheduledExecutorService service;
@Mock
@Bind
private OverlayManager overlayManager;
@Mock
@Bind
private InfoBoxManager infoBoxManager;
@Mock
@Bind
private ImageCapture imageCapture;
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
when(screenshotConfig.screenshotLevels()).thenReturn(true);
when(screenshotConfig.screenshotValuableDrop()).thenReturn(true);
when(screenshotConfig.screenshotUntradeableDrop()).thenReturn(true);
}
@Test
public void testClueScroll()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "Seth", CLUE_SCROLL, null, 0);
screenshotPlugin.onChatMessage(chatMessageEvent);
assertEquals("medium", screenshotPlugin.getClueType());
assertEquals(28, screenshotPlugin.getClueNumber());
}
@Test
public void testBarrowsChest()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "Seth", BARROWS_CHEST, null, 0);
screenshotPlugin.onChatMessage(chatMessageEvent);
assertEquals(310, screenshotPlugin.getBarrowsNumber());
}
@Test
public void testChambersOfXericChest()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "Seth", CHAMBERS_OF_XERIC_CHEST, null, 0);
screenshotPlugin.onChatMessage(chatMessageEvent);
assertEquals(489, screenshotPlugin.getChambersOfXericNumber());
}
@Test
public void testTheatreOfBloodChest()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "Magic fTail", THEATRE_OF_BLOOD_CHEST, null, 0);
screenshotPlugin.onChatMessage(chatMessageEvent);
assertEquals(73, screenshotPlugin.gettheatreOfBloodNumber());
}
@Test
public void testValuableDrop()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", VALUABLE_DROP, null, 0);
screenshotPlugin.onChatMessage(chatMessageEvent);
verify(drawManager).requestNextFrameListener(any(Consumer.class));
}
@Test
public void testUntradeableDrop()
{
ChatMessage chatMessageEvent = new ChatMessage(null, GAMEMESSAGE, "", UNTRADEABLE_DROP, null, 0);
screenshotPlugin.onChatMessage(chatMessageEvent);
verify(drawManager).requestNextFrameListener(any(Consumer.class));
}
@Test
public void testHitpointsLevel99()
{
Widget levelChild = mock(Widget.class);
when(client.getWidget(eq(LEVEL_UP_LEVEL))).thenReturn(levelChild);
when(levelChild.getText()).thenReturn("Your Hitpoints are now 99.");
assertEquals("Hitpoints(99)", screenshotPlugin.parseLevelUpWidget(LEVEL_UP_LEVEL));
WidgetLoaded event = new WidgetLoaded();
event.setGroupId(LEVEL_UP_GROUP_ID);
screenshotPlugin.onWidgetLoaded(event);
GameTick tick = new GameTick();
screenshotPlugin.onGameTick(tick);
verify(drawManager).requestNextFrameListener(any(Consumer.class));
}
@Test
public void testFiremakingLevel9()
{
Widget levelChild = mock(Widget.class);
when(client.getWidget(eq(LEVEL_UP_LEVEL))).thenReturn(levelChild);
when(levelChild.getText()).thenReturn("Your Firemaking level is now 9.");
assertEquals("Firemaking(9)", screenshotPlugin.parseLevelUpWidget(LEVEL_UP_LEVEL));
WidgetLoaded event = new WidgetLoaded();
event.setGroupId(LEVEL_UP_GROUP_ID);
screenshotPlugin.onWidgetLoaded(event);
GameTick tick = new GameTick();
screenshotPlugin.onGameTick(tick);
verify(drawManager).requestNextFrameListener(any(Consumer.class));
}
@Test
public void testAttackLevel70()
{
Widget levelChild = mock(Widget.class);
when(client.getWidget(eq(LEVEL_UP_LEVEL))).thenReturn(levelChild);
when(levelChild.getText()).thenReturn("Your Attack level is now 70.");
assertEquals("Attack(70)", screenshotPlugin.parseLevelUpWidget(LEVEL_UP_LEVEL));
WidgetLoaded event = new WidgetLoaded();
event.setGroupId(LEVEL_UP_GROUP_ID);
screenshotPlugin.onWidgetLoaded(event);
GameTick tick = new GameTick();
screenshotPlugin.onGameTick(tick);
verify(drawManager).requestNextFrameListener(any(Consumer.class));
}
@Test
public void testHunterLevel2()
{
Widget levelChild = mock(Widget.class);
when(client.getWidget(eq(DIALOG_SPRITE_TEXT))).thenReturn(levelChild);
when(levelChild.getText()).thenReturn(HUNTER_LEVEL_2_TEXT);
assertEquals("Hunter(2)", screenshotPlugin.parseLevelUpWidget(DIALOG_SPRITE_TEXT));
WidgetLoaded event = new WidgetLoaded();
event.setGroupId(DIALOG_SPRITE_GROUP_ID);
screenshotPlugin.onWidgetLoaded(event);
GameTick tick = new GameTick();
screenshotPlugin.onGameTick(tick);
verify(drawManager).requestNextFrameListener(any(Consumer.class));
}
@Test
public void testQuestParsing()
{
assertEquals("Quest(The Corsair Curse)", ScreenshotPlugin.parseQuestCompletedWidget("You have completed The Corsair Curse!"));
assertEquals("Quest(One Small Favour)", ScreenshotPlugin.parseQuestCompletedWidget("'One Small Favour' completed!"));
assertEquals("Quest(Hazeel Cult partial completion)", ScreenshotPlugin.parseQuestCompletedWidget("You have... kind of... completed the Hazeel Cult Quest!"));
assertEquals("Quest(Rag and Bone Man II)", ScreenshotPlugin.parseQuestCompletedWidget("You have completely completed Rag and Bone Man!"));
assertEquals("Quest(Recipe for Disaster - Culinaromancer)", ScreenshotPlugin.parseQuestCompletedWidget("Congratulations! You have defeated the Culinaromancer!"));
assertEquals("Quest(Recipe for Disaster - Another Cook's Quest)", ScreenshotPlugin.parseQuestCompletedWidget("You have completed Another Cook's Quest!"));
assertEquals("Quest(Doric's Quest)", ScreenshotPlugin.parseQuestCompletedWidget("You have completed Doric's Quest!"));
assertEquals("Quest(quest not found)", ScreenshotPlugin.parseQuestCompletedWidget("Sins of the Father forgiven!"));
}
@Test
public void testBAHighGambleRewardParsing()
{
assertEquals("High Gamble(100)", ScreenshotPlugin.parseBAHighGambleWidget(BA_HIGH_GAMBLE_REWARD));
}
@Test
public void testLevelUpScreenshotsDisabled()
{
// Level up dialogs use the same widget interface as BA high gamble results
when(screenshotConfig.screenshotLevels()).thenReturn(false);
when(screenshotConfig.screenshotHighGamble()).thenReturn(true);
Widget dialogChild = mock(Widget.class);
when(dialogChild.getText()).thenReturn(HUNTER_LEVEL_2_TEXT);
when(client.getWidget(DIALOG_SPRITE_TEXT)).thenReturn(dialogChild);
WidgetLoaded event = new WidgetLoaded();
event.setGroupId(DIALOG_SPRITE_GROUP_ID);
screenshotPlugin.onWidgetLoaded(event);
screenshotPlugin.onGameTick(new GameTick());
verify(drawManager, times(0)).requestNextFrameListener(any(Consumer.class));
}
@Test
public void testBAHighGambleScreenshotsDisabled()
{
// BA high gamble results use the same widget interface as level up dialogs
when(screenshotConfig.screenshotLevels()).thenReturn(true);
when(screenshotConfig.screenshotHighGamble()).thenReturn(false);
Widget dialogChild = mock(Widget.class);
when(dialogChild.getText()).thenReturn(BA_HIGH_GAMBLE_REWARD);
when(client.getWidget(DIALOG_SPRITE_TEXT)).thenReturn(dialogChild);
WidgetLoaded event = new WidgetLoaded();
event.setGroupId(DIALOG_SPRITE_GROUP_ID);
screenshotPlugin.onWidgetLoaded(event);
screenshotPlugin.onGameTick(new GameTick());
verify(drawManager, times(0)).requestNextFrameListener(any(Consumer.class));
}
}
@@ -0,0 +1,297 @@
/*
* Copyright (c) 2020, 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.specialcounter;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.EquipmentInventorySlot;
import net.runelite.api.Hitsplat;
import net.runelite.api.InventoryID;
import net.runelite.api.Item;
import net.runelite.api.ItemContainer;
import net.runelite.api.ItemID;
import net.runelite.api.NPC;
import net.runelite.api.Player;
import net.runelite.api.VarPlayer;
import net.runelite.api.events.HitsplatApplied;
import net.runelite.api.events.InteractingChanged;
import net.runelite.api.events.VarbitChanged;
import net.runelite.client.Notifier;
import net.runelite.client.game.ItemManager;
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
import net.runelite.client.ws.PartyService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.mockito.ArgumentMatchers.any;
import org.mockito.Mock;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class SpecialCounterPluginTest
{
@Mock
@Bind
private Client client;
@Mock
@Bind
private InfoBoxManager infoBoxManager;
@Mock
@Bind
private PartyService partyService;
@Mock
@Bind
private ItemManager itemManager;
@Mock
@Bind
private Notifier notifier;
@Mock
@Bind
private SpecialCounterConfig specialCounterConfig;
@Inject
private SpecialCounterPlugin specialCounterPlugin;
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
// Set up spec weapon
ItemContainer equipment = mock(ItemContainer.class);
when(equipment.getItem(EquipmentInventorySlot.WEAPON.getSlotIdx())).thenReturn(new Item(ItemID.BANDOS_GODSWORD, 1));
when(client.getItemContainer(InventoryID.EQUIPMENT)).thenReturn(equipment);
// Set up special attack energy
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(100);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
}
private static HitsplatApplied hitsplat(Actor target, Hitsplat.HitsplatType type)
{
Hitsplat hitsplat = new Hitsplat(type, type == Hitsplat.HitsplatType.DAMAGE_ME ? 1 : 0, 42);
HitsplatApplied hitsplatApplied = new HitsplatApplied();
hitsplatApplied.setActor(target);
hitsplatApplied.setHitsplat(hitsplat);
return hitsplatApplied;
}
@Test
public void testSpecDamage()
{
NPC target = mock(NPC.class);
Player player = mock(Player.class);
when(client.getLocalPlayer()).thenReturn(player);
// spec npc
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(50);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
lenient().when(player.getInteracting()).thenReturn(target);
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, target));
// hit 1
specialCounterPlugin.onHitsplatApplied(hitsplat(target, Hitsplat.HitsplatType.DAMAGE_ME));
verify(infoBoxManager).addInfoBox(any(SpecialCounter.class));
}
@Test
public void testSpecBlock()
{
NPC target = mock(NPC.class);
Player player = mock(Player.class);
when(client.getLocalPlayer()).thenReturn(player);
// spec npc
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(50);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
lenient().when(player.getInteracting()).thenReturn(target);
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, target));
// block 0
specialCounterPlugin.onHitsplatApplied(hitsplat(target, Hitsplat.HitsplatType.BLOCK_ME));
// hit 1
specialCounterPlugin.onHitsplatApplied(hitsplat(target, Hitsplat.HitsplatType.DAMAGE_ME));
verify(infoBoxManager, never()).addInfoBox(any(SpecialCounter.class));
}
@Test
public void testUnaggro()
{
NPC target = mock(NPC.class);
Player player = mock(Player.class);
when(client.getLocalPlayer()).thenReturn(player);
// tick 1: attack npc
when(player.getInteracting()).thenReturn(target);
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, target));
// tick 2: spec fires and un-interact npc
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(50);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
lenient().when(player.getInteracting()).thenReturn(null);
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, null));
// tick 3: hit 1
specialCounterPlugin.onHitsplatApplied(hitsplat(target, Hitsplat.HitsplatType.DAMAGE_ME));
verify(infoBoxManager).addInfoBox(any(SpecialCounter.class));
}
@Test
public void testSameTick()
{
NPC targetA = mock(NPC.class);
NPC targetB = mock(NPC.class);
Player player = mock(Player.class);
when(client.getLocalPlayer()).thenReturn(player);
// tick 1: attack npc A
when(player.getInteracting()).thenReturn(targetA);
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, targetA));
// tick 2: spec npc B
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(50);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
lenient().when(player.getInteracting()).thenReturn(targetB);
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, targetB));
// tick 3: hitsplat A, hitsplat B
specialCounterPlugin.onHitsplatApplied(hitsplat(targetA, Hitsplat.HitsplatType.DAMAGE_ME));
verify(infoBoxManager, never()).addInfoBox(any(SpecialCounter.class));
specialCounterPlugin.onHitsplatApplied(hitsplat(targetB, Hitsplat.HitsplatType.DAMAGE_ME));
verify(infoBoxManager).addInfoBox(any(SpecialCounter.class));
}
@Test
public void testReset()
{
NPC targetA = mock(NPC.class);
NPC targetB = mock(NPC.class);
when(targetB.getId()).thenReturn(1); // a different npc type
Player player = mock(Player.class);
when(client.getLocalPlayer()).thenReturn(player);
// spec npc
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(50);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
lenient().when(player.getInteracting()).thenReturn(targetA);
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, targetA));
// hit 1
specialCounterPlugin.onHitsplatApplied(hitsplat(targetA, Hitsplat.HitsplatType.DAMAGE_ME));
verify(infoBoxManager).addInfoBox(any(SpecialCounter.class));
// attack npc 2
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, targetB));
// hit 1
specialCounterPlugin.onHitsplatApplied(hitsplat(targetB, Hitsplat.HitsplatType.DAMAGE_ME));
verify(infoBoxManager).removeInfoBox(any(SpecialCounter.class));
}
@Test
public void testNotification()
{
// Create an enemy
NPC target = mock(NPC.class);
// Create player
Player player = mock(Player.class);
when(client.getLocalPlayer()).thenReturn(player);
when(specialCounterConfig.bandosGodswordThreshold()).thenReturn(2);
when(specialCounterConfig.thresholdNotification()).thenReturn(true);
// Attack enemy
when(player.getInteracting()).thenReturn(target);
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, target));
// First special attack
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(50);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
specialCounterPlugin.onHitsplatApplied(hitsplat(target, Hitsplat.HitsplatType.DAMAGE_ME));
// Second special attack
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(0);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
specialCounterPlugin.onHitsplatApplied(hitsplat(target, Hitsplat.HitsplatType.DAMAGE_ME));
verify(notifier).notify("Bandos Godsword special attack threshold reached!");
}
@Test
public void testNotificationNotThreshold()
{
// Create an enemy
NPC target = mock(NPC.class);
// Create player
Player player = mock(Player.class);
when(client.getLocalPlayer()).thenReturn(player);
when(specialCounterConfig.bandosGodswordThreshold()).thenReturn(3);
lenient().when(specialCounterConfig.thresholdNotification()).thenReturn(true);
// Attack enemy
when(player.getInteracting()).thenReturn(target);
specialCounterPlugin.onInteractingChanged(new InteractingChanged(player, target));
// First special attack
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(50);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
specialCounterPlugin.onHitsplatApplied(hitsplat(target, Hitsplat.HitsplatType.DAMAGE_ME));
// Second special attack
when(client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT)).thenReturn(0);
specialCounterPlugin.onVarbitChanged(new VarbitChanged());
specialCounterPlugin.onHitsplatApplied(hitsplat(target, Hitsplat.HitsplatType.DAMAGE_ME));
verify(notifier, never()).notify(any());
}
}
@@ -0,0 +1,372 @@
/*
* Copyright (c) 2019, 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.timers;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.time.Duration;
import java.time.Instant;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.InventoryID;
import net.runelite.api.ItemContainer;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.ItemContainerChanged;
import net.runelite.client.game.ItemManager;
import net.runelite.client.game.SpriteManager;
import net.runelite.client.ui.overlay.infobox.InfoBox;
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.nullable;
import org.mockito.Mock;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;
@RunWith(MockitoJUnitRunner.class)
public class TimersPluginTest
{
@Inject
private TimersPlugin timersPlugin;
@Mock
@Bind
private TimersConfig timersConfig;
@Mock
@Bind
private Client client;
@Mock
@Bind
private ItemManager itemManager;
@Mock
@Bind
private SpriteManager spriteManager;
@Mock
@Bind
private InfoBoxManager infoBoxManager;
@Before
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
}
@Test
public void testHalfTeleblock()
{
when(timersConfig.showTeleblock()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "<col=4f006f>A Tele Block spell has been cast on you by Runelite. It will expire in 2 minutes, 30 seconds.</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.TELEBLOCK, infoBox.getTimer());
assertEquals(Duration.ofSeconds(2 * 60 + 30), infoBox.getDuration());
}
@Test
public void testFullTeleblock()
{
when(timersConfig.showTeleblock()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "<col=4f006f>A Tele Block spell has been cast on you by Runelite. It will expire in 5 minutes.</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.TELEBLOCK, infoBox.getTimer());
assertEquals(Duration.ofMinutes(5), infoBox.getDuration());
}
@Test
public void testDmmHalfTb()
{
when(timersConfig.showTeleblock()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "<col=4f006f>A Tele Block spell has been cast on you by Runelite. It will expire in 1 minute, 15 seconds.</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.TELEBLOCK, infoBox.getTimer());
assertEquals(Duration.ofSeconds(60 + 15), infoBox.getDuration());
}
@Test
public void testDmmFullTb()
{
when(timersConfig.showTeleblock()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "<col=4f006f>A Tele Block spell has been cast on you by Runelite. It will expire in 2 minutes, 30 seconds.</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.TELEBLOCK, infoBox.getTimer());
assertEquals(Duration.ofSeconds(60 * 2 + 30), infoBox.getDuration());
}
@Test
public void testDivineBastion()
{
when(timersConfig.showDivine()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You drink some of your divine bastion potion.", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.DIVINE_BASTION, infoBox.getTimer());
}
@Test
public void testDivineBattlemage()
{
when(timersConfig.showDivine()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You drink some of your divine battlemage potion.", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.DIVINE_BATTLEMAGE, infoBox.getTimer());
}
@Test
public void testTransparentChatboxTb()
{
when(timersConfig.showTeleblock()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "<col=c356ef>A Tele Block spell has been cast on you by Alexsuperfly. It will expire in 5 minutes.</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.TELEBLOCK, infoBox.getTimer());
assertEquals(Duration.ofMinutes(5), infoBox.getDuration());
}
@Test
public void testTransparentChatboxTbRemoved()
{
when(timersConfig.showTeleblock()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "<col=c356ef>Your Tele Block has been removed because you killed Alexsuperfly.</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
verify(infoBoxManager, atLeastOnce()).removeIf(any());
}
@Test
public void testMageArena2TbFull()
{
when(timersConfig.showTeleblock()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "<col=c356ef>A Tele Block spell has been cast on you. It will expire in 2 minutes.</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.TELEBLOCK, infoBox.getTimer());
assertEquals(Duration.ofMinutes(2), infoBox.getDuration());
}
@Test
public void testMageArena2TbHalf()
{
when(timersConfig.showTeleblock()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "<col=c356ef>A Tele Block spell has been cast on you. It will expire in 1 minute.</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.TELEBLOCK, infoBox.getTimer());
assertEquals(Duration.ofMinutes(1), infoBox.getDuration());
}
@Test
public void testStamina()
{
when(timersConfig.showStamina()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You drink some of your stamina potion.", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.STAMINA, infoBox.getTimer());
assertEquals(Duration.ofMinutes(2), infoBox.getDuration());
}
@Test
public void testSireStunTimer()
{
when(timersConfig.showAbyssalSireStun()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "The Sire has been disorientated temporarily.", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.ABYSSAL_SIRE_STUN, infoBox.getTimer());
assertEquals(Duration.ofSeconds(30), infoBox.getDuration());
}
@Test
public void testEndurance()
{
when(timersConfig.showStamina()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "Your Ring of endurance doubles the duration of your stamina potion's effect.", "", 0);
timersPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You drink some of your stamina potion.", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager).addInfoBox(captor.capture());
TimerTimer infoBox = (TimerTimer) captor.getValue();
assertEquals(GameTimer.STAMINA, infoBox.getTimer());
assertEquals(Duration.ofMinutes(4), infoBox.getDuration());
// unwield ring
timersPlugin.onItemContainerChanged(new ItemContainerChanged(InventoryID.EQUIPMENT.getId(), mock(ItemContainer.class)));
// some time has elapsed in the test; this should be just under 2 mins
int mins = (int) infoBox.getDuration().toMinutes();
assertTrue(mins == 1 || mins == 2);
}
@Test
public void testTzhaarTimer()
{
when(timersConfig.showTzhaarTimers()).thenReturn(true);
when(client.getMapRegions()).thenReturn(new int[]{TimersPlugin.FIGHT_CAVES_REGION_ID});
class InstantRef
{
Instant i;
}
InstantRef startTime = new InstantRef();
when(timersConfig.tzhaarStartTime()).then(a -> startTime.i);
doAnswer((Answer<Void>) invocationOnMock ->
{
Object argument = invocationOnMock.getArguments()[0];
startTime.i = (Instant) argument;
return null;
}).when(timersConfig).tzhaarStartTime(nullable(Instant.class));
InstantRef lastTime = new InstantRef();
when(timersConfig.tzhaarLastTime()).then(a -> lastTime.i);
doAnswer((Answer<Void>) invocationOnMock ->
{
Object argument = invocationOnMock.getArguments()[0];
lastTime.i = (Instant) argument;
return null;
}).when(timersConfig).tzhaarLastTime(nullable(Instant.class));
// test timer creation: verify the infobox was added and that it is an ElapsedTimer
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "<col=ef1020>Wave: 1</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager, times(1)).addInfoBox(captor.capture());
assertTrue(captor.getValue() instanceof ElapsedTimer);
// test timer pause: verify the added ElapsedTimer has a non-null lastTime
chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "<col=ef1020>The Inferno has been paused. You may now log out.", "", 0);
timersPlugin.onChatMessage(chatMessage);
verify(infoBoxManager, times(1)).removeInfoBox(captor.capture());
verify(infoBoxManager, times(2)).addInfoBox(captor.capture());
assertTrue(captor.getValue() instanceof ElapsedTimer);
ElapsedTimer timer = (ElapsedTimer) captor.getValue();
assertNotEquals(timer.getLastTime(), null);
Instant oldTime = ((ElapsedTimer) captor.getValue()).getStartTime();
// test timer unpause: verify the last time is null after being unpaused
chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "<col=ef1020>Wave: 2</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
verify(infoBoxManager, times(2)).removeInfoBox(captor.capture());
verify(infoBoxManager, times(3)).addInfoBox(captor.capture());
assertTrue(captor.getValue() instanceof ElapsedTimer);
timer = (ElapsedTimer) captor.getValue();
assertNull(timer.getLastTime());
// test timer remove: verify the infobox was removed (and no more were added)
chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "You have been defeated!", "", 0);
timersPlugin.onChatMessage(chatMessage);
verify(infoBoxManager, times(3)).removeInfoBox(captor.capture());
verify(infoBoxManager, times(3)).addInfoBox(captor.capture());
}
@Test
public void testInfernoTimerStartOffset()
{
when(timersConfig.showTzhaarTimers()).thenReturn(true);
when(client.getMapRegions()).thenReturn(new int[]{TimersPlugin.INFERNO_REGION_ID});
class InstantRef
{
Instant i;
}
InstantRef startTime = new InstantRef();
when(timersConfig.tzhaarStartTime()).then(a -> startTime.i);
doAnswer((Answer<Void>) invocationOnMock ->
{
Object argument = invocationOnMock.getArguments()[0];
startTime.i = (Instant) argument;
return null;
}).when(timersConfig).tzhaarStartTime(nullable(Instant.class));
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "<col=ef1020>Wave: 1</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
ArgumentCaptor<InfoBox> captor = ArgumentCaptor.forClass(InfoBox.class);
verify(infoBoxManager, times(1)).addInfoBox(captor.capture());
assertTrue(captor.getValue() instanceof ElapsedTimer);
ElapsedTimer timer = (ElapsedTimer) captor.getValue();
assertEquals("00:06", timer.getText());
}
}
@@ -0,0 +1,129 @@
/*
* Copyright (c) 2018, Jordan Atwood <jordan.atwood423@gmail.com>
* 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.util;
import com.google.common.collect.ImmutableMap;
import java.awt.Color;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class ColorUtilTest
{
private static final Map<Color, String> COLOR_HEXSTRING_MAP = new ImmutableMap.Builder<Color, String>().
put(Color.BLACK, "000000").
put(new Color(0x1), "000001").
put(new Color(0x100000), "100000").
put(Color.RED, "ff0000").
put(Color.GREEN, "00ff00").
put(Color.BLUE, "0000ff").
put(new Color(0xA1B2C3), "a1b2c3").
put(Color.WHITE, "ffffff").build();
private static final Map<Color, String> COLOR_ALPHA_HEXSTRING_MAP = ImmutableMap.of(
new Color(0x00000000, true), "00000000",
new Color(0xA1B2C3D4, true), "a1b2c3d4"
);
@Test
public void colorTag()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals("<col=" + hex + ">", ColorUtil.colorTag(color));
});
}
@Test
public void prependColorTag()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals("<col=" + hex + ">test", ColorUtil.prependColorTag("test", color));
assertEquals("<col=" + hex + ">", ColorUtil.prependColorTag("", color));
});
assertEquals("<col=ff0000>94<col=ffffff>/99", ColorUtil.prependColorTag("94" + ColorUtil.prependColorTag("/99", Color.WHITE), Color.RED));
}
@Test
public void wrapWithColorTag()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals("<col=" + hex + ">test</col>", ColorUtil.wrapWithColorTag("test", color));
assertEquals("<col=" + hex + "></col>", ColorUtil.wrapWithColorTag("", color));
});
}
@Test
public void toHexColor()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals("#" + hex, ColorUtil.toHexColor(color));
});
}
@Test
public void colorWithAlpha()
{
int[] alpha = {73};
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals(new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha[0]),
ColorUtil.colorWithAlpha(color, alpha[0]));
alpha[0] += 73;
alpha[0] %= 255;
});
COLOR_ALPHA_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals(new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha[0]),
ColorUtil.colorWithAlpha(color, alpha[0]));
alpha[0] += 73;
alpha[0] %= 255;
});
}
@Test
public void colorLerp()
{
assertEquals(Color.WHITE, ColorUtil.colorLerp(Color.WHITE, Color.WHITE, 0.9));
assertEquals(new Color(128, 128, 128), ColorUtil.colorLerp(Color.BLACK, Color.WHITE, 0.5));
assertEquals(Color.BLACK, ColorUtil.colorLerp(Color.BLACK, Color.CYAN, 0));
assertEquals(Color.CYAN, ColorUtil.colorLerp(Color.BLACK, Color.CYAN, 1));
}
@Test
public void colorToHexCode()
{
COLOR_HEXSTRING_MAP.forEach((color, hex) ->
{
assertEquals(hex, ColorUtil.colorToHexCode(color));
});
}
}
@@ -609,6 +609,16 @@ public abstract class RSClientMixin implements RSClient
return getWidget(groupId, childId);
}
@Inject
@Override
public Widget getWidget(com.openosrs.api.widgets.WidgetInfo widget)
{
int groupId = widget.getGroupId();
int childId = widget.getChildId();
return getWidget(groupId, childId);
}
@Inject
@Override
public Widget getWidget(int id)