@@ -28,9 +28,9 @@ public class Idler {
2828 * Waits until either the specified timeout has elapsed or until the client chatbox reports that
2929 * the player is idle.
3030 *
31- * <p>Specifically, this method monitors the "Latest Message" tab in the chatbox for a red message
32- * containing the substring {@code "idle"}, which typically appears in the client message {@code
33- * "You are now idle!"}.
31+ * <p>Specifically, this method monitors the "Latest Message" zone in the chatbox for a red message
32+ * containing the substring {@code "idle"} or {@code "moving"} , which typically appears when
33+ * using the Idle Notifier plugin
3434 *
3535 * @param base the active {@link BaseScript} instance, usually passed as {@code this}
3636 * @param timeoutSeconds the maximum number of seconds to remain idle before continuing
@@ -43,9 +43,12 @@ public static void waitUntilIdle(BaseScript base, int timeoutSeconds) {
4343 while (Instant .now ().isBefore (deadline )) {
4444 Rectangle latestMessage = base .controller ().zones ().getChatTabs ().get ("Latest Message" );
4545 ColourObj red = ColourInstances .getByName ("ChatRed" );
46- String ocr = Ocr .extractText (latestMessage , "Plain 12" , red , true );
47- if ((ocr .contains ("moving" ) || ocr .contains ("idle" )) && !ocr .equals (lastMessage )) {
48- lastMessage = ocr ;
46+ ColourObj black = ColourInstances .getByName ("Black" );
47+ String idleText = Ocr .extractText (latestMessage , "Plain 12" , red , true );
48+ String timeStamp = Ocr .extractText (latestMessage , "Plain 12" , black , true );
49+ logger .info (String .format ("Idle: %s - %s" , idleText , timeStamp ));
50+ if ((idleText .contains ("moving" ) || idleText .contains ("idle" )) && !timeStamp .equals (lastMessage )) {
51+ lastMessage = timeStamp ;
4952 return ;
5053 }
5154 }
0 commit comments