stirante / lol-client-java-api

Simple library which provides access to internal League of Legends Client API.
GNU General Public License v3.0
67 stars 14 forks source link

I'm not sure whether it is Client or the Code problem #21

Closed SimronJ closed 4 years ago

SimronJ commented 4 years ago

Okay, so when I try to put the runes to the league client it doesn't show the rune I put it when I open up the page. Like I can clearly see that the rune page that I want to change is clearly changing because you can see the name of the page changed and the runes changes BUT when I open the page it shows as the previous one.

I'm not sure if there is a refresh function for runes or not.

code: `List conPerkIds = Arrays.asList(8010, 9111, 9103, 8299, 8275, 8210, 5005, 5008, 5002); List lethalPerkIds = Arrays.asList(8008, 9111, 9103, 8299, 8275, 8210, 5005, 5008, 5002); List fleetPerkIds = Arrays.asList(8021, 9111, 9104, 8299, 8446, 8444, 5005, 5008, 5002); List grapsPerkIds = Arrays.asList(8437, 8446, 8444, 8453, 9111, 9104, 5005, 5008, 5002);

    // Initialize API
            ClientApi api = new ClientApi();
            api.addClientConnectionListener(new ClientConnectionListener()
            {
                @Override
                public void onClientConnected()
                {
                    try
                    {
                        runePages = api.executeGet("/lol-perks/v1/pages", LolPerksPerkPageResource[].class);
                        for (int i = 0; i < runePages.length; i++)
                        {
                            if (runePages[i].isEditable)
                            {
                                getandsetchamps.comboxUpdate(runePages[i].name);
                            }
                        }

                        LolPerksPerkPageResource modifiedRune = runePages[getRunePage];

                        if(typeOfRune.equalsIgnoreCase("Lethal Tempo Runes"))
                        {
                            modifiedRune.name = "Trynd Lethal: SimGUI";
                            modifiedRune.primaryStyleId = 8000;
                            modifiedRune.selectedPerkIds = lethalPerkIds;
                            modifiedRune.subStyleId = 8200;
                        }
                        if(typeOfRune.equalsIgnoreCase("Fleet Footwork Runes"))
                        {
                            modifiedRune.name = "Trynd Fleet: SimGUI";
                            modifiedRune.primaryStyleId = 8000;
                            modifiedRune.selectedPerkIds = fleetPerkIds;
                            modifiedRune.subStyleId = 8400;
                        }
                        if(typeOfRune.equalsIgnoreCase("Conqueror Runes"))
                        {
                            modifiedRune.name = "Trynd Conqueror: SimGUI";
                            modifiedRune.primaryStyleId = 8000;
                            modifiedRune.selectedPerkIds = conPerkIds;
                            modifiedRune.subStyleId = 8200;
                        }
                        if(typeOfRune.equalsIgnoreCase("Grasp Runes"))
                        {
                            modifiedRune.name = "Trynd Grasp: SimGUI";
                            modifiedRune.primaryStyleId = 8400;
                            modifiedRune.selectedPerkIds = grapsPerkIds;
                            modifiedRune.subStyleId = 8000;
                        }

                        api.executePut("/lol-perks/v1/pages/" + runePages[getRunePage].id, modifiedRune);
                        System.out.println("Set the Rune!");

                        runePages = api.executeGet("/lol-perks/v1/pages", LolPerksPerkPageResource[].class);
                        getandsetchamps.deleteComboxItem();
                        for (int i = 0; i < runePages.length; i++)
                        {
                            if (runePages[i].isEditable)
                            {
                                getandsetchamps.comboxUpdate(runePages[i].name);
                            }
                        }
                    } catch (IOException e)
                    {
                        e.printStackTrace();
                    }
                }

                @Override
                public void onClientDisconnected()
                {
                    System.out.println("Client disconnected");
                }
            });
            // close socket when user enters something into console
            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
            try
            {
                reader.readLine();
            } catch (IOException e)
            {
                e.printStackTrace();
            }
            api.stop();`
issue-label-bot[bot] commented 4 years ago

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

SimronJ commented 4 years ago

Weird it made a duplicate