No announcement yet.

code test

  • Filter
  • Time
  • Show
Clear All
new posts

  • code test

     using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using Buddy.Coroutines; using ff14bot.AClasses; using ff14bot.Behavior; using ff14bot.Enums; using ff14bot.Helpers; using ff14bot.Managers; using TreeSharp;  namespace BetterCoroutineExample {      public class BetterCoroutineExample : BotPlugin     {         internal async Task<bool> DoSomething()         {              foreach (var bagslot in InventoryManager.EquippedItems)             {                 if (bagslot.BagId == InventoryBagId.Armory_MainHand)                     continue;                  if (bagslot.SpiritBond >= 100)                 {                     await CommonTasks.ConvertToMateria(bagslot);                 }             }             //Don't block the logic below us in the tree.             return false;         }          public override void Dispose()         {         }          public override void Pulse()         {          }          public override string Author         {             get { return "Mastahg"; }         }          public override Version Version         {             get { return new Version(0, 0, 1); }         }          public override string Name         {             get { return "Better Coroutine example"; }         }           private Composite _coroutine;         public void OnInitialize()         {             //OnInitialize only gets called once, so create the object here so that it can be properly removed later.             _coroutine = new ActionRunCoroutine(r => DoSomething());         }           public override void OnShutdown()         {          }           public override void OnDisabled()         {             //Remove our event handler and remove our coroutine from the logic tree             TreeHooks.Instance.OnHooksCleared -= OnHooksCleared;             TreeHooks.Instance.RemoveHook("TreeStart", _coroutine);         }          public override void OnEnabled()         {             //Add our hook to the logic tree here and setup event handler for when the treehooks are cleared             //We want to add our hook here incase the user enables the plugin once the bot is already running.             TreeHooks.Instance.AddHook("TreeStart", _coroutine);             TreeHooks.Instance.OnHooksCleared += OnHooksCleared;         }          private void OnHooksCleared(object sender, EventArgs args)         {             TreeHooks.Instance.AddHook("TreeStart", _coroutine);         }      }  }

  • #2
    This is a known issue. Switching to source code mode in the editor is a workaround. It is the left most icon in the editor toolbar.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud customization and demonstration site.
    vBulletin 5 Documentation - Updated every Friday. Report issues here.
    vBulletin 5 API - Full / Mobile
    I am not currently available for vB Messenger Chats.


    • #3
      if comment then go pin topic


      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.