Jump to content

League sorting


Skiron
 Share

Recommended Posts

i think with this size of leagues it would be nice to have some sorting options.

beside the rank like now i would suggest sorting by level and done challenges,

since these infos are listed already and help a lot looking for the next player to challenge.

  • Like 6
Link to comment
Share on other sites

36 minutes ago, Observer_X said:

Ehi, Skiron, didn't I said that maybe sooner or later there would have been something we would have agreed on? And here it is! :)

(Although unfortunately i read your posts in another thread about big boobs and I disagree with that... 😭)

one out of two... not bad for a start :D

Link to comment
Share on other sites

6 hours ago, Observer_X said:

Ehi, Skiron, didn't I said that maybe sooner or later there would have been something we would have agreed on? And here it is! :)

(Although unfortunately i read your posts in another thread about big boobs and I disagree with that... 😭)

You should though. More big boobies for you and you can give Skiron the small ones. Everybody happy.

Link to comment
Share on other sites

12 hours ago, Chthugha said:

You should though. More big boobies for you and you can give Skiron the small ones. Everybody happy.

Well... It may be, but only if devs one day would rethink the "no girl get expelled from harem" rule :)

Conversely, both me and Skiron will have to linger with some girls we don't like much.

Link to comment
Share on other sites

On 9/17/2018 at 7:07 PM, Skiron said:

i think with this size of leagues it would be nice to have some sorting options.

beside the rank like now i would suggest sorting by level and done challenges,

since these infos are listed already and help a lot looking for the next player to challenge.

+1 Sorting by level

On 9/18/2018 at 8:50 PM, Moe Overload said:

Yes. Things like sorting by level or stats, filtering based on all challenges used or still available to challenge.

+1 Filtering on challenges

Link to comment
Share on other sites

If anyone's *desperate* to be able to sort by level (and also be able to flag in a list the opponents against whom you've won 3/3 challenges), then I cobbled together a really ugly way by copying to Google Docs, using a script to format, then copying to Google Sheets:

  1. You must have a Google account for this (they're free)
  2. These instructions assume Google Chrome. If you're using a different browser, then some of the browser steps may be slightly different. Google them to find the steps for your own browser.
  3. Open https://docs.google.com/document/d/1vl8UIr7qLw4nr6lDcrkx9yA0iHe9UF0J5KYg6rDt7tU/edit
    1. In the menu at the top left, click "File"
      1. Click "Make a copy..."
  4. In Hentai (Harem) Heroes, open "Tower of Fame" -> "Leagues"
    1. Click on the first row
    2. Right-click on the first row and select "Inspect"
    3. A bit above where it places you in the code, find <tbody class="leadTable">
      1. Right-click on that line and select "Copy" -> "Copy element"
  5. In your copy of the Google Doc (you won't be able to edit mine; you may need to open yours in Google Drive; yours will be titled "Copy of..."), select the existing text, and copy over it with the table from Hentai Heroes
    1. In the top menu row, click "Custom" -> "Prep table"
    2. Wait a minute or two for the text to change to a comma-delimited list (table)
    3. Select the text, and copy it
  6. Create a new Google Sheet (spreadsheet)
    1. Paste the text into the spreadsheet
    2. In the top menu row, click "Split text to columns..."
    3. Right-click on the column letter with the levels (should be column H)
      1. Click "Sort sheet Z -> A"
    4. Select the column with the number of challenges (should be column i)
      1. In the top menu row, click "Format" -> "Conditional formatting..."
      2. Under "Format cells if..." select "Text contains", then in the next box type "3/3" (without the quote marks)
      3. Select your desired formatting style (I selected the red)
      4. Click "Done"
    5. You can add a header row if you want
      1. If you do, then use "View" -> "Freeze" to freeze your header row(s) so that they don't move when you sort

Sorry this is so complicated. It was the quickest, easiest way that I could think of to get this done. You'll need to go through most of this process (you won't need to create a new doc / sheet each time), every time the leagues start over (every week).

The code, if it didn't copy:

function onInstall() {
    onOpen();
}


function onOpen() {
  var ui = DocumentApp.getUi(); // Or SpreadsheetApp or FormApp
  ui.createMenu( 'Custom' )
      .addItem( 'Prep table', 'prepTable' )
      .addToUi();
}


/*
 * Creates a comma delimited table for import into Google Sheets
 */
function prepTable() {
  var delimiter = ",";
  
  var doc = DocumentApp.getActiveDocument();
  var body = doc.getBody();
  
  // the row for the user (this player) is different from all other lines; this rectifies the line so it matches the others
  body.replaceText( "leagues_highlight", "" );
  
  // another weird row, not sure why
  body.replaceText( "lead_table_default", " " );
  
  body.replaceText( "<tbody class=\"leadTable\">", "" );
  
  var bodyText = body.getText();
  
  //DocumentApp.getUi().alert( "Does document contain \\t? " + /\t/.test( bodyText ) ); // \n true, \r false, \t true
  
  bodyText = bodyText.replace( /\n/g, "" );
  bodyText = bodyText.replace( /\t/g, "" );
  
  body.setText( bodyText );
  
  body.replaceText( "<tr mid=\"", "" );
  body.replaceText( "\" rank=\"", delimiter );
  body.replaceText( "\" class=\" \"><td>", delimiter );
  body.replaceText( "</td><td><img class=\"icon\" src=\"https://hh.hh-content.com/pictures/hero/ico/", delimiter );
  body.replaceText( "\"><span class=\"country ", delimiter );
  body.replaceText( "\" hh_title=\"", delimiter );
  body.replaceText( "\"></span>", delimiter );
  body.replaceText( "</td><td>",  delimiter );
  body.replaceText( "</td></tr>", "\n" );
  
  body.replaceText( "</tbody>", "" );
  
}

 

Edited by exception4lly
Noted that this process will need to be followed each time enter new league season; mentioned copy will be named differently
  • Thanks 1
  • Thinking 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...