A few api suggestions

Discussion in 'Client & Site Suggestions' started by PurpleKush, Mar 17, 2014.

  1. PurpleKush

    Joined:
    Jan 4, 2014
    Messages:
    10
    Likes Received:
    4
    A few suggestions for Players.getLocal

    #isAnimating
    #isMoving
    #isUnderAttack

    I know these can already be done, but it would be nice if it was in the official api :)
     
  2. dog_

    dog_ 0xCAFEBABE

    Joined:
    Nov 3, 2013
    Messages:
    270
    Likes Received:
    55
    isAnimating -> getAnimationId() != -1
    isMoving -> getSpeed() != 0
    isUnderAttack -> getCombatGauge() != null

    is it rly that hard
     
    #2 dog_, Mar 17, 2014
    Last edited: Mar 17, 2014
  3. PurpleKush

    Joined:
    Jan 4, 2014
    Messages:
    10
    Likes Received:
    4
    Thanks bae <3
     
  4. Quantum

    Joined:
    Jul 26, 2013
    Messages:
    144
    Likes Received:
    40
    May I close?
     
    dog_ likes this.
  5. dog_

    dog_ 0xCAFEBABE

    Joined:
    Nov 3, 2013
    Messages:
    270
    Likes Received:
    55
    Purplekush re-read I edited the isMoving part, I durped
     
  6. Quantum

    Joined:
    Jul 26, 2013
    Messages:
    144
    Likes Received:
    40
    Re-opened.
     
  7. supergay

    Joined:
    Mar 17, 2014
    Messages:
    6
    Likes Received:
    1
    Imo: Should be closed @Quantum. As it's very easy to do, and if someone would like it to be done that way could simply do it locally.
     
  8. Aidden

    Aidden The better executive ;)

    Joined:
    Dec 3, 2013
    Messages:
    3,473
    Likes Received:
    712
    While it is indeed very simple to do these things, to the beginner scripter it may not be quite as obvious of a solution and therefore i think it should be added to the api.
     
    PurpleKush likes this.
  9. supergay

    Joined:
    Mar 17, 2014
    Messages:
    6
    Likes Received:
    1
    If a beginner scripter can't figure this out, then frankly how are they going to figure out other things? I'd rather someone who doens't know what they're doing ask questions on how to check animation, check for objects, npc's, or more then to have every bit of code spoonfed to them hindering their learning.
     
  10. Aidden

    Aidden The better executive ;)

    Joined:
    Dec 3, 2013
    Messages:
    3,473
    Likes Received:
    712
    It's not being spoonfed. The whole point of an api is to make things as easy and understandable as possible. This method would simply take the numbers out of the equation and make it easier for the untrained eye of a beginner scripter to understand what's going on in a script bot.
     
  11. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,557
    Likes Received:
    1,072
    Also makes it marginally more readable. How about documenting the convenience method with the "proper" method? For example...

    // Equivalent to getAnimationId() != -1
    public static boolean isAnimating() {

    I feel this encourages learning and discovery of new methods, while still offering the intended convenience.
     
  12. Aidden

    Aidden The better executive ;)

    Joined:
    Dec 3, 2013
    Messages:
    3,473
    Likes Received:
    712
    Good idea :)
     
  13. Salvation

    Salvation First Bot Author

    Joined:
    Aug 7, 2013
    Messages:
    249
    Likes Received:
    63
    >static
     
  14. Cloud

    Joined:
    Jul 28, 2013
    Messages:
    2,557
    Likes Received:
    922
    >Arbiter
     
    Arbiter likes this.
  15. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,557
    Likes Received:
    1,072
    Hey hey no need for name calling. :p Just trying to mediate between the noob sympathizers and haters. Plus, convenience methods are a norm in just about every major third party library.
     

Share This Page

Loading...