• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Focus Target

    Discussion in 'Archives' started by pcxnet, Jun 21, 2011.

    1. pcxnet

      pcxnet New Member

      Joined:
      Jun 20, 2011
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      Sorry, focus isn't the easiest keyword to search for.

      Is it possible to implement the ability to get information on the players focus. (Not focus as in hunter energy, but as in their /focus)

      Useful information would be the same as what you can get for Target

      Distance etc.

      That would be great

      Thanks
       
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,335
      Likes Received:
      380
      Trophy Points:
      83
      Me.CurrentFocus ?
       
    3. pcxnet

      pcxnet New Member

      Joined:
      Jun 20, 2011
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      I thought that as well, but as it turns out, its your Hunter focus, not your Targetting focus.
       
    4. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,335
      Likes Received:
      380
      Trophy Points:
      83
      How about Me.FocusInfo?
       
    5. CodenameG

      CodenameG New Member

      Joined:
      Jan 15, 2010
      Messages:
      38,369
      Likes Received:
      231
      Trophy Points:
      0
      you can always lookup the focus target by guid, and pass it to a WoWUnit, and just refrence the wowunit, and do it all internally.
       
    6. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,335
      Likes Received:
      380
      Trophy Points:
      83
      Thats what I was thinking, just tested focusinfo and that wasn't it. How would he go about getting the guid of the focus target? Doing a lua.dostring? and getting the return value?
       
    7. CodenameG

      CodenameG New Member

      Joined:
      Jan 15, 2010
      Messages:
      38,369
      Likes Received:
      231
      Trophy Points:
      0
      well you gotta target the thing before you set it as your focaus target, so just pull it then.
       
    8. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,335
      Likes Received:
      380
      Trophy Points:
      83
      I guess if your going todo it this way, there isnt really any reason to set it as your focus, just store the wowunit.
       
    9. pcxnet

      pcxnet New Member

      Joined:
      Jun 20, 2011
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      I"m looking for it more for a plugin that wont be fully automated, so the bot wont necessarily be doing the targeting.. Having the ability to get details about focus would be handy.
       
    10. pcxnet

      pcxnet New Member

      Joined:
      Jun 20, 2011
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      Is this the right forum for this or is there a better spot for suggestions ?
       
    11. CptJesus

      CptJesus Member

      Joined:
      Jan 4, 2011
      Messages:
      49
      Likes Received:
      3
      Trophy Points:
      8
      Solved this using a combination of HB and LUA.

      Code:
      
      List<string> abc = Lua.GetReturnValues("return UnitGUID(\"focus\")");
      
      WoWUnit focus = null;
      
      ulong guid = ulong.Parse(abc[0].Substring(2),System.Globalization.NumberStyles.AllowHexSpecifier);
      					 
      focus = ObjectManager.GetObjectsOfType<WoWUnit>().FirstOrDefault(unit => unit.Guid == guid);
      
       
      Last edited: Jun 23, 2011
    12. Thacai

      Thacai Member

      Joined:
      Jan 15, 2010
      Messages:
      71
      Likes Received:
      0
      Trophy Points:
      6
      how i did it, includes check if there aint any focus at all:
      PHP:
      public WoWUnit GetFocus
              
      {
                  
      get
                  
      {
                      
      string name Lua.GetReturnVal("return GetUnitName(\"" "focus" "\");",0);
                      var 
      units ObjectManager.GetObjectsOfType(truetrue).First((unit) => unit.Name == name && name != null && name != string.Empty && name.ToLower() != "nil");
                      if (
      units != null)
                      {
                          return 
      units;
                      }
                      return 
      null;
                  }
              }
       
    13. supersurfer

      supersurfer Community Developer

      Joined:
      Mar 16, 2010
      Messages:
      88
      Likes Received:
      0
      Trophy Points:
      0
      you should not use <code><code>GetUnitName because if you have targets with the same name it can get pretty messy ^^</code></code> use the guid.
       

    Share This Page