• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Engineering - synapse springs use?

    Discussion in 'Requests' started by balabanbal, May 19, 2013.

    1. balabanbal

      balabanbal New Member

      Joined:
      Jan 25, 2011
      Messages:
      27
      Likes Received:
      0
      Trophy Points:
      0
      Is there an addon that uses engineering perk synpase springs, that you put on gloves, on cooldown?
       
    2. Bloodyfinale

      Bloodyfinale New Member

      Joined:
      Aug 18, 2012
      Messages:
      138
      Likes Received:
      3
      Trophy Points:
      0
      I wrote a little Plugin for you. Which should handle you problem. I had no time for testing. I wasn't sure at which equipslot the item is which has to be used. So if there is a Problem change the ID of the Slot to any slot you need. I had no time for testing.
      Code:
      using Styx;
      using Styx.Common;
      using Styx.CommonBot;
      using Styx.CommonBot.Routines;
      using Styx.MemoryManagement;
      using Styx.WoWInternals;
      using Styx.WoWInternals.WoWObjects;
      using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows.Media;
      using System;
      using System.Collections.Generic;
      using System.Threading;
      using System.Linq;
      using System.Xml.Linq;
      using System.Diagnostics;
      using System.IO;
      using System.Xml;
      using System.ComponentModel;
      using System.Data;
      using System;
      using System.Linq;
      using CommonBehaviors.Actions;
      using Styx;
      using Styx.CommonBot;
      using Styx.Pathing;
      using Styx.TreeSharp;
      using Styx.WoWInternals;
      using Styx.WoWInternals.WoWObjects;
      using Action = Styx.TreeSharp.Action;
      using System.Drawing;
      using Styx;
      using Styx.Common;
      using Styx.CommonBot;
      using Styx.Helpers;
      using Styx.WoWInternals;
      using Styx.WoWInternals.WoWObjects;
      using Styx.Plugins;
      using Styx.Common.Plugins;
      using Styx.CommonBot.Inventory;
      using CommonBehaviors.Actions;
      using Styx.Common.Helpers;
      using Styx.Helpers;
      using Styx.Pathing;
      using Styx.TreeSharp;
      
      
      
      namespace SynapseUse
      {
          public class SynapseUse : HBPlugin
          {
              #region Globals
      
              public override string Name { get { return "Use synapse springs"; } }
              public override string Author { get { return "Bloodyfinale"; } }
              public override Version Version { get { return new Version(1, 0, 0, 1); } }
              public override string ButtonText { get { return "No options ;D"; } }
              public override bool WantButton { get { return false; } }
              private static LocalPlayer Me { get { return StyxWoW.Me; } }
              #endregion
      
              private static Composite UseEquippedItem(uint slot)
              {
                  return new PrioritySelector(
                             ctx => StyxWoW.Me.Inventory.GetItemBySlot(slot),
                             new Decorator(
                                 ctx => ctx != null && CanUseEquippedItem((WoWItem)ctx),
                                 new Action(ctx => UseItem((WoWItem)ctx))));
              }
              private static void UseItem(WoWItem item)
              {
                  if (item != null)
                  {
                      item.Use();
                  }
              }
              private static bool CanUseEquippedItem(WoWItem item)
              {
                  try
                  {
                      var itemSpell = Lua.GetReturnVal<string>("return GetItemSpell(" + item.Entry + ")", 0);
                      if (string.IsNullOrEmpty(itemSpell))
                          return false;
      
                      return item.Usable && item.Cooldown <= 0;
                  }
                  catch
                  {
                      return false;
                  }
              }
      
              public override void Pulse()
              {
                  if (Me.Combat
                      && Me.CurrentTarget != null){
      				UseEquippedItem(10);
              }
          }
      }
      }
      
       
    3. handnavi

      handnavi Well-Known Member Buddy Store Developer

      Joined:
      Jan 15, 2010
      Messages:
      2,489
      Likes Received:
      59
      Trophy Points:
      48
      Dont forget to give credits if you just copy & paste stuff...:D:p
       
    4. stuartroad

      stuartroad Member

      Joined:
      Feb 17, 2013
      Messages:
      302
      Likes Received:
      1
      Trophy Points:
      18
      i think a lot of rotations include this?
       
    5. balabanbal

      balabanbal New Member

      Joined:
      Jan 25, 2011
      Messages:
      27
      Likes Received:
      0
      Trophy Points:
      0
      thank you but where do i put this?
       
    6. balabanbal

      balabanbal New Member

      Joined:
      Jan 25, 2011
      Messages:
      27
      Likes Received:
      0
      Trophy Points:
      0
      I figured out how to use it as a plugin but it wont work. Gloves equipment slot id is 11 btw. I changed it. Also I noticed the new hb release have an option for this as well. But that doenst work either. I tried evey setting.
       
    7. handnavi

      handnavi Well-Known Member Buddy Store Developer

      Joined:
      Jan 15, 2010
      Messages:
      2,489
      Likes Received:
      59
      Trophy Points:
      48
      This works for me:

      Code:
      using System;
      using Styx;
      using Styx.Plugins;
      using Styx.WoWInternals;
      using Styx.WoWInternals.WoWObjects;
      
      namespace Synapse
      {
          public class SynapseUse : HBPlugin
          {
              #region Globals
      
              public override string Name
              {
                  get { return "Use synapse springs"; }
              }
      
              public override string Author
              {
                  get { return "Nobody"; }
              }
      
              public override Version Version
              {
                  get { return new Version(1, 0, 0, 1); }
              }
      
              public override bool WantButton
              {
                  get { return false; }
              }
      
              #endregion
      
              private static void use_item()
              {
                  WoWItem item = StyxWoW.Me.Inventory.GetItemBySlot((uint) WoWInventorySlot.Hands);
                  if (item == null) return;
                  var itemSpell = Lua.GetReturnVal<string>("return GetItemSpell(" + item.Entry + ")", 0);
                  if (string.IsNullOrEmpty(itemSpell))
                      return;
                  if (!item.Usable || !(item.Cooldown <= 0)) return;
                  item.Use();
              }
      
              public override void Pulse()
              {
                  if (StyxWoW.Me.Combat
                      && StyxWoW.Me.CurrentTarget != null)
                  {
                      use_item();
                  }
              }
          }
      }
      
      Put it in a File called Synapse.cs

      Copied it from Singular / CLU :C
       
    8. Mirabis

      Mirabis Community Developer

      Joined:
      Jun 14, 2010
      Messages:
      4,475
      Likes Received:
      86
      Trophy Points:
      48
      Code:
      
       public enum WoWInventorySlot
          {
              Head = 0,
              Neck = 1,
              Shoulder = 2,
              Shirt = 3,
              Chest = 4,
              Waist = 5,
              Legs = 6,
              Feet = 7,
              Wrist = 8,
              Hands = 9,
              Finger1 = 10,
              Finger2 = 11,
              Trinket1 = 12,
              Trinket2 = 13,
              Back = 14,
              MainHand = 15,
              OffHand = 16,
              Ranged = 17,
              Tabard = 18,
              Bag1 = 19,
              Bag2 = 20,
              Bag3 = 21,
              Bag4 = 22,
          }
      
      It probably didn't work after u changed the slot.

      PHP:
      (uint)WoWInventorySlot.Hands
      Should be used to prevent confusion ;)
       
      Last edited: May 19, 2013
    9. balabanbal

      balabanbal New Member

      Joined:
      Jan 25, 2011
      Messages:
      27
      Likes Received:
      0
      Trophy Points:
      0
      ty it works
       

    Share This Page