Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ************** STEP 1
- //add this in, somewhere before: function wow(region,toonName,realmName) {
- function rep(standing){
- switch(standing){
- case 0:
- return "Hated";
- case 1:
- return "Hostile";
- case 2:
- return "Unfriendly";
- case 3:
- return "Neutral";
- case 4:
- return "Friendly";
- case 5:
- return "Honored";
- case 6:
- return "Revered";
- case 7:
- return "Exalted"
- }
- }
- // ************** STEP 2
- // replace the json call (near the top of the function wow code) with this line to include reputations in API call
- var toonJSON = UrlFetchApp.fetch("https://"+region+".api.battle.net/wow/character/"+realmName+"/"+toonName+"?fields=items,quests,achievements,audit,progression,feed,professions,talents,reputation&?locale=en_US&apikey="+apikey+"");
- // ************** STEP 3
- // add this code in, you can find factions by searching wowhead, and using the number found in faction URLs http://www.wowhead.com/faction=####
- var reputation = [ "-", "-" ];
- var reputationLength = toon.reputation.length;
- for(i=0; i<reputationLength; i++)
- {
- switch (toon.reputation[i].id) {
- case 1015: //Netherwing
- reputation[0] = rep(toon.reputation[i].standing) + " (" + Math.round(toon.reputation[i].value/toon.reputation[i].max*100) +"%)";
- break;
- case 87: // Bloodsail Buccaneers
- reputation[1] = rep(toon.reputation[i].standing) + " (" + Math.round(toon.reputation[i].value/toon.reputation[i].max*100) +"%)";
- break;
- }
- }
- // ************** STEP 4
- // add in reputation to the toonInfo array, where you want it to output
- reputation[0], reputation[1],
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement