Page 14 of 82 FirstFirst ... 4 12 13 14 15 16 24 64 ... LastLast
Results 131 to 140 of 814

Thread: Dota 2 Match History WebAPI

  1. #131
    Basic Member
    Join Date
    Apr 2012
    Posts
    1,262
    Would anybody be intrested in a Python interface to this API? I was planning on writing one for a project I'm working on and I could clean it up and release it if anyone is interested.

  2. #132
    Basic Member MuppetMaster42's Avatar
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    585
    for anyone who's interested,
    for tower_status_radiant and tower_status_dire, the bits are as follows
    ANCIENT TOP
    ANCIENT BOTTOM
    TOP 3
    TOP 2
    TOP 1
    MIDDLE 3
    MIDDLE 2
    MIDDLE 1
    BOTTOM 3
    BOTTOM 2
    BOTTOM 1

    i.e.
    a value of 544 = 01000100000
    means that a team has their bottom-most ancient tower and their middle tier 3 left.

    a value of 1824 = 11100100100
    means that a team has both their ancient towers, their middle tier 3 and bottom tier 3 left.

    a value of 6 = 00000000110
    means that a team has just got their bottom tier 3 and bottom tier 2 left.

  3. #133
    Basic Member
    Join Date
    Feb 2012
    Posts
    14
    Quote Originally Posted by MuppetMaster42 View Post
    for anyone who's interested,
    for tower_status_radiant and tower_status_dire, the bits are as follows
    ANCIENT TOP
    ANCIENT BOTTOM
    TOP 3
    TOP 2
    TOP 1
    MIDDLE 3
    MIDDLE 2
    MIDDLE 1
    BOTTOM 3
    BOTTOM 2
    BOTTOM 1

    i.e.
    a value of 544 = 01000100000
    means that a team has their bottom-most ancient tower and their middle tier 3 left.

    a value of 1824 = 11100100100
    means that a team has both their ancient towers, their middle tier 3 and bottom tier 3 left.

    a value of 6 = 00000000110
    means that a team has just got their bottom tier 3 and bottom tier 2 left.
    I Still can't get this; =O
    Already feeling a dumb but, there is a way to explain this again/better/different?
    I Understand that we need to convert the number that the API return to binary.

    But I can't understand how put the builds in that numbers, I mean.
    Why 544 mean means that a team has their bottom-most ancient tower and their middle tier 3 left.?
    Can you put a example where all builds are up, all tier 2 up, all tier 3 up and finally all builds are destroyed?

  4. #134
    Basic Member
    Join Date
    Feb 2012
    Posts
    14
    I can't understand the DATE Value too =S;

    Sorry for so many noob questions, but I'm not a great programmer I'm doing this as my first lesson with an API;

  5. #135
    Basic Member
    Join Date
    Jun 2012
    Posts
    15
    Quote Originally Posted by IceHaku View Post
    I can't understand the DATE Value too =S;

    Sorry for so many noob questions, but I'm not a great programmer I'm doing this as my first lesson with an API;
    Do you mean date_min and date_max?
    If so, those are unix timestamps. What it is, it's basically count in seconds from 1st of January 1970.
    Which means that 1 january 1970 = 0.

    If you are using PHP you can do time() to retrieve the current timestamp.
    With java or javascript you can do new Date().getTime().

    Hope that answers it

  6. #136
    Basic Member
    Join Date
    Jul 2012
    Location
    USA
    Posts
    28
    Quote Originally Posted by IceHaku View Post
    I can't understand the DATE Value too =S;

    Sorry for so many noob questions, but I'm not a great programmer I'm doing this as my first lesson with an API;
    All the date values are in unix time format.

    http://en.wikipedia.org/wiki/Unix_time

    defined as the number of seconds that have elapsed since midnight Coordinated Universal Time (UTC), January 1, 1970
    Edit: Way2Death beat me to it.

    Quote Originally Posted by IceHaku View Post
    I Still can't get this; =O
    Already feeling a dumb but, there is a way to explain this again/better/different?
    I Understand that we need to convert the number that the API return to binary.

    But I can't understand how put the builds in that numbers, I mean.
    Why 544 mean means that a team has their bottom-most ancient tower and their middle tier 3 left.?
    Can you put a example where all builds are up, all tier 2 up, all tier 3 up and finally all builds are destroyed?
    What programming language are you using? Someone may be able to post some sample code to help explain it better.
    Last edited by Rychard; 07-23-2012 at 01:07 PM.

  7. #137
    Basic Member
    Join Date
    Feb 2012
    Posts
    9
    Is there a way to determine the game type (ap, sd, cm)? Also, it would be interesting if the results also contained the player_slot of the person got got first blood.

    IceHaku: Okay, I'll give it a shot. First, you have to convert the number to binary. In the example above.

    544 = 01000100000

    You can do this in windows calculator, or whatever. Second, you have to realize that each character in the binary number represents a specific tower on the map. For example:

    01000100000
    ^- the very first character in '01000100000' represents the ancients top tower. A zero in this position means that tower has been destroyed. A 1 in this position means it's still alive. So, for example:

    00000000000 - Every tower is dead.
    10000000000 - The ancients top tower is alive, everything else is dead.
    01000000000 - The ancients bottom tower is alive, everything else is dead.

  8. #138
    Quote Originally Posted by IceHaku View Post
    I can't understand the DATE Value too =S;

    Sorry for so many noob questions, but I'm not a great programmer I'm doing this as my first lesson with an API;
    What programming language are you using?

    If you're using C#, it's simple.

    From seconds:
    DateTime convertedTime = new DateTime(1970, 1, 1, 0, 0, 0); // Set intial date/time to Unix Epoch
    convertedTime = convertedTime.AddSeconds(returnedSeconds); // returnedSeconds = value returned from API

    To seconds:
    int date_min = (int)(dateMin - new DateTime(1970, 1, 1, 0, 0, 0)).TotalSeconds; // dateMin = date / time you set. It's a DateTime object.

    Hopefully that pushes you in the right direction. The value returned is just the number of seconds that have passed since Jan 1 1970. If you were to take your computer back in time to midnight Jan 1 1970 and played a game of dota2, when you would query about that match, you would actually have the value of 0 returned. If you would have played a game 30 seconds after midnight on Jan 1 1970, you would get the value of 30 returned. It's just an arbitrary date and time to count from, but it's consistent so it works.

    Quote Originally Posted by IceHaku View Post
    I Still can't get this; =O
    Already feeling a dumb but, there is a way to explain this again/better/different?
    I Understand that we need to convert the number that the API return to binary.

    But I can't understand how put the builds in that numbers, I mean.
    Why 544 mean means that a team has their bottom-most ancient tower and their middle tier 3 left.?
    Can you put a example where all builds are up, all tier 2 up, all tier 3 up and finally all builds are destroyed?
    The numbers are meaningless. What's important is the actual binary. If you can't read binary, then use this as a refresher. Look at the chart on the right side to see how a binary number changes when you count to 16.

    It's what is known as a bit field.

  9. #139
    Basic Member MuppetMaster42's Avatar
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    585
    Quote Originally Posted by IceHaku View Post
    I Still can't get this; =O
    Already feeling a dumb but, there is a way to explain this again/better/different?
    I Understand that we need to convert the number that the API return to binary.
    Metroids' explaination was bang on.

    ->convert the number to a binary string.
    (i've been using php so I use <string representing binary> = sprintf("%011b%", <decimal number>); - for more info on how the first parameter works see this link)
    ->then look at each individual bit in the binary string and from my post you know what it means.
    MAKE SURE THAT YOU PAD THE BINARY NUMBER TO 11 BITS LONG, otherwise it makes life harder for you.



    Quote Originally Posted by IceHaku View Post
    I can't understand the DATE Value too =S;
    Rychard's explaination was bang on.

    the date is in seconds since epoch (1/1/1970) aka a unix timestamp.
    Most languages have a function to convert it to a more human-readable format.
    (in php I use <string representing nicely formatted date> = date("F j, Y, h:ia", <integer representing unix time>); - for more info on how the first parameter works see this link)

  10. #140
    Basic Member MuppetMaster42's Avatar
    Join Date
    Nov 2011
    Location
    Australia
    Posts
    585
    Also, I should probably put a disclaimer - for the first two bits I am not entirely certain if they are the correct way round for dire.

    I know they're correct for radiant (I have 2 matches [out of 700] in my database with a "10" for the first two bits and I cross referenced the actual replay),
    but I looked at every single match I had and couldn't find one match where the dire was missing one single ancient tower (pubs are never really that close so it's rare)...

    So if anyone can find a match with a tower_status_dire that is above 512 (01000000000) and below 1536 (11000000000), kindly check the replay and tell me if I am correct

Posting Permissions

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