Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
loottracker: Add master farmer (#1991)
Browse files Browse the repository at this point in the history
  • Loading branch information
Owain94 authored and Ganom committed Nov 10, 2019
1 parent 87fbba6 commit 1159242
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ public class LootTrackerPlugin extends Plugin
private static final String GAUNTLET_EVENT = "The Gauntlet";
private static final int GAUNTLET_LOBBY_REGION = 12127;

private static final String MASTER_FARMER_EVENT = "Master farmer";

// Chest loot handling
private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!";
private static final Pattern LARRAN_LOOTED_PATTERN = Pattern.compile("You have opened Larran's (big|small) chest .*");
Expand Down Expand Up @@ -939,6 +941,12 @@ private void onChatMessage(ChatMessage event)
int killCount = Integer.parseInt(boss.group(2));
killCountMap.put(bossName.toUpperCase(), killCount);
}

if (chatMessage.equals("You pick the Master Farmer's pocket."))
{
eventType = MASTER_FARMER_EVENT;
takeInventorySnapshot();
}
}

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -1001,7 +1009,8 @@ public void onItemContainerChanged(ItemContainerChanged event)
|| HERBIBOAR_EVENT.equals(eventType)
|| HESPORI_EVENT.equals(eventType)
|| GAUNTLET_EVENT.equals(eventType)
|| WINTERTODT_EVENT.equals(eventType))
|| WINTERTODT_EVENT.equals(eventType)
|| MASTER_FARMER_EVENT.equals(eventType))
{
if (event.getItemContainer() != client.getItemContainer(InventoryID.INVENTORY))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ private void createPanel(final Collection<LTRecord> records, final boolean recon

switch (name)
{
case "master farmer":
currentText = "Current pick-pocket count:";
loggedText = "Pickpockets logged:";
break;
case "Wintertodt":
currentText = "Current Killcount:";
loggedText = "Crates logged:";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ private void onChatMessage(ChatMessage event)

session.updateLastThevingAction();
session.hasSucceeded();

}
else if (message.startsWith("You fail to pickpocket") || message.startsWith("You fail to pick-pocket") || message.startsWith("You fail to steal"))
else if (message.startsWith("You fail to pick") || message.startsWith("You fail to steal"))
{
if (session == null)
{
Expand Down

0 comments on commit 1159242

Please sign in to comment.