Merge remote-tracking branch 'upstream/master' into master
This commit is contained in:
@@ -766,6 +766,10 @@ public class ConfigManager
|
||||
{
|
||||
return Integer.parseInt(str);
|
||||
}
|
||||
if (type == double.class || type == Double.class)
|
||||
{
|
||||
return Double.parseDouble(str);
|
||||
}
|
||||
if (type == Color.class)
|
||||
{
|
||||
return ColorUtil.fromString(str);
|
||||
|
||||
@@ -189,13 +189,13 @@ public enum AgilityShortcut
|
||||
TAVERLEY_DUNGEON_ROCKS_SOUTH(70, "Rocks", new WorldPoint(2887, 9631, 0), ROCKS, ROCKS_14106),
|
||||
FOSSIL_ISLAND_HARDWOOD_NORTH(70, "Hole" , new WorldPoint(3712, 3828, 0), HOLE_31481, HOLE_31482),
|
||||
FOSSIL_ISLAND_HARDWOOD_SOUTH(70, "Hole" , new WorldPoint(3714, 3816, 0), HOLE_31481, HOLE_31482),
|
||||
AL_KHARID_WINDOW(70, "Window", new WorldPoint(3295, 3158, 0), BROKEN_WALL_33344, BIG_WINDOW)
|
||||
AL_KHARID_WINDOW(70, "Window", new WorldPoint(3293, 3158, 0), BROKEN_WALL_33344, BIG_WINDOW)
|
||||
{
|
||||
@Override
|
||||
public boolean matches(TileObject object)
|
||||
{
|
||||
// there are two BIG_WINDOW objects right next to each other here, but only this one is valid
|
||||
return object.getId() != BIG_WINDOW || object.getWorldLocation().equals(getWorldLocation());
|
||||
return object.getId() != BIG_WINDOW || object.getWorldLocation().equals(new WorldPoint(3295, 3158, 0));
|
||||
}
|
||||
},
|
||||
GWD_SARADOMIN_ROPE_NORTH(70, "Rope Descent", new WorldPoint(2912, 5300, 0), NULL_26371, NULL_26561),
|
||||
|
||||
@@ -41,7 +41,6 @@ import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.events.PlayerMenuOptionsChanged;
|
||||
import net.runelite.api.events.WidgetMenuOptionClicked;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
|
||||
@@ -78,8 +77,7 @@ public class MenuManager
|
||||
*/
|
||||
public void addManagedCustomMenu(WidgetMenuOption customMenuOption)
|
||||
{
|
||||
WidgetInfo widget = customMenuOption.getWidget();
|
||||
managedMenuOptions.put(widget.getId(), customMenuOption);
|
||||
managedMenuOptions.put(customMenuOption.getWidgetId(), customMenuOption);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,8 +87,7 @@ public class MenuManager
|
||||
*/
|
||||
public void removeManagedCustomMenu(WidgetMenuOption customMenuOption)
|
||||
{
|
||||
WidgetInfo widget = customMenuOption.getWidget();
|
||||
managedMenuOptions.remove(widget.getId(), customMenuOption);
|
||||
managedMenuOptions.remove(customMenuOption.getWidgetId(), customMenuOption);
|
||||
}
|
||||
|
||||
private boolean menuContainsCustomMenu(WidgetMenuOption customMenuOption)
|
||||
@@ -208,6 +205,7 @@ public class MenuManager
|
||||
customMenu.setMenuOption(event.getMenuOption());
|
||||
customMenu.setMenuTarget(event.getMenuTarget());
|
||||
customMenu.setWidget(curMenuOption.getWidget());
|
||||
customMenu.setWidgetId(curMenuOption.getWidgetId());
|
||||
eventBus.post(customMenu);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -24,9 +24,11 @@
|
||||
*/
|
||||
package net.runelite.client.menus;
|
||||
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
|
||||
import java.awt.Color;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.ui.JagexColors;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
@@ -35,20 +37,33 @@ public final class WidgetMenuOption
|
||||
/**
|
||||
* The left hand text to be displayed on the menu option. (ex. the menuOption of "Drop Bones" is "Drop")
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
private String menuOption;
|
||||
/**
|
||||
* The right hand text to be displayed on the menu option. (ex. the menuTarget of "Drop Bones" is "Bones")
|
||||
*/
|
||||
@Getter
|
||||
private String menuTarget;
|
||||
/**
|
||||
* The color that the menuTarget should be. Defaults to the brownish color that most menu options have.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
private Color color = JagexColors.MENU_TARGET;
|
||||
|
||||
/**
|
||||
* The widgetinfo to add the option to, if available
|
||||
*/
|
||||
@Nullable
|
||||
@Getter
|
||||
private final WidgetInfo widget;
|
||||
|
||||
/**
|
||||
* The widget to add the option to
|
||||
*/
|
||||
private final WidgetInfo widget;
|
||||
@Getter
|
||||
private final int widgetId;
|
||||
|
||||
/**
|
||||
* Creates a menu to be added to right click menus. The menu will only be added if match is found within the menu options
|
||||
@@ -62,11 +77,22 @@ public final class WidgetMenuOption
|
||||
this.menuOption = menuOption;
|
||||
setMenuTarget(menuTarget);
|
||||
this.widget = widget;
|
||||
this.widgetId = widget.getId();
|
||||
}
|
||||
|
||||
public void setMenuOption(String option)
|
||||
/**
|
||||
* Creates a menu to be added to right click menus. The menu will only be added if match is found within the menu options
|
||||
*
|
||||
* @param menuOption Option text of this right click option
|
||||
* @param menuTarget Target text of this right click option
|
||||
* @param widgetId The widget to attach this option to
|
||||
*/
|
||||
public WidgetMenuOption(String menuOption, String menuTarget, int widgetId)
|
||||
{
|
||||
menuOption = option;
|
||||
this.menuOption = menuOption;
|
||||
setMenuTarget(menuTarget);
|
||||
this.widget = null;
|
||||
this.widgetId = widgetId;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,29 +104,4 @@ public final class WidgetMenuOption
|
||||
{
|
||||
menuTarget = ColorUtil.wrapWithColorTag(target, color);
|
||||
}
|
||||
|
||||
public String getMenuOption()
|
||||
{
|
||||
return menuOption;
|
||||
}
|
||||
|
||||
public String getMenuTarget()
|
||||
{
|
||||
return menuTarget;
|
||||
}
|
||||
|
||||
public WidgetInfo getWidget()
|
||||
{
|
||||
return widget;
|
||||
}
|
||||
|
||||
public Color getColor()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(Color col)
|
||||
{
|
||||
color = col;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ enum CannonSpots
|
||||
MINIONS_OF_SCARABAS(new WorldPoint(3297, 9252, 0)),
|
||||
ROGUE(new WorldPoint(3285, 3930, 0)),
|
||||
SCORPION(new WorldPoint(3233, 10335, 0)),
|
||||
SKELETON(new WorldPoint(3018, 3592, 0)),
|
||||
SKELETON(new WorldPoint(3017, 3589, 0)),
|
||||
SMOKE_DEVIL(new WorldPoint(2398, 9444, 0)),
|
||||
SPIDER(new WorldPoint(3169, 3886, 0)),
|
||||
SUQAHS(new WorldPoint(2114, 3943, 0)),
|
||||
|
||||
@@ -96,22 +96,22 @@ public class ChatCommandsPlugin extends Plugin
|
||||
{
|
||||
private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (?:completion count for |subdued |completed )?(.+?) (?:(?:kill|harvest|lap|completion) )?(?:count )?is: <col=ff0000>(\\d+)</col>");
|
||||
private static final String COX_TEAM_SIZES = "(?:\\d+(?:\\+|-\\d+)? players|Solo)";
|
||||
private static final Pattern RAIDS_PB_PATTERN = Pattern.compile("<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>" + COX_TEAM_SIZES + "</col> Duration:</col> <col=ff0000>(?<pb>[0-9:]+)</col> \\(new personal best\\)</col>");
|
||||
private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>" + COX_TEAM_SIZES + "</col> Duration:</col> <col=ff0000>[0-9:]+</col> Personal best: </col><col=ff0000>(?<pb>[0-9:]+)</col>");
|
||||
private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: <col=ff0000>(?<pb>[0-9:]+)</col> \\(Personal best!\\)");
|
||||
private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: <col=ff0000>[0-9:]+</col><br></col>Personal best: (?<pb>[0-9:]+)");
|
||||
private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: <col=ff0000>[0-9:]+</col>\\. Personal best: (?:<col=ff0000>)?(?<pb>[0-9:]+)");
|
||||
private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: <col=ff0000>(?<pb>[0-9:]+)</col> \\(new personal best\\)");
|
||||
private static final Pattern RAIDS_PB_PATTERN = Pattern.compile("<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>" + COX_TEAM_SIZES + "</col> Duration:</col> <col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(new personal best\\)</col>");
|
||||
private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>" + COX_TEAM_SIZES + "</col> Duration:</col> <col=ff0000>[0-9:.]+</col> Personal best: </col><col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col>");
|
||||
private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: <col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(Personal best!\\)");
|
||||
private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: <col=ff0000>[0-9:.]+</col><br></col>Personal best: (?<pb>[0-9:]+(?:\\.[0-9]+)?)");
|
||||
private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: <col=ff0000>[0-9:.]+</col>\\. Personal best: (?:<col=ff0000>)?(?<pb>[0-9:]+(?:\\.[0-9]+)?)");
|
||||
private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: <col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(new personal best\\)");
|
||||
private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?");
|
||||
private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?");
|
||||
private static final Pattern ADVENTURE_LOG_TITLE_PATTERN = Pattern.compile("The Exploits of (.+)");
|
||||
private static final Pattern ADVENTURE_LOG_COX_PB_PATTERN = Pattern.compile("Fastest (?:kill|run)(?: - \\(Team size: " + COX_TEAM_SIZES + "\\))?: ([0-9:]+)");
|
||||
private static final Pattern ADVENTURE_LOG_COX_PB_PATTERN = Pattern.compile("Fastest (?:kill|run)(?: - \\(Team size: " + COX_TEAM_SIZES + "\\))?: ([0-9:]+(?:\\.[0-9]+)?)");
|
||||
private static final Pattern ADVENTURE_LOG_BOSS_PB_PATTERN = Pattern.compile("[a-zA-Z]+(?: [a-zA-Z]+)*");
|
||||
private static final Pattern ADVENTURE_LOG_PB_PATTERN = Pattern.compile("(" + ADVENTURE_LOG_BOSS_PB_PATTERN + "(?: - " + ADVENTURE_LOG_BOSS_PB_PATTERN + ")*) (?:" + ADVENTURE_LOG_COX_PB_PATTERN + "( )*)+");
|
||||
private static final Pattern HS_PB_PATTERN = Pattern.compile("Floor (?<floor>\\d) time: <col=ff0000>(?<floortime>[0-9:]+)</col>(?: \\(new personal best\\)|. Personal best: (?<floorpb>[0-9:]+))" +
|
||||
"(?:<br>Overall time: <col=ff0000>(?<otime>[0-9:]+)</col>(?: \\(new personal best\\)|. Personal best: (?<opb>[0-9:]+)))?");
|
||||
private static final Pattern HS_KC_FLOOR_PATTERN = Pattern.compile("You have completed Floor (\\d) of the Hallowed Sepulchre! Total completions: <col=ff0000>(\\d+)</col>\\.");
|
||||
private static final Pattern HS_KC_GHC_PATTERN = Pattern.compile("You have opened the Grand Hallowed Coffin <col=ff0000>(\\d+)</col> times?!");
|
||||
private static final Pattern HS_PB_PATTERN = Pattern.compile("Floor (?<floor>\\d) time: <col=ff0000>(?<floortime>[0-9:]+(?:\\.[0-9]+)?)</col>(?: \\(new personal best\\)|. Personal best: (?<floorpb>[0-9:]+(?:\\.[0-9]+)?))" +
|
||||
"(?:<br>Overall time: <col=ff0000>(?<otime>[0-9:]+(?:\\.[0-9]+)?)</col>(?: \\(new personal best\\)|. Personal best: (?<opb>[0-9:]+(?:\\.[0-9]+)?)))?");
|
||||
private static final Pattern HS_KC_FLOOR_PATTERN = Pattern.compile("You have completed Floor (\\d) of the Hallowed Sepulchre! Total completions: <col=ff0000>([0-9,]+)</col>\\.");
|
||||
private static final Pattern HS_KC_GHC_PATTERN = Pattern.compile("You have opened the Grand Hallowed Coffin <col=ff0000>([0-9,]+)</col> times?!");
|
||||
|
||||
private static final String TOTAL_LEVEL_COMMAND_STRING = "!total";
|
||||
private static final String PRICE_COMMAND_STRING = "!price";
|
||||
@@ -143,7 +143,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
private HiscoreEndpoint hiscoreEndpoint; // hiscore endpoint for current player
|
||||
private String lastBossKill;
|
||||
private int lastBossTime = -1;
|
||||
private int lastPb = -1;
|
||||
private double lastPb = -1;
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
@@ -251,14 +251,14 @@ public class ChatCommandsPlugin extends Plugin
|
||||
return killCount == null ? 0 : killCount;
|
||||
}
|
||||
|
||||
private void setPb(String boss, int seconds)
|
||||
private void setPb(String boss, double seconds)
|
||||
{
|
||||
configManager.setRSProfileConfiguration("personalbest", boss.toLowerCase(), seconds);
|
||||
}
|
||||
|
||||
private int getPb(String boss)
|
||||
private double getPb(String boss)
|
||||
{
|
||||
Integer personalBest = configManager.getRSProfileConfiguration("personalbest", boss.toLowerCase(), int.class);
|
||||
Double personalBest = configManager.getRSProfileConfiguration("personalbest", boss.toLowerCase(), double.class);
|
||||
return personalBest == null ? 0 : personalBest;
|
||||
}
|
||||
|
||||
@@ -394,14 +394,14 @@ public class ChatCommandsPlugin extends Plugin
|
||||
if (matcher.find())
|
||||
{
|
||||
int floor = Integer.parseInt(matcher.group(1));
|
||||
int kc = Integer.parseInt(matcher.group(2));
|
||||
int kc = Integer.parseInt(matcher.group(2).replaceAll(",", ""));
|
||||
setKc("Hallowed Sepulchre Floor " + floor, kc);
|
||||
}
|
||||
|
||||
matcher = HS_KC_GHC_PATTERN.matcher(message);
|
||||
if (matcher.find())
|
||||
{
|
||||
int kc = Integer.parseInt(matcher.group(1));
|
||||
int kc = Integer.parseInt(matcher.group(1).replaceAll(",", ""));
|
||||
setKc("Hallowed Sepulchre", kc);
|
||||
}
|
||||
|
||||
@@ -412,23 +412,24 @@ public class ChatCommandsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
private static int timeStringToSeconds(String timeString)
|
||||
@VisibleForTesting
|
||||
static double timeStringToSeconds(String timeString)
|
||||
{
|
||||
String[] s = timeString.split(":");
|
||||
if (s.length == 2) // mm:ss
|
||||
{
|
||||
return Integer.parseInt(s[0]) * 60 + Integer.parseInt(s[1]);
|
||||
return Integer.parseInt(s[0]) * 60 + Double.parseDouble(s[1]);
|
||||
}
|
||||
else if (s.length == 3) // h:mm:ss
|
||||
{
|
||||
return Integer.parseInt(s[0]) * 60 * 60 + Integer.parseInt(s[1]) * 60 + Integer.parseInt(s[2]);
|
||||
return Integer.parseInt(s[0]) * 60 * 60 + Integer.parseInt(s[1]) * 60 + Double.parseDouble(s[2]);
|
||||
}
|
||||
return Integer.parseInt(timeString);
|
||||
return Double.parseDouble(timeString);
|
||||
}
|
||||
|
||||
private void matchPb(Matcher matcher)
|
||||
{
|
||||
int seconds = timeStringToSeconds(matcher.group("pb"));
|
||||
double seconds = timeStringToSeconds(matcher.group("pb"));
|
||||
if (lastBossKill != null)
|
||||
{
|
||||
// Most bosses sent boss kill message, and then pb message, so we
|
||||
@@ -514,13 +515,13 @@ public class ChatCommandsPlugin extends Plugin
|
||||
bossName.equalsIgnoreCase("chambers of xeric challenge mode"))
|
||||
{
|
||||
Matcher mCoxRuns = ADVENTURE_LOG_COX_PB_PATTERN.matcher(mCounterText.group());
|
||||
int bestPbTime = Integer.MAX_VALUE;
|
||||
double bestPbTime = Double.MAX_VALUE;
|
||||
while (mCoxRuns.find())
|
||||
{
|
||||
bestPbTime = Math.min(timeStringToSeconds(mCoxRuns.group(1)), bestPbTime);
|
||||
}
|
||||
// So we don't reset people's already saved PB's if they had one before the update
|
||||
int currentPb = getPb(bossName);
|
||||
double currentPb = getPb(bossName);
|
||||
if (currentPb == 0 || currentPb > bestPbTime)
|
||||
{
|
||||
setPb(bossName, bestPbTime);
|
||||
@@ -841,7 +842,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
|
||||
search = longBossName(search);
|
||||
|
||||
final int pb;
|
||||
final double pb;
|
||||
try
|
||||
{
|
||||
pb = chatClient.getPb(player, search);
|
||||
@@ -852,8 +853,14 @@ public class ChatCommandsPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
int minutes = pb / 60;
|
||||
int seconds = pb % 60;
|
||||
int minutes = (int) (Math.floor(pb) / 60);
|
||||
double seconds = pb % 60;
|
||||
|
||||
// If the seconds is an integer, it is ambiguous if the pb is a precise
|
||||
// pb or not. So we always show it without the trailing .00.
|
||||
final String time = Math.floor(seconds) == seconds ?
|
||||
String.format("%d:%02d", minutes, (int) seconds) :
|
||||
String.format("%d:%05.2f", minutes, seconds);
|
||||
|
||||
String response = new ChatMessageBuilder()
|
||||
.append(ChatColorType.HIGHLIGHT)
|
||||
@@ -861,7 +868,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
.append(ChatColorType.NORMAL)
|
||||
.append(" personal best: ")
|
||||
.append(ChatColorType.HIGHLIGHT)
|
||||
.append(String.format("%d:%02d", minutes, seconds))
|
||||
.append(time)
|
||||
.build();
|
||||
|
||||
log.debug("Setting response {}", response);
|
||||
@@ -876,7 +883,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
int idx = value.indexOf(' ');
|
||||
final String boss = longBossName(value.substring(idx + 1));
|
||||
|
||||
final int pb = getPb(boss);
|
||||
final double pb = getPb(boss);
|
||||
if (pb <= 0)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -78,7 +78,6 @@ public class MapClue extends ClueScroll implements ObjectClueScroll
|
||||
new MapClue(CLUE_SCROLL_MEDIUM_7292, new WorldPoint(2578, 3597, 0), "South-east of the Lighthouse. Fairy ring ALP"),
|
||||
new MapClue(CLUE_SCROLL_MEDIUM_7294, new WorldPoint(2666, 3562, 0), "Between Seers' Village and Rellekka. South-west of Fairy ring CJR"),
|
||||
new MapClue(CLUE_SCROLL_HARD, new WorldPoint(3309, 3503, 0), CRATE_2620, "A crate in the Lumber Yard, north-east of Varrock."),
|
||||
new MapClue(CLUE_SCROLL_HARD_2729, new WorldPoint(3190, 3963, 0), "Behind the Magic axe hut in level 56 Wilderness."),
|
||||
new MapClue(CLUE_SCROLL_HARD_3520, new WorldPoint(2615, 3078, 0), "Yanille anvils, south of the bank. You can dig from inside the building."),
|
||||
new MapClue(CLUE_SCROLL_HARD_3522, new WorldPoint(2488, 3308, 0), "In the western section of West Ardougne."),
|
||||
new MapClue(CLUE_SCROLL_HARD_3524, new WorldPoint(2457, 3182, 0), CRATE_18506, "In a crate by the stairs to the Observatory Dungeon."),
|
||||
|
||||
@@ -85,6 +85,7 @@ enum DiscordGameEventType
|
||||
BOSS_SARACHNIS("Sarachnis", DiscordAreaType.BOSSES, 7322),
|
||||
BOSS_SKOTIZO("Skotizo", DiscordAreaType.BOSSES, 6810),
|
||||
BOSS_SMOKE_DEVIL("Thermonuclear smoke devil", DiscordAreaType.BOSSES, 9363, 9619),
|
||||
BOSS_TEMPOROSS("Tempoross", DiscordAreaType.BOSSES, 12078),
|
||||
BOSS_VORKATH("Vorkath", DiscordAreaType.BOSSES, 9023),
|
||||
BOSS_WINTERTODT("Wintertodt", DiscordAreaType.BOSSES, 6462),
|
||||
BOSS_ZALCANO("Zalcano", DiscordAreaType.BOSSES, 12126),
|
||||
@@ -374,7 +375,7 @@ enum DiscordGameEventType
|
||||
REGION_KEBOS_LOWLANDS("Kebos Lowlands", DiscordAreaType.REGIONS, 4665, 4666, 4921, 5178),
|
||||
REGION_KEBOS_SWAMP("Kebos Swamp", DiscordAreaType.REGIONS, 4664, 4920, 5174, 5175, 5176, 5430, 5431),
|
||||
REGION_KHARAZI_JUNGLE("Kharazi Jungle", DiscordAreaType.REGIONS, 11053, 11309, 11565, 11821),
|
||||
REGION_KHARIDIAN_DESERT("Kharidian Desert", DiscordAreaType.REGIONS, 12844, 12845, 12846, 12847, 12848, 13100, 13101, 13102, 13103, 13104, 13357, 13359, 13360, 13614, 13615, 13616),
|
||||
REGION_KHARIDIAN_DESERT("Kharidian Desert", DiscordAreaType.REGIONS, 12587, 12844, 12845, 12846, 12847, 12848, 13100, 13101, 13102, 13103, 13104, 13357, 13359, 13360, 13614, 13615, 13616),
|
||||
REGION_KILLERWATT_PLANE("Killerwatt Plane", DiscordAreaType.REGIONS, 10577),
|
||||
REGION_KOUREND("Great Kourend", DiscordAreaType.REGIONS, 6201, 6457, 6713),
|
||||
REGION_KOUREND_WOODLAND("Kourend Woodland", DiscordAreaType.REGIONS, 5942, 6197, 6453),
|
||||
@@ -411,10 +412,12 @@ enum DiscordGameEventType
|
||||
REGION_QUARRY("Quarry", DiscordAreaType.REGIONS, 12589),
|
||||
REGION_RANGING_GUILD("Ranging Guild", DiscordAreaType.REGIONS, 10549),
|
||||
REGION_RATCATCHERS_MANSION("Ratcatchers Mansion", DiscordAreaType.REGIONS, 11343),
|
||||
REGION_RUINS_OF_UNKAH("Ruins of Unkah", DiscordAreaType.REGIONS, 12588),
|
||||
REGION_RUNE_ESSENCE_MINE("Rune Essence Mine", DiscordAreaType.REGIONS, 11595),
|
||||
// The Beekeper, Pinball, and Gravedigger randoms share a region (7758), and although they are not technically ScapeRune, that name is most commonly
|
||||
// associated with random events, so those three have been denoted ScapeRune to avoid leaving multiple random event regions without an assigned name.
|
||||
REGION_SCAPERUNE("ScapeRune", DiscordAreaType.REGIONS, 10058, 7758, 8261),
|
||||
REGION_SEA_SPIRIT_DOCK("Sea Spirit Dock", DiscordAreaType.REGIONS, 12332),
|
||||
REGION_SHIP_YARD("Ship Yard", DiscordAreaType.REGIONS, 11823),
|
||||
REGION_SILVAREA("Silvarea", DiscordAreaType.REGIONS, 13366),
|
||||
REGION_SINCLAR_MANSION("Sinclair Mansion", DiscordAreaType.REGIONS, 10807),
|
||||
|
||||
@@ -511,7 +511,14 @@ class OpenCLManager
|
||||
new long[]{(long) largeModels * (LARGE_SIZE / largeFaceCount)}, new long[]{LARGE_SIZE / largeFaceCount}, 1, new cl_event[]{acquireGLBuffers}, computeEvents[numComputeEvents++]);
|
||||
}
|
||||
|
||||
clEnqueueReleaseGLObjects(commandQueue, glBuffers.length, glBuffers, numComputeEvents, computeEvents, null);
|
||||
if (numComputeEvents == 0)
|
||||
{
|
||||
clEnqueueReleaseGLObjects(commandQueue, glBuffers.length, glBuffers, 0, null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
clEnqueueReleaseGLObjects(commandQueue, glBuffers.length, glBuffers, numComputeEvents, computeEvents, null);
|
||||
}
|
||||
}
|
||||
|
||||
void finish()
|
||||
|
||||
@@ -107,11 +107,11 @@ public class HiscorePanel extends PluginPanel
|
||||
KALPHITE_QUEEN, KING_BLACK_DRAGON, KRAKEN,
|
||||
KREEARRA, KRIL_TSUTSAROTH, MIMIC,
|
||||
NIGHTMARE, OBOR, SARACHNIS,
|
||||
SCORPIA, SKOTIZO, THE_GAUNTLET,
|
||||
THE_CORRUPTED_GAUNTLET, THEATRE_OF_BLOOD, THERMONUCLEAR_SMOKE_DEVIL,
|
||||
TZKAL_ZUK, TZTOK_JAD, VENENATIS,
|
||||
VETION, VORKATH, WINTERTODT,
|
||||
ZALCANO, ZULRAH
|
||||
SCORPIA, SKOTIZO, TEMPOROSS,
|
||||
THE_GAUNTLET, THE_CORRUPTED_GAUNTLET, THEATRE_OF_BLOOD,
|
||||
THERMONUCLEAR_SMOKE_DEVIL, TZKAL_ZUK, TZTOK_JAD,
|
||||
VENENATIS, VETION, VORKATH,
|
||||
WINTERTODT, ZALCANO, ZULRAH
|
||||
);
|
||||
|
||||
private static final HiscoreEndpoint[] ENDPOINTS = {
|
||||
|
||||
@@ -40,12 +40,12 @@ import net.runelite.api.Tile;
|
||||
import net.runelite.api.coords.Direction;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
@@ -118,14 +118,6 @@ public class HunterPlugin extends Plugin
|
||||
* ------------------------------------------------------------------------------
|
||||
*/
|
||||
case ObjectID.DEADFALL: // Deadfall trap placed
|
||||
if (localPlayer.getWorldLocation().distanceTo(trapLocation) <= 2)
|
||||
{
|
||||
log.debug("Trap placed by \"{}\" on {}", localPlayer.getName(), trapLocation);
|
||||
traps.put(trapLocation, new HunterTrap(gameObject));
|
||||
lastActionTime = Instant.now();
|
||||
}
|
||||
break;
|
||||
|
||||
case ObjectID.MONKEY_TRAP: // Maniacal monkey trap placed
|
||||
// If player is right next to "object" trap assume that player placed the trap
|
||||
if (localPlayer.getWorldLocation().distanceTo(trapLocation) <= 2)
|
||||
@@ -166,15 +158,15 @@ public class HunterPlugin extends Plugin
|
||||
|
||||
switch (trapOrientation)
|
||||
{
|
||||
case NORTH:
|
||||
translatedTrapLocation = trapLocation.dy(1);
|
||||
case SOUTH:
|
||||
translatedTrapLocation = trapLocation.dy(-1);
|
||||
break;
|
||||
case EAST:
|
||||
translatedTrapLocation = trapLocation.dx(1);
|
||||
case WEST:
|
||||
translatedTrapLocation = trapLocation.dx(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
log.debug("Trap placed by \"{}\" on {}", localPlayer.getName(), translatedTrapLocation);
|
||||
log.debug("Trap placed by \"{}\" on {} facing {}", localPlayer.getName(), translatedTrapLocation, trapOrientation);
|
||||
traps.put(translatedTrapLocation, new HunterTrap(gameObject));
|
||||
lastActionTime = Instant.now();
|
||||
}
|
||||
|
||||
@@ -217,14 +217,12 @@ public class WoodcuttingPlugin extends Plugin
|
||||
{
|
||||
if (tree.getRespawnTime() != null && !recentlyLoggedIn && currentPlane == object.getPlane())
|
||||
{
|
||||
Point max = object.getSceneMaxLocation();
|
||||
Point min = object.getSceneMinLocation();
|
||||
int lenX = max.getX() - min.getX();
|
||||
int lenY = max.getY() - min.getY();
|
||||
log.debug("Adding respawn timer for {} tree at {}", tree, object.getLocalLocation());
|
||||
|
||||
final int region = client.getLocalPlayer().getWorldLocation().getRegionID();
|
||||
TreeRespawn treeRespawn = new TreeRespawn(tree, lenX, lenY, WorldPoint.fromScene(client, min.getX(), min.getY(), client.getPlane()), Instant.now(), (int) tree.getRespawnTime(region).toMillis());
|
||||
Point min = object.getSceneMinLocation();
|
||||
WorldPoint base = WorldPoint.fromScene(client, min.getX(), min.getY(), client.getPlane());
|
||||
TreeRespawn treeRespawn = new TreeRespawn(tree, object.sizeX() - 1, object.sizeY() - 1,
|
||||
base, Instant.now(), (int) tree.getRespawnTime(base.getRegionID()).toMillis());
|
||||
respawns.add(treeRespawn);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,19 +24,28 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.xpglobes;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.time.Instant;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.Skill;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
class XpGlobe
|
||||
{
|
||||
private Skill skill;
|
||||
private int currentXp;
|
||||
private int currentLevel;
|
||||
private Instant time;
|
||||
private int size;
|
||||
private BufferedImage skillIcon;
|
||||
|
||||
XpGlobe(Skill skill, int currentXp, int currentLevel, Instant time)
|
||||
{
|
||||
this.skill = skill;
|
||||
this.currentXp = currentXp;
|
||||
this.currentLevel = currentLevel;
|
||||
this.time = time;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.tooltip.Tooltip;
|
||||
import net.runelite.client.ui.overlay.tooltip.TooltipManager;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
|
||||
public class XpGlobesOverlay extends Overlay
|
||||
{
|
||||
@@ -65,6 +66,7 @@ public class XpGlobesOverlay extends Overlay
|
||||
private static final int TOOLTIP_RECT_SIZE_X = 150;
|
||||
private static final Color DARK_OVERLAY_COLOR = new Color(0, 0, 0, 180);
|
||||
static final String FLIP_ACTION = "Flip";
|
||||
private static final double GLOBE_ICON_RATIO = 0.65;
|
||||
|
||||
private final Client client;
|
||||
private final XpGlobesPlugin plugin;
|
||||
@@ -235,7 +237,8 @@ public class XpGlobesOverlay extends Overlay
|
||||
|
||||
private void drawSkillImage(Graphics2D graphics, XpGlobe xpGlobe, int x, int y)
|
||||
{
|
||||
BufferedImage skillImage = iconManager.getSkillImage(xpGlobe.getSkill());
|
||||
final int orbSize = config.xpOrbSize();
|
||||
final BufferedImage skillImage = getScaledSkillIcon(xpGlobe, orbSize);
|
||||
|
||||
if (skillImage == null)
|
||||
{
|
||||
@@ -244,12 +247,42 @@ public class XpGlobesOverlay extends Overlay
|
||||
|
||||
graphics.drawImage(
|
||||
skillImage,
|
||||
x + (config.xpOrbSize() / 2) - (skillImage.getWidth() / 2),
|
||||
y + (config.xpOrbSize() / 2) - (skillImage.getHeight() / 2),
|
||||
x + (orbSize / 2) - (skillImage.getWidth() / 2),
|
||||
y + (orbSize / 2) - (skillImage.getHeight() / 2),
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
private BufferedImage getScaledSkillIcon(XpGlobe xpGlobe, int orbSize)
|
||||
{
|
||||
// Cache the previous icon if the size hasn't changed
|
||||
if (xpGlobe.getSkillIcon() != null && xpGlobe.getSize() == orbSize)
|
||||
{
|
||||
return xpGlobe.getSkillIcon();
|
||||
}
|
||||
|
||||
BufferedImage icon = iconManager.getSkillImage(xpGlobe.getSkill());
|
||||
if (icon == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
final int size = orbSize - config.progressArcStrokeWidth();
|
||||
final int width = (int) (size * GLOBE_ICON_RATIO);
|
||||
final int height = (int) (size * GLOBE_ICON_RATIO);
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
icon = ImageUtil.resizeImage(icon, width, height);
|
||||
|
||||
xpGlobe.setSkillIcon(icon);
|
||||
xpGlobe.setSize(orbSize);
|
||||
return icon;
|
||||
}
|
||||
|
||||
private void drawTooltip(XpGlobe mouseOverSkill, int goalXp)
|
||||
{
|
||||
// reset the timer on XpGlobe to prevent it from disappearing while hovered over it
|
||||
|
||||
@@ -168,6 +168,7 @@ public class GameEventManager
|
||||
|
||||
Arrays.stream(tile.getGameObjects())
|
||||
.filter(Objects::nonNull)
|
||||
.filter(object -> object.getSceneMinLocation().equals(tile.getSceneLocation()))
|
||||
.forEach(object ->
|
||||
{
|
||||
final GameObjectSpawned objectSpawned = new GameObjectSpawned();
|
||||
|
||||
@@ -184,8 +184,7 @@
|
||||
],
|
||||
"unicorn horn": [
|
||||
237,
|
||||
1487,
|
||||
25514
|
||||
1487
|
||||
],
|
||||
"wine of zamorak": [
|
||||
245,
|
||||
@@ -251,6 +250,10 @@
|
||||
303,
|
||||
6209
|
||||
],
|
||||
"feather": [
|
||||
314,
|
||||
11525
|
||||
],
|
||||
"raw shrimps": [
|
||||
317,
|
||||
2514,
|
||||
@@ -489,7 +492,8 @@
|
||||
19875,
|
||||
19877,
|
||||
19879,
|
||||
19881
|
||||
19881,
|
||||
25590
|
||||
],
|
||||
"pigeon cage": [
|
||||
424,
|
||||
@@ -5971,7 +5975,7 @@
|
||||
8347,
|
||||
8642
|
||||
],
|
||||
"wooden telescope": [
|
||||
"oak telescope": [
|
||||
8348,
|
||||
8644
|
||||
],
|
||||
@@ -7536,7 +7540,8 @@
|
||||
"soft clay pack": [
|
||||
12009,
|
||||
12010,
|
||||
24851
|
||||
24851,
|
||||
25533
|
||||
],
|
||||
"black wizard robe": [
|
||||
12449,
|
||||
@@ -8264,7 +8269,8 @@
|
||||
],
|
||||
"bag of gems": [
|
||||
19473,
|
||||
24853
|
||||
24853,
|
||||
25537
|
||||
],
|
||||
"heavy ballista": [
|
||||
19481,
|
||||
@@ -9645,6 +9651,10 @@
|
||||
25242,
|
||||
25243
|
||||
],
|
||||
"essence pack": [
|
||||
25280,
|
||||
25535
|
||||
],
|
||||
"gnome child icon": [
|
||||
25319,
|
||||
25338
|
||||
@@ -9677,5 +9687,25 @@
|
||||
"gold coffin": [
|
||||
25467,
|
||||
25473
|
||||
],
|
||||
"celestial ring": [
|
||||
25539,
|
||||
25541
|
||||
],
|
||||
"celestial signet": [
|
||||
25543,
|
||||
25545
|
||||
],
|
||||
"tome of water": [
|
||||
25574,
|
||||
25576
|
||||
],
|
||||
"fish barrel": [
|
||||
25582,
|
||||
25584
|
||||
],
|
||||
"fish sack barrel": [
|
||||
25585,
|
||||
25587
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 469 B |
@@ -164,7 +164,14 @@ public class ChatCommandsPluginTest
|
||||
chatCommandsPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "theatre of blood", 73);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "theatre of blood", 37 * 60 + 4);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "theatre of blood", 37 * 60 + 4.0);
|
||||
|
||||
// Precise times
|
||||
ChatMessage chatMessagePrecise = 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.20</col> (Personal best!)", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessagePrecise);
|
||||
chatCommandsPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "theatre of blood", 37 * 60 + 4.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -177,7 +184,14 @@ public class ChatCommandsPluginTest
|
||||
chatCommandsPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "theatre of blood", 73);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "theatre of blood", 37 * 60 + 4);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "theatre of blood", 37 * 60 + 4.0);
|
||||
|
||||
// Precise times
|
||||
ChatMessage chatMessagePrecise = 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.00</col><br></col>Personal best: 37:04.40", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessagePrecise);
|
||||
chatCommandsPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "theatre of blood", 37 * 60 + 4.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -238,6 +252,7 @@ public class ChatCommandsPluginTest
|
||||
public void testPersonalBest()
|
||||
{
|
||||
final String FIGHT_DURATION = "Fight duration: <col=ff0000>2:06</col>. Personal best: 1:19.";
|
||||
final String FIGHT_DURATION_PRECISE = "Fight duration: <col=ff0000>2:06.40</col>. Personal best: 1:19.20.";
|
||||
|
||||
// This sets lastBoss
|
||||
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Kree'arra kill count is: <col=ff0000>4</col>.", null, 0);
|
||||
@@ -246,13 +261,20 @@ public class ChatCommandsPluginTest
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", FIGHT_DURATION, null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "kree'arra", 79);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "kree'arra", 79.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", FIGHT_DURATION_PRECISE, null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "kree'arra", 79.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPersonalBestNoTrailingPeriod()
|
||||
{
|
||||
final String FIGHT_DURATION = "Fight duration: <col=ff0000>0:59</col>. Personal best: 0:55";
|
||||
final String FIGHT_DURATION_PRECISE = "Fight duration: <col=ff0000>0:59.20</col>. Personal best: 0:55.40";
|
||||
|
||||
// This sets lastBoss
|
||||
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Zulrah kill count is: <col=ff0000>4</col>.", null, 0);
|
||||
@@ -261,13 +283,20 @@ public class ChatCommandsPluginTest
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", FIGHT_DURATION, null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "zulrah", 55);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "zulrah", 55.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", FIGHT_DURATION_PRECISE, null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "zulrah", 55.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNewPersonalBest()
|
||||
{
|
||||
final String NEW_PB = "Fight duration: <col=ff0000>3:01</col> (new personal best).";
|
||||
final String NEW_PB_PRECISE = "Fight duration: <col=ff0000>3:01.40</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);
|
||||
@@ -276,7 +305,13 @@ public class ChatCommandsPluginTest
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", NEW_PB, null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "kree'arra", 181);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "kree'arra", 181.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", NEW_PB_PRECISE, null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "kree'arra", 181.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -311,6 +346,7 @@ public class ChatCommandsPluginTest
|
||||
public void testAgilityLap()
|
||||
{
|
||||
final String NEW_PB = "Lap duration: <col=ff0000>1:01</col> (new personal best).";
|
||||
final String NEW_PB_PRECISE = "Lap duration: <col=ff0000>1:01.20</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);
|
||||
@@ -319,8 +355,14 @@ public class ChatCommandsPluginTest
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", NEW_PB, null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "prifddinas agility course", 61);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "prifddinas agility course", 61.0);
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "prifddinas agility course", 2);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", NEW_PB_PRECISE, null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "prifddinas agility course", 61.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -332,8 +374,13 @@ public class ChatCommandsPluginTest
|
||||
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("personalbest", "tzkal-zuk", 104 * 60 + 31.0);
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "tzkal-zuk", 2);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Duration: <col=ff0000>104:31.20</col> (new personal best)", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "tzkal-zuk", 104 * 60 + 31.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -345,8 +392,13 @@ public class ChatCommandsPluginTest
|
||||
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("personalbest", "tzkal-zuk", 134 * 60 + 52.0);
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "tzkal-zuk", 3);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Duration: <col=ff0000>172:18.40</col>. Personal best: 134:52.20", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "tzkal-zuk", 134 * 60 + 52.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -358,8 +410,17 @@ public class ChatCommandsPluginTest
|
||||
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("personalbest", "grotesque guardians", 96.0);
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "grotesque guardians", 179);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Fight duration: <col=ff0000>1:36.40</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.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -371,12 +432,21 @@ public class ChatCommandsPluginTest
|
||||
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("personalbest", "grotesque guardians", 2 * 60 + 14.0);
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "grotesque guardians", 32);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Fight duration: <col=ff0000>2:41.40</col>. Personal best: 2:14.20", 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.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGuantletPersonalBest()
|
||||
public void testGauntletPersonalBest()
|
||||
{
|
||||
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: <col=ff0000>10:24</col>. Personal best: 7:59.", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
@@ -385,11 +455,20 @@ public class ChatCommandsPluginTest
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "gauntlet", 124);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "gauntlet", 7 * 60 + 59);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "gauntlet", 7 * 60 + 59.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: <col=ff0000>10:24.20</col>. Personal best: 7:52.40.", 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", 7 * 60 + 52.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGuantletNewPersonalBest()
|
||||
public void testGauntletNewPersonalBest()
|
||||
{
|
||||
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: <col=ff0000>10:24</col> (new personal best).", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
@@ -397,8 +476,17 @@ public class ChatCommandsPluginTest
|
||||
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("personalbest", "gauntlet", 10 * 60 + 24.0);
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "gauntlet", 124);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: <col=ff0000>10:24.40</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.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -411,7 +499,16 @@ public class ChatCommandsPluginTest
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "chambers of xeric", 51);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 37 * 60 + 4);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 37 * 60 + 4.0);
|
||||
|
||||
// Precise times
|
||||
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.20</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("personalbest", "chambers of xeric", 37 * 60 + 4.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -424,7 +521,16 @@ public class ChatCommandsPluginTest
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "chambers of xeric", 52);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 20 * 60 + 19);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 20 * 60 + 19.0);
|
||||
|
||||
// Precise times
|
||||
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.40</col> Personal best: </col><col=ff0000>20:19.20</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("personalbest", "chambers of xeric", 20 * 60 + 19.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -435,7 +541,7 @@ public class ChatCommandsPluginTest
|
||||
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);
|
||||
when(configManager.getRSProfileConfiguration(anyString(), anyString(), any(Class.class))).thenReturn(2224.0);
|
||||
|
||||
WidgetLoaded advLogEvent = new WidgetLoaded();
|
||||
advLogEvent.setGroupId(ADVENTURE_LOG_ID);
|
||||
@@ -470,14 +576,14 @@ public class ChatCommandsPluginTest
|
||||
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);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "tztok-jad", 38 * 60 + 10.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "zulrah", 5 * 60 + 48.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "vorkath", 60 + 21.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "grotesque guardians", 2 * 60 + 49.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hespori", 57.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "nightmare", 3 * 60 + 30.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 24 * 60 + 17.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric challenge mode", 22 * 60 + 15.0);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -522,12 +628,62 @@ public class ChatCommandsPluginTest
|
||||
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);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "tztok-jad", 65 * 60 + 12.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "zulrah", 2 * 60 + 55.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "vorkath", 60 + 37.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hespori", 60 + 42.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 21 * 60 + 23.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric challenge mode", 21 * 60 + 26.0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAdventurerLogCountersPagePrecise()
|
||||
{
|
||||
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.00</col>" +
|
||||
"<br><br>Inferno<br>Fastest run: <col=d0c0b0>-</col><br><br>Zulrah<br>" +
|
||||
"Fastest kill: <col=d0c0b0>2:55.20</col><br><br>Vorkath<br>Fastest kill: <col=d0c0b0>1:37.20</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.40</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.20</col><br>Fastest run - (Team size: 3 players): <col=d0c0b0>27:16.40</col>" +
|
||||
"<br><br>Chambers of Xeric - Challenge mode<br>Fastest run - (Team size: Solo): <col=d0c0b0>34:30.20</col><br>Fastest run - (Team size: 4 players): <col=d0c0b0>21:26.00</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.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "zulrah", 2 * 60 + 55.2);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "vorkath", 60 + 37.2);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hespori", 60 + 42.40);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric", 21 * 60 + 23.20);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "chambers of xeric challenge mode", 21 * 60 + 26.0);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -580,7 +736,13 @@ public class ChatCommandsPluginTest
|
||||
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);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 1", 28.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 1 time: <col=ff0000>1:19.20</col>. Personal best: 0:28.40", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 1", 28.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -589,7 +751,13 @@ public class ChatCommandsPluginTest
|
||||
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);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 2", 47.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 2 time: <col=ff0000>0:47.20</col> (new personal best)", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 2", 47.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -598,8 +766,15 @@ public class ChatCommandsPluginTest
|
||||
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);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 4 * 60 + 46.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 9 * 60 + 53.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 5 time: <col=ff0000>4:46.20</col> (new personal best)<br>Overall time: <col=ff0000>9:53.40</col> (new personal best)<br>", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 4 * 60 + 46.2);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 9 * 60 + 53.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -608,8 +783,15 @@ public class ChatCommandsPluginTest
|
||||
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);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 3 * 60 + 26.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 9 * 60 + 15.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 5 time: <col=ff0000>3:26.20</col> (new personal best)<br>Overall time: <col=ff0000>9:17.00</col>. Personal best: 9:15.40<br>", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 3 * 60 + 26.2);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 9 * 60 + 15.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -618,8 +800,15 @@ public class ChatCommandsPluginTest
|
||||
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);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 3 * 60 + 5.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 7 * 60 + 49.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 5 time: <col=ff0000>3:56.40</col>. Personal best: 3:05.20<br>Overall time: <col=ff0000>9:14.20</col>. Personal best: 7:49.20<br>", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 3 * 60 + 5.2);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 7 * 60 + 49.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -628,26 +817,33 @@ public class ChatCommandsPluginTest
|
||||
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);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 3 * 60 + 4.0);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 7 * 60 + 47.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Floor 5 time: <col=ff0000>3:10.00</col>. Personal best: 3:04.40<br>Overall time: <col=ff0000>7:47.20</col> (new personal best)<br>", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre floor 5", 3 * 60 + 4.4);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "hallowed sepulchre", 7 * 60 + 47.2);
|
||||
}
|
||||
|
||||
@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);
|
||||
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "You have completed Floor 5 of the Hallowed Sepulchre! Total completions: <col=ff0000>1,114</col>.", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "hallowed sepulchre floor 5", 81);
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "hallowed sepulchre floor 5", 1114);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHsGhcKc()
|
||||
{
|
||||
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "You have opened the Grand Hallowed Coffin <col=ff0000>36</col> times!", null, 0);
|
||||
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "You have opened the Grand Hallowed Coffin <col=ff0000>1,542</col> times!", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "hallowed sepulchre", 36);
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "hallowed sepulchre", 1542);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -662,8 +858,14 @@ public class ChatCommandsPluginTest
|
||||
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("personalbest", "tztok-jad", 21 * 60 + 58.0);
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "tztok-jad", 2);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Duration: <col=ff0000>21:58.40</col> (new personal best)", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "tztok-jad", 21 * 60 + 58.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -676,7 +878,13 @@ public class ChatCommandsPluginTest
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 1);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 60 + 46);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 60 + 46.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: <col=ff0000>1:46.40</col> (new personal best)", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 60 + 46.4);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -689,6 +897,25 @@ public class ChatCommandsPluginTest
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("killcount", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 3);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 59);
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 59.0);
|
||||
|
||||
// Precise times
|
||||
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: <col=ff0000>1:10.00</col>. Personal best: <col=ff0000>0:59.20</col>", null, 0);
|
||||
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 59.2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTimeStringToSeconds()
|
||||
{
|
||||
final double DELTA = 0.0001;
|
||||
|
||||
// ss
|
||||
assertEquals(55.0, ChatCommandsPlugin.timeStringToSeconds("55.00"), DELTA);
|
||||
// mm:ss
|
||||
assertEquals(6 * 60 + 55.4, ChatCommandsPlugin.timeStringToSeconds("6:55.40"), DELTA);
|
||||
// h:mm:ss
|
||||
assertEquals(2 * 3600 + 50 * 60 + 30.2, ChatCommandsPlugin.timeStringToSeconds("2:50:30.20"), DELTA);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user