Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name New Userscript
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @include *
- // @grant none
- // ==/UserScript==
- (function($) {
- 'use strict';
- // ant_pool1url
- // ant_pool1user
- // ant_pool1pw
- // ant_freq
- if (window.location.href.indexOf('minerConfiguration') < 0) return;
- var ipAt = window.location.host.split('.');
- var username = '3Kzs1bVTcgWJXYvcwscYzdx6T7yo2aQGFA.[IP3]x[IP4]';
- var password = 'x';
- var pools = {
- scrypt: [
- ['scrypt.eu.nicehash.com:3333', username, password],
- ['scrypt.usa.nicehash.com:3333', username, password],
- ['scrypt.jp.nicehash.com:3333', username, password],
- ],
- sha256: [
- ['sha256.eu.nicehash.com:3334', username, password],
- ['sha256.usa.nicehash.com:3334', username, password],
- ['sha256.jp.nicehash.com:3334', username, password],
- ],
- };
- $(document.head).append('<style>select, input[type=text], input[type=password] {width:25em;}</style>');
- var $selector = $('<select>')
- .append('<option value="">Select auto fill</option>')
- .append('<option value="scrypt">scrypt</option>')
- .append('<option value="sha256">sha256</option>')
- .attr('style', 'width: auto;margin: 0 15px;');
- var $submiter = $('<button>')
- .attr('onclick', 'f_submit_miner_conf();')
- .text('Submit');
- $('#content')
- .after($submiter)
- .after($selector)
- ;
- var $freq = $('#ant_freq');
- if ($freq.length) {
- var $newFreq = $('<input type="text">')
- .attr('id', 'ant_freq')
- // .attr('value', $freq.val());
- .attr('value', ant_data["bitmain-freq"]);
- $freq
- .after($newFreq)
- .remove();
- }
- $selector.change(function () {
- var $this = $(this);
- var val = $this.val();
- switch(val) {
- case '':
- window.location.reload();
- break;
- default:
- var pool = pools[val];
- var fill = function (field, value) {
- value = populate_params(value);
- $(field).val(value);
- };
- for (var i = 0; i < 3; i++) {
- fill('#ant_pool' + (i + 1) + 'url', pool[i][0]);
- fill('#ant_pool' + (i + 1) + 'user', pool[i][1]);
- fill('#ant_pool' + (i + 1) + 'pw', pool[i][2]);
- }
- break;
- }
- });
- function populate_params(value) {
- for (var i = 0; i < ipAt.length; i++) {
- value = value.replace('[IP' + (i+1) + ']', ipAt[i]);
- }
- return value;
- }
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement