1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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_

    Joined:
    Nov 3, 2013
    Messages:
    277
    Likes Received:
    95
    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:
    154
    Likes Received:
    46
    May I close?
     
    dog_ likes this.
  5. dog_

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

    Joined:
    Jul 26, 2013
    Messages:
    154
    Likes Received:
    46
    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 Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    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 Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    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,937
    Likes Received:
    1,266
    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 Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    Good idea :)
     
  13. Salvation

    Salvation First Bot Author

    Joined:
    Aug 7, 2013
    Messages:
    262
    Likes Received:
    68
    >static
     
  14. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    >Arbiter
     
    Arbiter likes this.
  15. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,937
    Likes Received:
    1,266
    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...