Last active
March 16, 2024 05:30
-
-
Save x-magic/99035b660bbf180a26ac05c24aa4e861 to your computer and use it in GitHub Desktop.
Let me know how long does it takes to get 36,000 points on TTG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name TTG Points Calculator | |
| // @namespace https://totheglory.im/ | |
| // @version 0.2 | |
| // @description Let me know how long does it takes to get 36,000 points on TTG | |
| // @match https://totheglory.im/mybonus.php | |
| // @run-at document-end | |
| // @copyright 2016, x-magic <[email protected]> | |
| // @updateURL https://gist.githubusercontent.com/x-magic/99035b660bbf180a26ac05c24aa4e861/raw/TTGPointsCalculator.user.js | |
| // @downloadURL https://gist.githubusercontent.com/x-magic/99035b660bbf180a26ac05c24aa4e861/raw/TTGPointsCalculator.user.js | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| var current_points = parseFloat($.text($('table.tableb').find('b')[0])); | |
| var current_points_hour = parseFloat($("#bonus_tb td:contains('总计')").siblings('td').text()); | |
| var target_time_day = 62888 / (current_points_hour * 24); | |
| var target_time_output = Math.round(target_time_day * 100) / 100; | |
| var target_remaining_day = (62888 - current_points) / (current_points_hour * 24); | |
| var target_remaining_output = Math.round(target_remaining_day * 100) / 100; | |
| $('#bonus_tb tbody').append('<tr><td class="rowhead">需要等多久</td><td>' + target_time_output + ' 日</td></tr>'); | |
| $('#bonus_tb tbody').append('<tr><td class="rowhead">还要等多久</td><td>' + target_remaining_output + ' 日</td></tr>'); | |
| var current_uploads = parseFloat($("table font:contains('上传量')").next().find('a').attr('title').replace(" MB", "").replaceAll(",","")); | |
| var current_downloads = parseFloat($("table font:contains('下载量')").next().find('a').attr('title').replace(" MB", "").replaceAll(",","")); | |
| var target_points_rounds = ((current_downloads * 6.0) - current_uploads) / 1024 / 100; | |
| var target_points_days = (target_points_rounds - 1) * target_time_output + target_remaining_output; | |
| $('#bonus_tb tbody').append('<tr><td class="rowhead">达到6.0分享率还要等多久</td><td>' + Math.ceil(target_points_days) + ' 日</td></tr>'); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment