• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • GamelogManager - Completed Venture

    Discussion in 'Community Developer Forum' started by newb23, Mar 19, 2015.

    1. newb23

      newb23 Community Developer

      Joined:
      Nov 26, 2014
      Messages:
      397
      Likes Received:
      15
      Trophy Points:
      18
      Good morning!

      I am looking at integrating the ability to add a catch to my Plugin, Slavebot, to watch chat for the completed venture message instead of using an arbitrary loop method, however, I know not which of the message types those messages fall under, if any.

      My guess would be EchoRecieved or MessageRecieved, but if I could get confirmation I would appreciate it much!

      Thank you!
       
      Last edited: Mar 29, 2015
    2. kagamihiiragi17

      kagamihiiragi17 Community Developer

      Joined:
      Jun 24, 2014
      Messages:
      873
      Likes Received:
      25
      Trophy Points:
      0
      Run the following code in Reborn Console when you have a completed venture line in your chat box:

      Code:
      foreach(var entry in ff14bot.Managers.GamelogManager.CurrentBuffer)
      {
      	Log("Type: " + entry.MessageType + ", Message: " + entry.Contents);
      }
      Check the message type, it will probably be a number. Add the following code to your plugin OnStart:

      Code:
      GamelogManager.MessageRecevied += YourRecieveMessageFunction;
      And this can be your function:

      Code:
      private void ReceiveMessage(object sender, ChatEventArgs e)
      {
      	if (e.ChatLogEntry.MessageType == (MessageType)[COLOR="#FF0000"]1234[/COLOR] && e.ChatLogEntry.Contents.IndexOf("has completed a venture!") > 0)
      	{
      		// Your code here to do something after receiving a message
      	}
      }
      
      Replace the red numbers with your message type. Also the IndexOf code is untested but that concept should work.
       
    3. newb23

      newb23 Community Developer

      Joined:
      Nov 26, 2014
      Messages:
      397
      Likes Received:
      15
      Trophy Points:
      18
      Thank you for your code snippets on the chat manager portion of my fledgling project. I think, THINK, they are implemented properly now and are doing what they are supposed to, but, due to the nature of this plugin, it takes a loooong time to test each change I make. :p

      That being said, I am running into another issue.

      I have added a couple of lines to teleport the bot to Revenants Toll, which works properly, but I cannot get it to actually run to the Summoning Bell.

      I've tried to look up how to declare and utilize the Vector3 data for Navigator.MoveTo, but I seem to be missing something crucial, as when I run the bot, I get:

      [HIDE]
      Code:
      [14:04:07.914 D] Exception while pulsing plugin Slavebot9001: Buddy.Coroutines.CoroutineUnhandledException: Exception was thrown by coroutine ---> System.InvalidOperationException: NavigationProvider cannot be null!   at ff14bot.Navigation.Navigator.MoveTo(Vector3 location, String destination)
         at Slavebot9001.Slavebot9001.<MainLoop>d__2.MoveNext() in c:\Users\Omni\Desktop\RB\Plugins\Slavebot9001\Slavebot9001.cs:line 87
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Buddy.Coroutines.Coroutine.<>c__DisplayClass1.<<ReturnsNullWrapper>b__0>d__3.MoveNext()
         --- End of inner exception stack trace ---
         at Buddy.Coroutines.Coroutine.CheckPostConditions(Boolean shouldBeCanceled)
         at Buddy.Coroutines.Coroutine.Resume(Boolean forStop)
         at Buddy.Coroutines.Coroutine.Resume()
         at Slavebot9001.Slavebot9001.OnPulse() in c:\Users\Omni\Desktop\RB\Plugins\Slavebot9001\Slavebot9001.cs:line 69
         at ff14bot.Managers.PluginManager.PulsePlugin(IBotPlugin plugin)
      [14:04:07.929 N] [Ultima] Loading: Ninja
      [14:04:07.947 D] Exception while pulsing plugin Slavebot9001: Buddy.Coroutines.CoroutineUnhandledException: Exception was thrown by coroutine ---> System.InvalidOperationException: NavigationProvider cannot be null!
         at ff14bot.Navigation.Navigator.MoveTo(Vector3 location, String destination)
         at Slavebot9001.Slavebot9001.<MainLoop>d__2.MoveNext() in c:\Users\Omni\Desktop\RB\Plugins\Slavebot9001\Slavebot9001.cs:line 87
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Buddy.Coroutines.Coroutine.<>c__DisplayClass1.<<ReturnsNullWrapper>b__0>d__3.MoveNext()
         --- End of inner exception stack trace ---
         at Buddy.Coroutines.Coroutine.CheckPostConditions(Boolean shouldBeCanceled)
         at Buddy.Coroutines.Coroutine.Resume(Boolean forStop)
         at Buddy.Coroutines.Coroutine.Resume()
         at Slavebot9001.Slavebot9001.OnPulse() in c:\Users\Omni\Desktop\RB\Plugins\Slavebot9001\Slavebot9001.cs:line 69
         at ff14bot.Managers.PluginManager.PulsePlugin(IBotPlugin plugin)
      [14:04:09.705 N] Stopping the bot. Reason:Pushed the stop button.
      [14:04:09.705 D] CurrentBot.Stop()
      [14:04:09.705 D] Exception while pulsing plugin Slavebot9001: Buddy.Coroutines.CoroutineUnhandledException: Exception was thrown by coroutine ---> System.InvalidOperationException: NavigationProvider cannot be null!
         at ff14bot.Navigation.Navigator.MoveTo(Vector3 location, String destination)
         at Slavebot9001.Slavebot9001.<MainLoop>d__2.MoveNext() in c:\Users\Omni\Desktop\RB\Plugins\Slavebot9001\Slavebot9001.cs:line 87
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Buddy.Coroutines.Coroutine.<>c__DisplayClass1.<<ReturnsNullWrapper>b__0>d__3.MoveNext()
         --- End of inner exception stack trace ---
         at Buddy.Coroutines.Coroutine.CheckPostConditions(Boolean shouldBeCanceled)
         at Buddy.Coroutines.Coroutine.Resume(Boolean forStop)
         at Buddy.Coroutines.Coroutine.Resume()
         at Slavebot9001.Slavebot9001.OnPulse() in c:\Users\Omni\Desktop\RB\Plugins\Slavebot9001\Slavebot9001.cs:line 69
         at ff14bot.Managers.PluginManager.PulsePlugin(IBotPlugin plugin)
      [/HIDE]

      I have tried to declare them as Float values, Integers, and as a String, but, no dice yet.

      I have also attached the next iteration of code, unfortunately, this one is another working copy, not ready for release for the problem stated above, as well as in the other thread.

      Any insight you have to offer would be greatly appreciated, thank you!
      newb

      EDIT: Solved. I simply put everything regarding the moving into my OnPulse() and set up a couple of if statements to make sure they only get called on when necessary.
       
      Last edited: Apr 13, 2015

    Share This Page