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 | 團體對戰總計pt! 使用前請注意: 。請只在團體對戰的官噗中使用本功能 。請在噗文內容完全載入的情況下再按下檢測按鈕 。會統計該噗中所有(dice)的總計數值,包含範例與未刪除的錯誤擲骰(=會有少許誤差) 。按鈕失靈的情況請重整幾次看看 教學: 。將神獸擲骰噗另外打開分頁 。在該分頁中快樂按下F12,會跳出開發者工具 。點選右上的Console 。將本噗浪貼最下面的一整串程式碼複製貼上,按下enter 。撘啦! 。本程式僅供計算參考,若有疑慮請自行驗算 。歡迎回報錯誤! ---<以下請全數複製貼上>--- let allScore = 0; let allResponse = document.getElementsByClassName('response'); allResponse.forEach(response => getScore(response)); function getScore(response){ let dices = response.getElementsByClassName('text_holder')[0].querySelectorAll('[alt="(dice)"]'); dices.forEach(dice => eachScore(dice)); } function eachScore(dice){ let diceNumber = dice.getAttribute('rndnum'); allScore += parseInt(diceNumber); } console.log('目前累積:' + allScore + 'pt'); |
Direct link: https://paste.plurk.com/show/FkpSEUyEfjtPIIrLwR8J