+ Reply to Thread
Results 1 to 4 of 4

Thread: converting between unitID and unit

  1. #1
    Champion Lorandii's Avatar
    Join Date
    Jun 2011
    Posts
    516

    Default converting between unitID and unit

    Inspect.Unit.Detail takes either a unit ("player", "player.target", etc) or a unitID, while Event.Combat.xxx use unitIDs exclusively for caster and target. What is the easiest way to code
    Code:
    if caster == "player" then do something end
    Because I can't see comparing a number to a string working very well.

  2. #2
    Sword of Telara Semele's Avatar
    Join Date
    Mar 2011
    Posts
    872

    Default

    Quote Originally Posted by Lorandii View Post
    Inspect.Unit.Detail takes either a unit ("player", "player.target", etc) or a unitID, while Event.Combat.xxx use unitIDs exclusively for caster and target. What is the easiest way to code
    Code:
    if caster == "player" then do something end
    Because I can't see comparing a number to a string working very well.
    I personally capture the players UnitID on start-up and use that for all references to "player". I find that far more reliable. More a base level thing.
    Rank 76 Guardian Mage

  3. #3
    Champion Lorandii's Avatar
    Join Date
    Jun 2011
    Posts
    516

    Default

    I'll have to check your code where you do that capture, since I didn't see an easy method in the APIs at first glance.

  4. #4
    Sword of Telara Semele's Avatar
    Join Date
    Mar 2011
    Posts
    872

    Default

    Quote Originally Posted by Lorandii View Post
    I'll have to check your code where you do that capture, since I didn't see an easy method in the APIs at first glance.
    It's in SafesRaidManager where I handle that stuff.

    Code:
    LibSRM.Player.ID = Inspect.Unit.Lookup("player")
    Rank 76 Guardian Mage

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts