EaGLE Posted May 13, 2020 Report Posted May 13, 2020 There is a end point for getting steam level of a user (GetSteamlevel).But is there any end point for getting steam level and the color of the level? Quote
4049_1572836826 Posted May 13, 2020 Report Posted May 13, 2020 client.getSteamLevels([steamID], function (results) { var lvl = results % 100; if (lvl >= 0 && lvl <= 9) { gray } else if (lvl >= 10 && lvl <= 19) { red } else if (lvl >= 20 && lvl <= 29) { orange } else if (lvl >= 30 && lvl <= 39) { yellow } else if (lvl >= 40 && lvl <= 49) { green } else if (lvl >= 50 && lvl <= 59) { blue } else if (lvl >= 60 && lvl <= 69) { purple } else if (lvl >= 70 && lvl <= 79) { pink } else if (lvl >= 80 && lvl <= 89) { idk } else if (lvl >= 90 && lvl <= 99) { idk } } Quote
PonyExpress Posted May 13, 2020 Report Posted May 13, 2020 // 0 10 20 30 40 50 60 70 80 90 let colors = ["Gray", "Red", "Orange", "Yellow", "Green", "Blue", "Lilac", "Pink", "Cherry", "Brown"]; client.on("friendMessage", (SENDER, MSG) => { client.getSteamLevels([SENDER], (ERR, CURRENTLEVEL) => { if (!ERR) { console.log("The color of your level is " + colors[Math.floor(CURRENTLEVEL[SENDER] % 100 / 10)]); } }); }); Quote
EaGLE Posted May 13, 2020 Author Report Posted May 13, 2020 1 hour ago, PonyExpress said: // 0 10 20 30 40 50 60 70 80 90 let colors = ["Gray", "Red", "Orange", "Yellow", "Green", "Blue", "Lilac", "Pink", "Cherry", "Brown"]; client.on("friendMessage", (SENDER, MSG) => { client.getSteamLevels([SENDER], (ERR, CURRENTLEVEL) => { if (!ERR) { console.log("The color of your level is " + colors[Math.floor(CURRENTLEVEL[SENDER] % 100 / 10)]); } }); }); can you explain it..please? i do not know what kind of api or package you are using or what does the code mean Quote
PonyExpress Posted May 14, 2020 Report Posted May 14, 2020 In this code, we just get the last 2 digits of the level, divide it by 10, and round to a smaller one. (example: level 789 = 89 / 10 = 8.9 = 8 = cherry) It does not require special api / packages. Quote
EaGLE Posted May 14, 2020 Author Report Posted May 14, 2020 I was wondering where can i get all the icons or vectors for different steam levels .Do you have any idea Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.