• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • 您好,关于程序设计的问题。

    Discussion in 'Honorbuddy 援助区' started by qq362946, Mar 13, 2014.

    1. qq362946

      qq362946 New Member

      Joined:
      Mar 6, 2014
      Messages:
      30
      Likes Received:
      0
      Trophy Points:
      0
      您好,我想做一个点击传送门传动到其他地方的代码。

      下面是代码:

      WoWGameObject Obj = ObjectManager.GetObjectsOfType<WoWGameObject>().FirstOrDefault(W => W.Entry == 215120 && W.SubType == WoWGameObjectType.SpellCaster);

      Obj.Interact();

      这样写问题是,有时候可以点击传送,有时候不会点击传送门。请问这样的问题该怎么解决?
       
    2. qq362946

      qq362946 New Member

      Joined:
      Mar 6, 2014
      Messages:
      30
      Likes Received:
      0
      Trophy Points:
      0
      这段代码是在BOT的Pulse()方法里运行的。
       
    3. joe_ss

      joe_ss Moderator Moderator

      Joined:
      Jul 18, 2012
      Messages:
      823
      Likes Received:
      0
      Trophy Points:
      16
    4. EricPhone

      EricPhone Moderator Moderator

      Joined:
      Feb 17, 2013
      Messages:
      5,665
      Likes Received:
      3
      Trophy Points:
      38
      如果你有时成功有时不成功,那么就代表这个代码是可行的,你可以这样改

      判断当前人物地图id是否你进入传送门之后的地图id
      是则进行你传送的代码,否则跳出循环
       
    5. claud321

      claud321 Member

      Joined:
      Sep 15, 2013
      Messages:
      67
      Likes Received:
      1
      Trophy Points:
      6
      提到这个问题 正好请教一下Eric。 请问当前地图的ID如何获取的?我一直没搞明白。
       
    6. EricPhone

      EricPhone Moderator Moderator

      Joined:
      Feb 17, 2013
      Messages:
      5,665
      Likes Received:
      3
      Trophy Points:
      38
      打开开发工具,选择Console窗口,在New按钮下面的空白地方输入Log(Me.MapId);
      然后点Run
       

    Share This Page