1. https://api.hypixel.net/guild?key=NOKEY4U&name=GUILDNAME
    Ok so this makes a long thing with basically everyone's info like gxp and uuid which I need but the problem is the keys are all in the same array! Meaning ['uuid'] will be targeting all of them even though only the last one will work.

    So how do I make it so I can read user 1, 2, 3,... 120 because ik so many people want a gxp checker so I want to make one but I don't know what to do
     
    #1
  2. Could you post a sample response here because I am not able to retrieve it.
     
    #2
  3. Yeah I didn't explain it very well but basically for everyone in the guild there is key like uuid, coins, join, xphistory ect. But the problem is they all are in the members key so uuid can't be specific to one player
     
    #3
  4. I am not sure what your goal is either, but if you want to target a specific UUID you could just write a function to find it like this:

    (Pseudocode)
    Code:
    for member in members {
    
    if(member['uuid'] == $uuidwelookfor)
    {
    $exp = $member['gexp'];
    break;
    }
    
    }
    
    Depending on the language you use there might also already be a function that helps you, like "array_search" in PHP.
     
    #4
  5. no so like someone wants to make a thing that displays everyone in the guilds gxp so they know if they are doing good or not so i want to make it so it displays all 1-120 members but the issue is i can't do [uuid] because they all have the same key like if it was like ['member1']['uuid'] i could do that but i cant
     
    #5
  6. Usually, to get the first entry, you access members[0]['uuid'].

    To make devs lives easier however, you don't have to create manual loops that count this index up, you can use a foreach loop, like here in Python to iterate over all members of an array:
    Code:
    colors = ["red", "green", "blue", "purple"]
    for i in range(len(colors)):
        print(colors[i])
    
     
    #6
  7. look at the url I can't change what the api says! I just need to somehow call each ['uuid'] differently even though they have tge same name and idk how
     
    #7
  8. The guild members returned in the API response are in an Array. If you said you wanted to print all of them, you would need to iterate over that array as I described above. Not sure what else you mean.
     
    #8
  9. ahh i see but how would i do that automatically? well actually in your 2nd post you said ['members[0]'] that doesn;t work
     
    #9
    Last edited: Feb 7, 2020
  10. As I've seen you use Python, this is an example of iterating over an Array in Python:
    [​IMG]

    As for accessing the first member of an Array:
    [​IMG]
     
    #10
    • Useful Useful x 1
  11. thanks it works! the only thing is do you by chance know how i could make it look up the uuids here then call the ['name'] key? then i can just replace the uuid with the player name?

    https://sessionserver.mojang.com/session/minecraft/profile/<uuid>
    Nvm I finished
     
    #11
    Last edited: Feb 7, 2020

Share This Page