Jump to content

Onmessage Problem


Supercharger

Recommended Posts

public void onMessage(Message m) {
@SuppressWarnings("unused")
NPC FishingSpot = npcs.closest(FISHING_SPOT);
if (m.getType() == MessageType.GAME) {
String c = m.getMessage().toLowerCase();
try {
if (c.contains("you catch a salmon.")
|| (c.contains("you catch a trout."))) {
fishCaught++;
} else if (c.contains("i can't reach that!")
|| (c.contains("I can't reach that!"))) {
state = "Can't Reach Object - Report to Supercharger...";
failed++;
FishingSpot = null;
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

 

So my OnMessage is working all correctly theres just one problem, If there is already that case in the chatbox even if the script hasn't started fishing yet it will still say that x amount have been caught. I know it's not a major issue but having false proggies is not something I want.

 

Any suggests?

 

cheers.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...