1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | 心靈相通檢驗程式! 使用前請注意: 。請只在神獸捕捉的官噗中使用本功能 。請在噗文內容完全載入的情況下再按下檢測按鈕 。只能正確檢測到擲骰格式為【訓練家 名字】(bz)(bz)(bz)-(bz)(bz)(bz)的回覆 。同一回覆內兩角十二bz、有自訂表符或角色發言沒問題 。以下情況可能造成檢測失誤: 【】替換為其他符號 同一回覆內的BZ數超過正常擲骰數 同一回覆內有其他噗浪隨機骰(dice之類的) 按鈕失靈的情況請重整幾次看看 教學: 。將神獸擲骰噗另外打開分頁 。在該分頁中快樂按下F12,會跳出開發者工具 。點選右上的Console 。將本噗浪貼最下面的一整串程式碼複製貼上,按下enter 。撘啦! ---<以下請全數複製貼上>--- let bzSrc = ['https://emos.plurk.com/c5022c482debf1e676b85ed27a2dfcf4_w27_h27.png', 'https://emos.plurk.com/c718165a2a5a82544b19e16e7e8b60b1_w27_h27.png', 'https://emos.plurk.com/5d60d668f7ac4be891ede34aa26d0e7c_w27_h27.png', 'https://emos.plurk.com/8c44aa62f1d54b659dbdeb8d5cbef332_w27_h27.png'] let matchColor = []; let bigPlurk = document.getElementsByClassName('bigplurk')[0]; let emoticons = bigPlurk.getElementsByClassName('emoticon_my'); for(i=0;i<emoticons.length;i++){ let emoSrc = bzSrc.indexOf(emoticons[i].src); if(emoSrc > -1){ matchColor.push(parseInt(emoSrc)); } } let fourSame = ''; let fiveSame = ''; let sixSame = ''; let allResponse = document.getElementsByClassName('response') for(let r=0;r<allResponse.length;r++){ let response = allResponse[r].getElementsByClassName('text_holder')[0]; let responseHtml = response.innerHTML; if(response.innerHTML.indexOf('【訓練家') > -1) { let trainerCount = responseHtml.match(/【訓練家/g).length; let bzList = []; let getBz = response.getElementsByClassName('emoticon'); for(let t=0;t<trainerCount;t++){ let trainer = responseHtml.substring(responseHtml.indexOf('【'),responseHtml.indexOf('】')+1); let sameAmount = 0; for(let i=0;i<6;i++){ let bzColor = parseInt(getBz[i+6*t].getAttribute('rndnum'))-1; if(bzColor == matchColor[i]){ sameAmount++; } } // console.log(trainer + ':' + sameAmount); if(sameAmount == 4){ if(fourSame == ''){ fourSame = trainer; }else{ fourSame = fourSame + '\n' + trainer; } }else if(sameAmount == 5){ if(fiveSame == ''){ fiveSame = trainer; }else{ fiveSame = fiveSame + '\n' + trainer; } }else if(sameAmount == 6){ if(sixSame == ''){ sixSame = trainer; }else{ sixSame = sixSame + '\n' + trainer; } } responseHtml = responseHtml.replace(trainer,''); } } } let result = '同骰達四隻:\n' + fourSame + '\n同骰達五隻:\n' + fiveSame + '\n同骰達六隻:' + sixSame; console.log(result); |
Direct link: https://paste.plurk.com/show/6yAMbUi50x482gKw6o8F