Advertisement
Guest User

Untitled

a guest
Dec 1st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. // ==UserScript==
  2. // @name New Userscript
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @include *
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function($) {
  12. 'use strict';
  13.  
  14. // ant_pool1url
  15. // ant_pool1user
  16. // ant_pool1pw
  17. // ant_freq
  18. if (window.location.href.indexOf('minerConfiguration') < 0) return;
  19.  
  20.  
  21. var ipAt = window.location.host.split('.');
  22. var username = '3Kzs1bVTcgWJXYvcwscYzdx6T7yo2aQGFA.[IP3]x[IP4]';
  23. var password = 'x';
  24. var pools = {
  25. scrypt: [
  26. ['scrypt.eu.nicehash.com:3333', username, password],
  27. ['scrypt.usa.nicehash.com:3333', username, password],
  28. ['scrypt.jp.nicehash.com:3333', username, password],
  29. ],
  30. sha256: [
  31. ['sha256.eu.nicehash.com:3334', username, password],
  32. ['sha256.usa.nicehash.com:3334', username, password],
  33. ['sha256.jp.nicehash.com:3334', username, password],
  34. ],
  35. };
  36.  
  37. $(document.head).append('<style>select, input[type=text], input[type=password] {width:25em;}</style>');
  38.  
  39. var $selector = $('<select>')
  40. .append('<option value="">Select auto fill</option>')
  41. .append('<option value="scrypt">scrypt</option>')
  42. .append('<option value="sha256">sha256</option>')
  43. .attr('style', 'width: auto;margin: 0 15px;');
  44.  
  45.  
  46. var $submiter = $('<button>')
  47. .attr('onclick', 'f_submit_miner_conf();')
  48. .text('Submit');
  49.  
  50. $('#content')
  51. .after($submiter)
  52. .after($selector)
  53. ;
  54.  
  55.  
  56. var $freq = $('#ant_freq');
  57. if ($freq.length) {
  58. var $newFreq = $('<input type="text">')
  59. .attr('id', 'ant_freq')
  60. // .attr('value', $freq.val());
  61. .attr('value', ant_data["bitmain-freq"]);
  62.  
  63. $freq
  64. .after($newFreq)
  65. .remove();
  66. }
  67.  
  68. $selector.change(function () {
  69. var $this = $(this);
  70. var val = $this.val();
  71.  
  72. switch(val) {
  73. case '':
  74. window.location.reload();
  75. break;
  76.  
  77. default:
  78. var pool = pools[val];
  79. var fill = function (field, value) {
  80. value = populate_params(value);
  81. $(field).val(value);
  82. };
  83. for (var i = 0; i < 3; i++) {
  84. fill('#ant_pool' + (i + 1) + 'url', pool[i][0]);
  85. fill('#ant_pool' + (i + 1) + 'user', pool[i][1]);
  86. fill('#ant_pool' + (i + 1) + 'pw', pool[i][2]);
  87. }
  88. break;
  89. }
  90. });
  91.  
  92. function populate_params(value) {
  93. for (var i = 0; i < ipAt.length; i++) {
  94. value = value.replace('[IP' + (i+1) + ']', ipAt[i]);
  95. }
  96. return value;
  97. }
  98. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement