HP VoteBot

Automatically emulates votes for HP

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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();