HP VoteBot

Automatically emulates votes for HP

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         HP VoteBot
// @namespace    http://www.hacker-project.com/
// @version      0.3
// @description  Automatically emulates votes for HP
// @author       Kevin Mitnick
// @match        http://www.hacker-project.com/index.php?action=view*
// @match        http://hacker-project.com/index.php?action=view*
// @grant        none
// @require      http://code.jquery.com/jquery-latest.js
// ==/UserScript==
function main() {
    
    // TIME TO DELAY - HP WILL NEGATE REWARD IF THIS IS SET TOO LOW
    var DELAY = 3.0;
    
    var frame = document.getElementById("viewFrame");
    $(frame).ready(function() { setTimeout(function() { frame.src = frame.src; }, Math.round(DELAY*1000)); });
    
    var loc = new String(document.location);
    if (loc.indexOf("&a2=reward")>-1) {
        var firstPart = loc.substring(0, loc.indexOf("&", loc.indexOf("&_a=")+4));
        var num = parseInt(firstPart.substring(firstPart.indexOf("&_a=")+4, firstPart.length));
        var numLen = num.toString().length;
        num++;
        if (num<=20) document.location.href = firstPart.substring(0, firstPart.length-numLen)+num;
    }
    
}
main();