• Visit Rebornbuddy
  • Two questions about writing in CS

    Discussion in 'Community Developer Forum' started by MiraiKuma, Aug 18, 2015.

    1. MiraiKuma

      MiraiKuma New Member

      Joined:
      Aug 2, 2015
      Messages:
      16
      Likes Received:
      5
      Trophy Points:
      3
      I am a C#.net developer. Self taught so I don't know many technical terms. I have been able to write a rom name parser and .dat parser so I could sort my own roms though. I've also written some successful programs at work and finally gotten the hang of asynchronous functions. Asynchronous is hard to understand when you are a newbie self taught guy. . . .

      Any who I'm looking to edit the chocobot. In the following example, how does the person know what MessageType to look for? I looked at the https://www.thebuddyforum.com/rebor...r-forum/184412-rebornbuddy-documentation.html and coudl not find MessageType 2238. I thought what I might be looking for is detrimental effects, but I don't think it is that MessageType. I'm trying to parse when my chocobo gets a negative effect so I can press the 2 button for ensuna.

      Secondly, just to test out that my changes were being read I changed one of his logs that report the amount of MGP you earn from "Chocovot v1.0.0 Obtained MGP!" to "Chocovot v1.0.0 Obtained MGP!AAAAAA" Just because it is a simple way to see if my changes were being read. However even after exiting RebornBuddy and restarting it, it still doesn't have my AAAAA. Is there something further I need to do to get it to re-read the C# scipts?


      These are my edits. The first in theory should work. I don't see why it wouldn't.

      private void RecieveMessage(object sender, ChatEventArgs e)
      {
      if (e.ChatLogEntry.MessageType == (MessageType)2238 && e.ChatLogEntry.Contents.Contains("You obtain") && e.ChatLogEntry.Contents.Contains("MGP"))
      {
      var mgp = e.ChatLogEntry.Contents.Substring(11, (e.ChatLogEntry.Contents.Length - 16));
      Logging.Write(Colors.SandyBrown, "[Chocobot v" + Version.ToString() + "] Obtained " + mgp + " MGP!AAAAAAAAA");
      }

      if (e.ChatLogEntry.Contents.Contains("Indigo Biscuit suffers"))
      {
      Logging.Write(Colors.SandyBrown, "I am detecting this.");
      }
      }
       
    2. Wheredidigo

      Wheredidigo Community Developer

      Joined:
      Dec 15, 2013
      Messages:
      417
      Likes Received:
      8
      Trophy Points:
      18
      The first thing you need to realize is that the Enums that come with RB are NOT complete Enums. The values that are defined are only the ones that Mastahg has managed to figure out/reverse engineer. I'm sure that Kaga just did his own reverse engineering to figure out that the MessageType should be 2238. Also, parsing the chat log to try and find when you need to dispel a debuff off your chocobo is not a good way to do it. You should use the GameObjectManager to find your Chocobo and then scan the aura's that are on it. Then have a lookup dictionary to see if any of the aura's on the chocobo are in that dictionary and if they are, then you cast esuna on it. But in all honesty, that should probably be built into a CombatRoutine.

      Unfortunately, there really isn't very many good example's to go thru to try and learn this kind of stuff. If you're wanting to get into developing new things for RebornBuddy, I highly recommend do research on BehaviorTree's and Coroutines. Once you understand how a behavior tree works and how you can write your own behaviors using coroutines and then how to hook those behaviors onto the root tree, you will be able to pretty much whatever you want with the bot.
       
    3. MiraiKuma

      MiraiKuma New Member

      Joined:
      Aug 2, 2015
      Messages:
      16
      Likes Received:
      5
      Trophy Points:
      3
      t. Thank you for your help.
       
      Last edited: Aug 18, 2015

    Share This Page