Announcement

Collapse

Forum Rules

  • No flaming or derogatory remarks, directly or through insinuation.
  • No discussion, sharing or referencing illegal software such as hacks, keygen, cracks and pirated software.
  • No offensive contents, including but not limited to, racism, gore or pornography.
  • No excessive spam/meme, i.e. copious one liners in a short period of time, typing with all caps or posting meme responses (text/image).
  • No trolling, including but not limited to, flame incitation, user provocation or false information distribution.
  • No link spamming or signature advertisements for content not specific to Dota 2.
  • No Dota 2 key requests, sell, trade etc.
  • You may not create multiple accounts for any purpose, including ban evasion, unless expressly permitted by a moderator.

  • Please search before posting. One thread per issue. Do not create another thread if there is an existing one already.
  • Before posting anything, make sure you check out all sticky threads (e.g., this). Do not create new threads about closed ones.
  • It is extremely important that you post in correct forum section.

  • Balance discussion only in Misc.
  • All art related (such as hero model) feedbacks go to Art Feedback Forum.
  • All matchmaking feedback should go here: Matchmaking Feedback
  • All report/low priority issues should go here: Commend/Report/Ban Feedback
  • No specific workshop item feedback. These should go to workshop page of that item.
  • When posting in non-bugs section (such as this), use [Bugs], [Discussion] or [Suggestion] prefix in your thread name.



In case you object some action by a moderator, please contact him directly through PM and explain your concerns politely. If you are still unable to resolve the issue, contact an administrator. Do not drag these issues in public.



All rules are meant to augment common sense, please use them when not conflicted with aforementioned policies.
See more
See less

THINGS YOU SHOULD KNOW BEFORE STARTING

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Originally posted by GriFoN92 View Post
    Simple function for converting player_slot to int (0-9).
    https://gist.github.com/almirsarajcic/5064644
    First of all, that function doesn't work, since you're not using your function input variable. It will always return 1, regardless of $player_slot.
    Second of all, what's wrong with http://pastebin.com/jHxXkNqn ?

    Edit: Your previous gist you posted (converting steam ids) is also buggy broken and bad, which makes me think you're just a troll. Please don't post silly functions.

    Comment


    • #47
      It doesn't look as cool as this one.
      It also shows how you could reverse the process without using loops.
      Just posting some functions I think might help people, you don't have to use them.
      By the way, not sure how you saw the first revision of it, since I fixed it 5 minutes before you made your post.

      Regarding the first gist, did you notice some error? Can you give me the IDs you used?
      Your info could help me a lot, since I'm going to use that function in production.
      Last edited by GriFoN92; 03-01-2013, 07:00 AM.

      Comment


      • #48
        Magicians uses the modulo trick.
        Code:
        return $player_slot % 123;

        Comment


        • #49
          Originally posted by papa_pointnet View Post
          Magicians uses the modulo trick.
          Code:
          return $player_slot % 123;
          Without comments that's a bad function Mr. Magician!

          Comment


          • #50
            Originally posted by Tharuler View Post
            Without comments that's a bad function Mr. Magician!
            Says the other Magician

            Comment


            • #51
              I just grabbed the DB from here:
              http://dev.dota2.com/showthread.php?t=74438

              And i noticed first blood is an integer in seconds, always >=0 ... But the clock starts in the negative and doesn't hit 0 until the first wave spawns. So does 1 equate to -59 seconds, or are all the first-bloods before the clock hits zero just changed?

              Comment


              • #52
                Pedantic magicians use binary AND with NOT the flag :P

                Comment


                • #53
                  Originally posted by mattieshoes View Post
                  I just grabbed the DB from here:
                  http://dev.dota2.com/showthread.php?t=74438

                  And i noticed first blood is an integer in seconds, always >=0 ... But the clock starts in the negative and doesn't hit 0 until the first wave spawns. So does 1 equate to -59 seconds, or are all the first-bloods before the clock hits zero just changed?
                  I believe all times are done in replay time, which for most modes (non CM/rCM) should be a constant offset.

                  Comment


                  • #54
                    Originally posted by Netshroud View Post
                    Pedantic magicians use binary AND with NOT the flag :P
                    But binary in php is meh. Then again php is meh

                    Comment


                    • #55
                      Hello, I've just learned that there's an API for Dota 2 and I am already on my way. However, I was just wondering where I could find the list of items? You said it was on the Dota 2 install path but when I open the script/npc or script/items directories, they are empty. Why is that? Please help me before I get bored again and not finish this project. (When I get stuck I tend to get bored and move on another project). Please I want to finish this. Thanks!

                      Comment


                      • #56
                        dokgu, https://github.com/roozbeh360/dota-2...tem.helper.php

                        OR

                        https://github.com/kronusme/dota2-ap...ata/items.json
                        Last edited by GelioS; 03-05-2013, 01:24 PM.

                        DotA 2 Web API Processing with PHP
                        DotA2 Statistic - Professional leagues statistic
                        follow @dota2statistic

                        Comment


                        • #57
                          Originally posted by dokgu View Post
                          Hello, I've just learned that there's an API for Dota 2 and I am already on my way. However, I was just wondering where I could find the list of items? You said it was on the Dota 2 install path but when I open the script/npc or script/items directories, they are empty. Why is that? Please help me before I get bored again and not finish this project. (When I get stuck I tend to get bored and move on another project). Please I want to finish this. Thanks!
                          the list has been moved. updating the post with this is on my to do list.. just need to find time to get in and look at it all.
                          if you look at the to do list you can see a link to a post with details on where it is now..
                          The API Bible: Things You Should Know Before Starting API Development

                          Comment


                          • #58
                            Does anyone have a match ID of some CM match that has "picks_bans" property when calling GetMatchDetails?
                            I've tried several CM matches, but it was missing that info and I could swear I saw it somewhere.

                            Comment


                            • #59
                              Originally posted by GriFoN92 View Post
                              Does anyone have a match ID of some CM match that has "picks_bans" property when calling GetMatchDetails?
                              I've tried several CM matches, but it was missing that info and I could swear I saw it somewhere.
                              One of my recent games: 150434981. If you were trying to find CM games via GetMatchHistory then you won't be able to do so, the game_mode parameter is being ignored (see Known bugs thread).

                              Comment


                              • #60
                                Originally posted by RJackson View Post
                                One of my recent games: 150434981. If you were trying to find CM games via GetMatchHistory then you won't be able to do so, the game_mode parameter is being ignored (see Known bugs thread).
                                Great, thanks

                                Comment

                                Working...
                                X