• Visit Rebornbuddy
  • Question about reading message from chat log and message type

    Discussion in 'Community Developer Forum' started by themarketguy, Aug 2, 2015.

    1. themarketguy

      themarketguy New Member

      Joined:
      Jun 24, 2015
      Messages:
      117
      Likes Received:
      0
      Trophy Points:
      0
      Good afternoon, I think this is a pretty basic question, I'm trying to ever so slightly improve the Fish.cs library because I've been encountering a different "error" when fishing at random. Occassionally I receive a message that states: "You do not sense any fish here."

      Obviously this is different than the message most people are used to seeing, which is that the fish sense something is amiss. Unfortunately, once the message starts, every subsequent cast attempt receives the message (and this is a valid location with confirmed fish catches prior to the message beginning.

      So, I would like to add a catch for this message to force the profile to the next fishing location when this is received but I'm not entirely sure what "message type" is referring to in the following code block. Is there a way to extract message types that I'm overlooking, or is the message type correct and I just need to add the text condition for my error message?

      Code:
      		private void ReceiveMessage(object sender, ChatEventArgs e)
              {
                  if (e.ChatLogEntry.MessageType == (MessageType)2115 && e.ChatLogEntry.Contents == "The fish sense something amiss. Perhaps it is time to try another location.")
                  {
      				Logging.Write(Colors.Gold, "[Fish v" + Version.ToString() +"] The fish sense something amiss!");
      				amissfish++;
      				Actionmanager.DoAction(299, Core.Player);
                      ChangeFishSpot();
      				spotinit = false;
                  }
              }
      
      Seems like a simple thing to add, I just can't forcefully recreate the situation and would like to make sure that I implement the correct logic (obviously thousands of casts that don't work seems a little suspect ;)

      Thanks for any assistance.
       
    2. themarketguy

      themarketguy New Member

      Joined:
      Jun 24, 2015
      Messages:
      117
      Likes Received:
      0
      Trophy Points:
      0
      Disregard, finally found an older entry about gamelogmanager for outputting all current chat log elements, confirmed it is 2115.

      please close/delete this thread.
       

    Share This Page