chat commands: fix detecting pb when completing leagues tasks
The league task message is in between the kc and pb messages, so just look for the pb message on the same tick as the kc message
This commit is contained in:
@@ -137,6 +137,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
private String pohOwner;
|
||||
private HiscoreEndpoint hiscoreEndpoint; // hiscore endpoint for current player
|
||||
private String lastBossKill;
|
||||
private int lastBossTime = -1;
|
||||
private int lastPb = -1;
|
||||
|
||||
@Inject
|
||||
@@ -197,6 +198,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
public void shutDown()
|
||||
{
|
||||
lastBossKill = null;
|
||||
lastBossTime = -1;
|
||||
|
||||
keyManager.unregisterKeyListener(chatKeyboardListener);
|
||||
|
||||
@@ -279,6 +281,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
else
|
||||
{
|
||||
lastBossKill = boss;
|
||||
lastBossTime = client.getTickCount();
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -310,6 +313,7 @@ public class ChatCommandsPlugin extends Plugin
|
||||
lastPb = -1;
|
||||
}
|
||||
lastBossKill = boss;
|
||||
lastBossTime = client.getTickCount();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -428,7 +432,11 @@ public class ChatCommandsPlugin extends Plugin
|
||||
setKc("Hallowed Sepulchre", kc);
|
||||
}
|
||||
|
||||
lastBossKill = null;
|
||||
if (lastBossKill != null && lastBossTime != client.getTickCount())
|
||||
{
|
||||
lastBossKill = null;
|
||||
lastBossTime = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private static int timeStringToSeconds(String timeString)
|
||||
|
||||
Reference in New Issue
Block a user