Help a Tech Noob |
Post Reply |
Author | |
Jejune
Postmaster General Joined: 10 Feb 2013 Status: Offline Points: 1035 |
Post Options
Thanks(0)
Posted: 26 Jun 2020 at 21:22 |
Hello, my tech dudes and dudettes.
As you know, Digi and I have built an alliance algorithm using the game's data feeds. I've stated before that I am a tech mortal, and thus decided to build our algorithm in a Google Sheet because that platform is about the extent of my tech abilities. So, that's why we've built it where we've built it. The good news is that it is working wonderfully. We're currently working on building in a new dimension that takes into account the races of alliance leaders. I've run into a snag, however, and am wondering if you can help me with it. We generally use IMPORTXML in Google Sheets. We'll do one column with //playername, another with //playernameid/@id, etc., using XPATH queries. This has worked great. However, there is a quirk with the Player Feed. If a player isn't in an alliance, they have no alliance role ID. Example, Kumo: <player> <playername id="10">Kumomoto</playername> <allianceid id="0"/> <race id="2"/> KillerPoodle, on the other hand: <player> <playername id="17">KillerPoodle</playername> <allianceid id="1"/> <allianceroleid id="4"/> <race id="1"/> So, when I send the //allianceroleid/@id" data down a column next to players' names and other IDs, the data gets out of sync, because not everyone has an alliance role id. Is there any way to tell IMPORTXML to insert a zero in place of where the alliance role ID returns whenever it confronts a player with no alliance role ID? If not, can you think of any other way to address this? I'm kind of stumped. Thanks! JJ |
|
Jejune
Postmaster General Joined: 10 Feb 2013 Status: Offline Points: 1035 |
Post Options
Thanks(0)
|
Good news -- I worked it out!
Since all players not in an alliance have an alliance ID of zero, I did a FILTER from one sheet to another where the alliance rank column had to be >0. From there, I ran the alliancerole ids alongside that filtered list and it matched perfectly. Yay!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |