PopGoesTheWza / swgoh-tb-sheets

SWGoH Territory Battles Spreadsheets
MIT License
7 stars 2 forks source link

[1.181011.0] On tab 'Snapshot' Update #1

Closed DarkPhoenixSniper closed 5 years ago

DarkPhoenixSniper commented 5 years ago

Steps to reproduce

Snapshot option only works on link in cell A2

Expected Result

Suggest to have link auto update depending on selection in cell A5

Actual Result

No matter what value is in cell A5, it updates based off of A2 link

Version

1.181011.0

Testcase

Provide a link to a copy of the TB Sheets if necessary

DarkPhoenixSniper commented 5 years ago

Cell A2, should be the following formula to accommodate this check =CONCATENATE("https://swgoh.gg",VLOOKUP(A5,Roster!B:C,2))

PopGoesTheWza commented 5 years ago

The function "get_playerlink" i where the problem is. When looking for a member, it assumes column C on Roster tab will hold the SwgohGg url for that member.

DarkPhoenixSniper commented 5 years ago

except Column C on Roster tab is just /u/ALLYCODE not full URL

PopGoesTheWza commented 5 years ago

it would make sense to only have the allycode in column C. I see a two step change: First fixing get_playerlink() to recreate the url (Swgoh.Gg) Second, generalize allycode in column C

CyberShark98 commented 5 years ago

How will you accommodate this for .help support? or is that already built in?

CyberShark98 commented 5 years ago

budsta95Today at 6:06 PM so the error i saw was regarding the get_playerlink function in Code.gs specifically the line var match = members.find(function (e) { return e[0] === memberName_1; }); when calling function() on the array, the exception thrown is "TypeError: Cannot find function find in object " so instead of calling members.find() I just did a for loop where i checked for a match with memberName_1 and set playerLink if it is found and the other part of the problem is in function playerSnapshot() Line: var url = playerLink + "characters/?" + tag + "page=" + page;

Needs to be: var url = "https://swgoh.gg/" + playerLink + "characters/?" + tag + "page=" + page; doing those two things makes snapshot work

PopGoesTheWza commented 5 years ago

@DarkPhoenixSniper I need to think it over.

What do you think?

CyberShark98 commented 5 years ago

I think it makes sense to make as few calls to external data sources as possible, especially since it could be down or could be busy. that way the only data being pulled is the data at the time of refresh?

DarkPhoenixSniper commented 5 years ago

I agree with calling the information from the Heroes/Ship tabs, instead of pulling from the site.

PopGoesTheWza commented 5 years ago

I will look into it sometime this week.

PopGoesTheWza commented 5 years ago

@DarkPhoenixSniper @CyberShark98 Fix is in testing and should be ready for next release.