Skip to content

Commit b73b3e5

Browse files
authored
Fix comparison in Idler (#40)
Defensively compare strings using .equals() to ensure that string content is compared.
1 parent 60267ea commit b73b3e5

File tree

1 file changed

+1
-1
lines changed
  • src/main/java/com/chromascape/utils/actions

1 file changed

+1
-1
lines changed

src/main/java/com/chromascape/utils/actions/Idler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static void waitUntilIdle(BaseScript base, int timeoutSeconds) {
4444
Rectangle latestMessage = base.controller().zones().getChatTabs().get("Latest Message");
4545
ColourObj red = ColourInstances.getByName("ChatRed");
4646
String ocr = Ocr.extractText(latestMessage, "Plain 12", red, true);
47-
if ((ocr.contains("moving") || ocr.contains("idle")) && ocr != lastMessage) {
47+
if ((ocr.contains("moving") || ocr.contains("idle")) && !ocr.equals(lastMessage)) {
4848
lastMessage = ocr;
4949
return;
5050
}

0 commit comments

Comments
 (0)