• Visit Rebornbuddy
  • Different problem between V714 and V1716.

    Discussion in 'Honorbuddy Support' started by bigofsmall, Dec 23, 2013.

    1. bigofsmall

      bigofsmall New Member

      Joined:
      Jan 14, 2011
      Messages:
      53
      Likes Received:
      0
      Trophy Points:
      0
      Hi guys,
      I found one problem when I farm in one position.
      When I use V714 it can run around and cast the spell "Rain of Fire" smoothly, but when I use V716 it'll stay in Hotspot and wait 1-2s to cast the spell "Rain of Fire".
      kindly notice I use the same code in both version!
      Sincerly hope developping team can solve this problem. Follow are some simple code for your reference:
      Code:
      if (Me.IsMoving && !SpellManager.GlobalCooldown)
                  {
                      if (FindPullTarget(35))
                      {
                          SpellManager.Cast("Rain of Fire");
                          StyxWoW.SleepForLagDuration();
                          SpellManager.ClickRemoteLocation(Me.CurrentTarget.Location);
                          StyxWoW.SleepForLagDuration();
                          Me.ClearTarget();
                          Logging.Write("拉怪");
                      }
                      else if (Me.Combat)
                      {
                          SpellManager.Cast("Rain of Fire");
                          StyxWoW.SleepForLagDuration();
                          SpellManager.ClickRemoteLocation(Me.Location);
                          StyxWoW.SleepForLagDuration();
                          Me.ClearTarget();
                          Logging.Write("拉怪放自己身边");
                      }
                                  
                      return;
                  }
      
      Simple log:
      Code:
      [11:05:05.570 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:05.570 D] Goal: Nothing
      [11:05:05.570 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:05.571 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:05.571 D] Goal: Moving to <-62.83289, 3698.972, 152.1119>
      [11:05:05.765 N] 爆燃冲刺
      [11:05:06.797 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:06.797 D] StyxWoW.AreaManager.CurrentGrindArea is null
      [11:05:06.889 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:06.889 D] Goal: Nothing
      [11:05:06.889 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:06.889 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:06.889 D] Goal: Moving to <-45.06597, 3707.635, 153.2923>
      [11:05:08.719 N] 拉怪
      [11:05:08.853 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:08.853 D] StyxWoW.AreaManager.CurrentGrindArea is null
      [11:05:08.937 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:08.937 D] Goal: Nothing
      [11:05:08.937 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:08.937 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:08.937 D] Goal: Moving to <-32.02288, 3719.453, 155.3723>
      [11:05:10.880 D] (Singular) [CombatLog] SPELL_CAST_FAILED Rain of Fire#104232 failure: '目标不在视野中'
      [11:05:10.942 D] (Singular) [CombatLog] cast failed due to los reported at 19:05:10.941 on target 0
      [11:05:10.732 N] 拉怪
      [11:05:10.878 N] 灰烬转换
      [11:05:10.884 D] (Singular) error parsing Guid ''
      [11:05:11.865 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:11.865 D] StyxWoW.AreaManager.CurrentGrindArea is null
      [11:05:11.978 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:11.978 D] Goal: Nothing
      [11:05:11.978 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:11.978 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:11.978 D] Goal: Moving to <-28.79826, 3759.301, 159.6955>
      [11:05:13.735 N] 拉怪
      [11:05:16.790 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:16.790 D] StyxWoW.AreaManager.CurrentGrindArea is null
      [11:05:16.941 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:16.941 D] Goal: Nothing
      [11:05:16.941 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:16.941 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:16.941 D] Goal: Moving to <-37.52513, 3770.203, 162.0066>
      [11:05:17.117 D] (Singular) [CombatLog] SPELL_CAST_FAILED Unending Resolve#104773 failure: '尚未恢复'
      [11:05:19.623 N] 拉怪
      [11:05:19.748 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:19.748 D] StyxWoW.AreaManager.CurrentGrindArea is null
      [11:05:19.832 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:19.832 D] Goal: Nothing
      [11:05:19.832 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:19.832 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:19.832 D] Goal: Moving to <-47.17113, 3781.643, 162.6167>
      [11:05:20.082 N] 取消爆燃冲刺1
      [11:05:22.858 N] 拉怪
      [11:05:23.139 D] (Singular) [CombatLog] SPELL_CAST_FAILED Ember Tap#114635 failure: '尚未恢复'
      [11:05:23.137 N] 灰烬转换
      [11:05:24.378 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:24.378 D] StyxWoW.AreaManager.CurrentGrindArea is null
      [11:05:24.473 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:24.473 D] Goal: Nothing
      [11:05:24.473 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:24.473 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:24.473 D] Goal: Moving to <-53.34641, 3784.672, 161.2236>
      [11:05:27.265 N] 拉怪
      [11:05:28.482 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:28.482 D] StyxWoW.AreaManager.CurrentGrindArea is null
      [11:05:28.616 D] [QDBG] Done with forced behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:28.616 D] Goal: Nothing
      [11:05:28.616 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedIf.
      [11:05:28.616 D] [QDBG] Starting behavior Bots.Quest.QuestOrder.ForcedMoveTo.
      [11:05:28.616 D] Goal: Moving to <-61.17455, 3781.718, 157.3864>
      [11:05:30.052 N] Stopping the bot!
      [11:05:30.053 Q] Bot stopping! Reason: User pressed the stop button
      [11:05:30.770 D] (Singular) warning: 385.3 seconds since BotBase last called Singular (now in OnBotStop)
      [11:05:30.753 N] 拉怪
      [11:05:30.765 D] Behavior flags changed! Death, Loot, Vendor, Roam -> 0x0000007F
      [11:05:30.769 D] Activity: Honorbuddy Stopped
      
      
       
    2. chinajade

      chinajade Well-Known Member Moderator Buddy Core Dev

      Joined:
      Jul 20, 2010
      Messages:
      17,540
      Likes Received:
      172
      Trophy Points:
      63
      Hi, BigOfSmall,

      Please show us the code for the FindPullTarget() method. We suspect you are using some 'expensive' HB API methods in it.

      cheers,
      chinajade
       
    3. bigofsmall

      bigofsmall New Member

      Joined:
      Jan 14, 2011
      Messages:
      53
      Likes Received:
      0
      Trophy Points:
      0
      Hi,Chinajade:
      Firstly thanks for your always quick reply.
      I run the code in plugin, use a quest profile. i think the key problem is I use the same code in above version, but it seems that they run with different performance, I don't know why.:(

      Code:
      private bool FindPullTarget(int SpellRange)
              {
      
                  WoWUnit PullTarget = (from u in ObjectManager.GetObjectsOfType<WoWUnit>(false, false)
                                        //where IsValidUnit(u)
                                        where !u.TaggedByOther
                                        where !u.IsDead
                                        //where !u.TaggedByOther
                                        //where u.IsHostile
                                        //where u.DistanceCalc() <= 40
                                        where !u.Mounted
                                        where u.InLineOfSight
                                        where u.Distance <= SpellRange
                                        where !u.Combat
                                        //where !u.IsTargetingMeOrPet
                                        where !u.IsFriendly
                                        where !u.IsPet
                                        where !u.IsPlayer
                                        where !u.IsCritter
                                        where u.CanSelect
                                        where u.Attackable
                                        where u.Entry != 50350
                                        where u.Level > 15
                                        where (u.Entry == 62582)
                                        where !Blacklist.Contains(u.Guid)
                                        orderby u.Distance descending
                                        select u).FirstOrDefault();
      
                  if (PullTarget == null)
                      return false;
      
                  PullTarget.Target();
      
                  return true;
              }
      
      HTML:
      <If Condition="(Me.HasAura(&quot;Grimoire of Sacrifice&quot;))">
      <RunTo X="-79.83957" Y="3703.52" Z="150.0518"  />
      </If>
      				
      <If Condition="(Me.HasAura(&quot;Grimoire of Sacrifice&quot;))">
      <RunTo X="-62.83289" Y="3698.972" Z="152.1119" />
      </If>
      				
      				
      <If Condition="(Me.HasAura(&quot;Grimoire of Sacrifice&quot;))">
      <RunTo X="-45.06597" Y="3707.635" Z="153.2923" />
      </If>
      
       
    4. bigofsmall

      bigofsmall New Member

      Joined:
      Jan 14, 2011
      Messages:
      53
      Likes Received:
      0
      Trophy Points:
      0
      any one can help me? thanks.
       
    5. chinajade

      chinajade Well-Known Member Moderator Buddy Core Dev

      Joined:
      Jul 20, 2010
      Messages:
      17,540
      Likes Received:
      172
      Trophy Points:
      63
      Hi again, BigOfSmall,

      Are you testing in the same hunting area for v714 and v716? If I had to guess, I'd say where you ran the v716 test is more 'target rich', perhaps. Your query can easily be the source of the problem, because:
      • It is highly qualified
      • It is immediately evaluated
      This also makes it an ideal candidate for being placed in a framelock. Please modify FindPullTarget like this and see if it does any better:

      private bool FindPullTarget(int SpellRange)
      {
      using (StyxWoW.Memory.AcquireFrame())
      {

      WoWUnit PullTarget =
      (from u in ObjectManager.GetObjectsOfType<WoWUnit>(false, false)
      where
      // This should *always* be your first qualifier...
      u.IsValid

      // Pulled these to the top, because they are cheap, and prune the
      // list down significantly, and immediately. Also, with the "==" term,
      // the "!=" term is unnecessarily redundant, so we commented it out.

      // && u.Entry != 50350
      && (u.Entry == 62582)

      // u.IsHostile is more restrictive than !u.IsFriendly.
      // Both should not be in this list. Pick your desire, but not both.

      //&& IsValidUnit(u)
      && !u.TaggedByOther
      && !u.IsDead
      //&& u.IsHostile
      && !u.Mounted
      && u.InLineOfSight
      && !u.Combat
      //&& !u.IsTargetingMeOrPet
      && !u.IsFriendly
      && !u.IsPet
      && !u.IsPlayer
      && !u.IsCritter
      && u.CanSelect
      && u.Attackable
      && u.Level > 15
      && !Blacklist.Contains(u.Guid)

      // Distance calculations are slightly more expensive than the rest,
      // So, we save them for last.

      && u.Distance <= SpellRange
      //&& u.DistanceCalc() <= 40​

      // "descending" is an unusual choice. This means the FirstOrDefault()
      // will return the furtherest qualified target. Is this what you want?
      // Most queries prefer the nearest target, which would require
      // the "descending" qualifier to be omitted.

      orderby u.Distance descending
      select u)
      .FirstOrDefault();​

      if (PullTarget == null)
      return false;​

      PullTarget.Target();
      return true;​
      }
      }​

      In the above, LINQ queries also take advantage of C#'s ability to 'short circuit' the && and || operators. I.e., the evaluation of the predicate stops immediately, as soon as the expression's "truth" or "falsity" can be determined. We use this to our advantage, and move the 'cheaper' tests to the top of the LINQ expression, that can determine the whether or not the unit belongs in the query. For instance, if the unit isn't an Id of 62582, then the LINQ query will discard that unit and immediately move to the next unit to be considered without evaluating the rest of the qualifiers in the 'where' clause.

      This is also why we prefer the && operator to chaining 'where' clauses for qualifying. Logically, both will produce the same result. However, the additional 'where' clauses incorporate extra and unnecessary LINQ machinery to perform the evaluation. This can be computationally expensive.


      You should always prefer the aura Id to the aura name for these things. And, you should also remove the unnecessary parenthesis on these. The XML Schema checkers will like you much more for doing this. :D

      The "Grimoire of Sacrifice" is no longer in the game. You probably meant some other aura? Anyway, using Ids prevents mistakes in selection and proper spelling of the desired spell/aura. It looks like this:
      <If Condition="Me.HasAura(12345)">
      <RunTo X="-79.83957" Y="3703.52" Z="150.0518" />​
      </If>

      <If Condition="Me.HasAura(12345)">
      <RunTo X="-62.83289" Y="3698.972" Z="152.1119" />​
      </If>


      <If Condition="Me.HasAura(12345)">
      <RunTo X="-45.06597" Y="3707.635" Z="153.2923" />​
      </If>​

      And one last thing...
      In the future, questions such as these belong in the Community Developer forum?not the Support forum.

      cheers,
      chinajade
       
    6. bigofsmall

      bigofsmall New Member

      Joined:
      Jan 14, 2011
      Messages:
      53
      Likes Received:
      0
      Trophy Points:
      0
      hi,chinajade,
      my plugin run smoonly now after folow your advice.thanks a lot.

      i use the plugin in same old code and farm in same place, but the performance are different in different version, so i personal think it is not totally code problem in plugin,the count of mobs are really huage as you said, i kill 3000 mobs per hour.

      i cant sure if there are some problem in object manager in version 716.

      thanks again.
       
    7. CodenameG

      CodenameG New Member

      Joined:
      Jan 15, 2010
      Messages:
      38,369
      Likes Received:
      231
      Trophy Points:
      0
      there might be speed differences between versions, unfortunately as far as support goes there's not much we can do for you.
       

    Share This Page