pmdice

auto-rolling. Alefa Barea

  1. // ==UserScript==
  2. // @name pmdice
  3.  
  4. // @namespace http://pmdice.com
  5. // @version 0.3
  6. // @description auto-rolling. Alefa Barea
  7. // @author You
  8. // @match http://pmdice.com/
  9. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  10. // @grant none
  11. // @require http://code.jquery.com/jquery-3.4.1.min.js
  12. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js
  13. // @include https://example.com/
  14. // ==/UserScript==
  15.  
  16. /* global $ */
  17. $(document).ready(function(){ console.log('ready'); });
  18. $(document).ready(function(){
  19. (function() {
  20. var isStop = false;
  21. var r1= $('<input type="button" id="btnAuto1" value="START TOOL-AUTO 1" style="color:red;position:fixed;top:0;left:0;z-index:99999;"/>');
  22. var r2= $('<input type="button" id="btnAuto2" value="START TOOL-AUTO 2" style="color:red;position:fixed;top:0;left:200px;z-index:99999;"/>');
  23. var r3= $('<input type="button" id="btnAuto3" value="START TOOL-AUTO 3" style="color:red;position:fixed;top:0;left:400px;z-index:99999;"/>');
  24. var exAlertModal= $('<div id="exAlertModal" class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">'+
  25. '<div class="modal-dialog modal-sm" role="document"><div class="modal-content"><div class="modal-header">'+
  26. '<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>'+
  27. '<h4 class="modal-title" id="gridSystemModalLabel">NOTE</h4>'+
  28. '</div>'+
  29. '<div class="modal-body"><div class="alert alert-info text-center">Cảnh báo nguy hiểm!!!</div><div class="text-center">Auto close in <span id="exTimer" class="text-bold"></span></div></div>'+
  30. '<div class="modal-footer"><button type="button" class="btn btn-default text-bold" data-dismiss="modal" onclick="stop();">Tắt tool</button></div>'+
  31. '</div></div></div>');
  32. $("#wrapper").append(r1);
  33. $("#wrapper").append(r2);
  34. $("#wrapper").append(r3);
  35. $("body").append(exAlertModal);
  36. $('#btnAuto1').click(function(){
  37. var betMinAmount1 = 0.001;
  38. $('#mfpayoutmul').val('2x');
  39. $('#mfpayoutper').val('48.02%');
  40. // Chiến thuật x2
  41. start1(betMinAmount1, 1);
  42. });
  43. $('#btnAuto2').click(function(){
  44. var betMinAmount2 = 0.0001;
  45. $('#mfpayoutmul').val('4x');
  46. $('#mfpayoutper').val('24.01%');
  47. // Chiến thuật x4 (30 lần)
  48. start2(betMinAmount2, false, 1);
  49. });
  50. $('#btnAuto3').click(function(){
  51. var betMinAmount3 = 0.0001;
  52. $('#mfpayoutmul').val('4x');
  53. $('#mfpayoutper').val('24.01%');
  54. // Chiến thuật x4 mở rộng (tăng mức an toàn - đánh 1 lần thua 0$ trước khi bet thật)
  55. start3(betMinAmount3, false, 0, 1);
  56. });
  57. //});
  58. function start1(betMinAmount1, i) {
  59. var nStatus = checkStatus();
  60. if (checkReadyButton()) {
  61. if (nStatus > 0) { // reset
  62. $('#mfInputAmount').val(betMinAmount1);
  63. $('#mfpayout_over').click();
  64. ++i;
  65. } else if (nStatus < 0) { // multiply
  66. betAmount = Number($('#mfInputAmount').val());
  67. if ((betAmount / betMinAmount1) >= 1024) {
  68. showAlertMessage();
  69. }
  70. $('#mfInputAmount').val(betAmount * 2);
  71. } else { // error bet
  72. }
  73. setTimeout(function(){
  74. $('#btnplaymb').click();
  75. }, 500);
  76. }
  77. if (!isStop) {
  78. if (i > 100) {
  79. var betMinAmount2 = 0.0001;
  80. $('#mfpayoutmul').val('4x');
  81. $('#mfpayoutper').val('24.01%');
  82. // Chiến thuật x4 (30 lần)
  83. start2(betMinAmount2, false, 1);
  84. } else {
  85. var min = 1500;
  86. var max = 4000;
  87. var delayMil = Math.floor(Math.random() * (max - min + 1) + min);
  88. setTimeout(function(){
  89. start1(betMinAmount1, i);
  90. }, delayMil);
  91. }
  92. }
  93. }
  94. function start2(betMinAmount2, isDouble, i) {
  95. var nStatus = checkStatus();
  96. if (checkReadyButton()) {
  97. if (nStatus > 0) {
  98. $('#mfInputAmount').val(betMinAmount2);
  99. isDouble = false;
  100. ++i;
  101. } else if (nStatus < 0) {
  102. betAmount = Number($('#mfInputAmount').val());
  103. if ((betAmount / betMinAmount2) >= 4096) {
  104. showAlertMessage();
  105. }
  106. if (isDouble) {
  107. $('#mfInputAmount').val(betAmount * 2);
  108. isDouble = false;
  109. } else {
  110. $('#mfInputAmount').val(betAmount);
  111. isDouble = true;
  112. }
  113. } else { // error bet
  114. }
  115. setTimeout(function(){
  116. $('#btnplaymb').click();
  117. }, 500);
  118. }
  119. if (!isStop) {
  120. if (i > 100) {
  121. var betMinAmount3 = 0.0001;
  122. $('#mfpayoutmul').val('4x');
  123. $('#mfpayoutper').val('24.01%');
  124. // Chiến thuật x4 mở rộng (tăng mức an toàn - đánh 1 lần thua 0$ trước khi bet thật)
  125. start3(betMinAmount3, false, 0, 1);
  126. } else {
  127. var min = 1500;
  128. var max = 4000;
  129. var delayMil = Math.floor(Math.random() * (max - min + 1) + min);
  130. setTimeout(function(){
  131. start2(betMinAmount2, isDouble, i);
  132. }, delayMil);
  133. }
  134. }
  135. }
  136. function start3(betMinAmount3, isDouble, numStart, i) {
  137. var nStatus = checkStatus();
  138. if (checkReadyButton()) {
  139. if (nStatus > 0) {
  140. $('#mfInputAmount').val(0);
  141. isDouble = false;
  142. numStart = 0; // reset numStart
  143. ++i;
  144. } else if (nStatus < 0) {
  145. if (numStart <= 0) {
  146. betAmount = Number($('#mfInputAmount').val());
  147. if (betAmount <= 0) {
  148. betAmount = betMinAmount3;
  149. }
  150. if ((betAmount / betMinAmount3) >= 4096) {
  151. showAlertMessage();
  152. }
  153. if (isDouble && numStart <= -2) {
  154. $('#mfInputAmount').val(betAmount * 2);
  155. isDouble = false;
  156. } else {
  157. $('#mfInputAmount').val(betAmount);
  158. isDouble = true;
  159. }
  160. } else {
  161. $('#mfInputAmount').val(0);
  162. isDouble = false;
  163. }
  164. numStart--;
  165. } else { // error bet
  166. }
  167. setTimeout(function(){
  168. $('#btnplaymb').click();
  169. }, 300);
  170. }
  171. if (!isStop) {
  172. if (i > 100) {
  173. var betMinAmount1 = 0.01;
  174. $('#mfpayoutmul').val('2x');
  175. $('#mfpayoutper').val('48.02%');
  176. // Chiến thuật x2
  177. start1(betMinAmount1, 1);
  178. } else {
  179. var min = 1500;
  180. var max = 4000;
  181. var delayMil = Math.floor(Math.random() * (max - min + 1) + min);
  182. setTimeout(function(){
  183. start3(betMinAmount3, isDouble, numStart, i);
  184. }, delayMil);
  185. }
  186. }
  187. }
  188. function checkStatus() {
  189. var labelStatus = $('#mfplayresultout .label').html();
  190. var res = 0;
  191. if (labelStatus == undefined || labelStatus.indexOf('win') !== -1 || labelStatus.indexOf('thắng') !== -1) {
  192. res = 1;
  193. } else if (labelStatus.indexOf('lose') !== -1 || labelStatus.indexOf('thua') !== -1) {
  194. res = -1;
  195. }
  196. return res;
  197. }
  198. function timer(time,update,complete) {
  199. var start = new Date().getTime();
  200. var interval = setInterval(function() {
  201. var now = time-(new Date().getTime()-start);
  202. if( now <= 0) {
  203. clearInterval(interval);
  204. complete();
  205. }
  206. else update(Math.floor(now/1000));
  207. },100); // the smaller this number, the more accurate the timer will be
  208. }
  209. function showAlertMessage() {
  210. $('#exAlertModal').modal('show');
  211. timer(
  212. 10000, // milliseconds
  213. function(timeleft) {
  214. $('#exTimer').html(timeleft+" second(s)");
  215. },
  216. function() { // what to do after
  217. $('#exAlertModal').modal('hide');
  218. }
  219. );
  220. }
  221. function stop() {
  222. isStop = true;
  223. }
  224. function checkReadyButton() {
  225. var btnValue = $('#btnplaymb').html();
  226. if (btnValue.indexOf('DICE') !== -1 || btnValue.indexOf('CƯỢC') !== -1) {
  227. return true;
  228. }
  229. return false;
  230. }
  231. }) ;}) ();