Browse Source

Fancy up Javascript for finding good values on Market

Mike Greene 8 tháng trước cách đây
mục cha
commit
a497b161dd
1 tập tin đã thay đổi với 12 bổ sung1 xóa
  1. 12 1
      README.md

+ 12 - 1
README.md

@@ -113,7 +113,18 @@ for (var i = 0; i < cards.length; i++) {
     cardNum = cards.item(i).getElementsByClassName('pornstar-number')[0].outerText;
     cardVal = parseInt(cards.item(i).getElementsByClassName('score-card')[0].outerText);
     cardCost = parseInt(cards.item(i).getElementsByClassName('cost')[0].outerText);
-    if (cardCost > (cardVal/2)){
+    cardPPG = cardVal/cardCost;
+    innerCard = cards.item(i).getElementsByClassName('inner-market-card')[0];
+    var PPG = innerCard.getElementsByClassName('PPG')[0];
+    if (PPG){PPG.innerHTML = "Points/<img src='https://play.boobylegends.com/wp-content/themes/child-roulette/img/gem.png' style='height:22px'>:<br/>" + cardPPG.toFixed(2);}
+    else {
+        let qty = document.createElement('div');
+        qty.classList.add('PPG');
+        qty.innerHTML = "Points/<img src='https://play.boobylegends.com/wp-content/themes/child-roulette/img/gem.png' style='height:22px'>:<br/>" + cardPPG.toFixed(2);
+        qty.setAttribute("align", "center");
+        innerCard.appendChild(qty);
+        }
+    if (cardPPG < 2){
         cards.item(i).style.setProperty('Display','None');
     }
 }