Advertisement
Guest User

Nub numbers variation

a guest
Nov 11th, 2019
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.64 KB | None | 0 0
  1. // Get Stats more comprehensive
  2. // to guess PayOut coming
  3. var config = {
  4. mainTitle: { label: '*** Nubs27\'s NubsScript for Dice ***', type: 'title' },
  5. bet: { label: 'Base Bet', value: currency.minAmount, type: 'number' },
  6. lossTitle: { label: 'Stop When ', type: 'title' },
  7. stop: { label: 'Coins Lost >', value: currency.minAmount, type: 'number' },
  8. };
  9.  
  10.  
  11. function main () {
  12. const MultiplierArray = [1.5,2,3,4,5,6,7,8,9,10];
  13. var PayOutConfidence = [];
  14. var PayOutPercents = [];
  15. var IndexMax = 0;
  16. var GetNumber = 0;
  17. var MaxIndex = 0;
  18. var GamesPlayed = 0;
  19. var CurrentMultiplier = 1.5;
  20. var LastMultiplier = 1.5;
  21. var CurrentState = 0;
  22. var BaseBet = config.bet.value;
  23. var MinimumBet = BaseBet;
  24. var CurrentBet = BaseBet;
  25. var MaxBet = config.stop.value / 10;
  26. var LargestBet = 0;
  27. var Recovery = "False";
  28. var RecoveryAmt = 0;
  29. var PauseForRolls = 0;
  30. var Profit = 0;
  31. var RollProfit = 0;
  32. var LastBet = BaseBet;
  33. var LastResult = "Won";
  34. var CoinLost = 0;
  35. var Losses = 0;
  36. var BiggestStreak = 0;
  37. var StartTime = new Date();
  38. var EndTime = new Date();
  39. var TimeDiff = (EndTime - StartTime);
  40. var StartBalance = currency.amount;
  41. var EndBalance = 0;
  42. var ProfPerMin = 0;
  43. var HiLo = "High";
  44. var LastRoll = 1000;
  45. var ScriptHistory = [];
  46. var FindThisMultiplier = 1;
  47. var HistorySlice = 25;
  48. var Array2Filter = [];
  49. var FilteredArray = [];
  50. var FindShouldHave = 2;
  51. var ThisAverage = 1;
  52.  
  53. // Welcome the Player to the Script
  54. console.clear();
  55. log.info(' Nubs27s NubsScript for Dice');
  56. log.info(" ****************");
  57. log.info("See Web Console for more Information");
  58. console.log('%c~~~~~~~~~~~~~~~~~ Nubs27\'s NubsScript for Dice ~~~~~~~~~~~~~~~~~','color:Purple; font-weight:bold');
  59. console.log('%cScript Start Time: ' + StartTime,'color:Purple; font-weight:200');
  60. console.log(' %cWelcome ' + userInfo.name, 'color:Purple; font-weight:bold');
  61. console.log(' %cYour Starting Balance is: ' + StartBalance + ' ' + currency.currencyName, 'color:Purple; font-weight:bold');
  62. console.log('%c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~','color:Purple; font-weight:bold');
  63. engine.on('GAME_STARTING', function () {
  64. console.log(' ----------------------------');
  65. strategy();
  66. if ((CoinLost + CurrentBet) > config.stop.value) {
  67. log.info("Stopping Due to User Parameters");
  68. console.log("Stopping Due to User Parameters");
  69. engine.stop();
  70. }else{
  71. console.log("[Bet] " + CurrentBet + " at " + CurrentMultiplier + "x");
  72. engine.bet(CurrentBet, CurrentMultiplier);
  73. }
  74. });
  75. function strategy() {
  76. findconfidence();
  77. findlargestindex();
  78. // console.log('[Index] ' + '(' + MaxIndex + ')' + ' PayOut: ' + FindPayOuts[MaxIndex] + ' [Largest Confidence] ' + PayOutConfidence[MaxIndex]);
  79. // console.log(' PayOut ' + MultiplierArray[MaxIndex] + '; Confidence Level ' + PayOutConfidence[MaxIndex] + ' %');
  80. GetNumber = MultiplierArray[MaxIndex];
  81. randompayout();
  82. CurrentBet = BaseBet;
  83. MaxIndex = Math.floor(Math.random() * MaxIndex);
  84. CurrentMultiplier = GetNumber;
  85. if (Losses < 5) {
  86. CurrentBet = ((CoinLost + (BaseBet * Losses)) / (CurrentMultiplier - 1));
  87. }else{
  88. CurrentBet = ((CoinLost + (BaseBet * (Losses / 2))) / (CurrentMultiplier - 1));
  89. }
  90. checkbet();
  91. }
  92. function findconfidence() {
  93. PayOutConfidence = [];
  94. for (i = 0; i < PayOutPercents.length; i++) {
  95. if (PayOutPercents[i] < 100) {
  96. PayOutConfidence[i] = (100 - PayOutPercents[i]);
  97. PayOutConfidence[i] = Math.abs(PayOutConfidence[i]);
  98. PayOutConfidence[i] = (PayOutConfidence[i] + 25);
  99. }else if (PayOutPercents[i] == 100) {
  100. PayOutConfidence[i] = 25;
  101. }else{
  102. PayOutConfidence[i] = 0;
  103. }
  104. if (i > 3) {
  105. PayOutConfidence[i] = (PayOutConfidence[i] - 25);
  106. }
  107. if (i > 5) {
  108. PayOutConfidence[i] = (PayOutConfidence[i] - 25);
  109. }
  110. if (PayOutConfidence[i] < 0) {
  111. PayOutConfidence[i] = 0;
  112. }
  113. }
  114. }
  115. function findlargestindex() {
  116. IndexMax = PayOutConfidence[0];
  117. MaxIndex = 0;
  118. for (var i = 1; i < PayOutConfidence.length; i++) {
  119. if (PayOutConfidence[i] >= IndexMax) {
  120. MaxIndex = i;
  121. IndexMax = PayOutConfidence[i];
  122. }
  123. }
  124. }
  125. function randompayout() {
  126. GetNumber = GetNumber * 100;
  127. if (Losses < 3) {
  128. GetNumber = Math.floor(Math.random() * GetNumber) + 115;
  129. }else{
  130. GetNumber = Math.floor(Math.random() * GetNumber) + 133;
  131. }
  132. GetNumber = GetNumber / 100;
  133. if (isNaN(GetNumber)) {
  134. GetNumber = Math.floor(Math.random() * 198) + 151;
  135. GetNumber = GetNumber / 100;
  136. }
  137. }
  138. function checkbet() {
  139. MinimumBet = currency.minAmount;
  140. if (CurrentBet < BaseBet) {
  141. CurrentBet = BaseBet;
  142. }
  143. if (CurrentBet < MinimumBet) {
  144. CurrentBet = MinimumBet;
  145. }
  146. if (CurrentBet > MaxBet) {
  147. CurrentBet = MaxBet;
  148. CurrentMultiplier = ((CoinLost + CurrentBet) / CurrentBet);
  149. console.log('Maximum Bet is engaged. PayOut updated ' + CurrentMultiplier);
  150. log.info('Maximum Bet is engaged. PayOut updated ' + CurrentMultiplier);
  151. }
  152. if (CurrentBet > LargestBet) {
  153. LargestBet = CurrentBet;
  154. }
  155. }
  156. engine.on('GAME_ENDED', function (data) {
  157. GamesPlayed++;
  158. LastRoll = data.roll;
  159. RollProfit = data.profitAmount;
  160. if (HiLo == "High") {
  161. converthigh();
  162. }else{
  163. convertlow();
  164. }
  165. if (ScriptHistory.unshift(LastRoll) > 9999) ScriptHistory.shift();
  166. winorlose();
  167. if (Recovery == "True" && Losses == 2 && PauseForRolls <= 0) {
  168. RecoveryAmt = RecoveryAmt + CurrentBet;
  169. PauseForRolls = Math.floor(Math.random() * 7) + 2;
  170. console.log('[Strategy] Script will pause Martingale betting for: ' + PauseForRolls + ' rolls');
  171. CurrentState = 2;
  172. CurrentMultiplier = MultiplierArray[2];
  173. CurrentBet = currency.minAmount * 1.02;
  174. }
  175. if (Recovery == "True" && LastResult == "Won" && PauseForRolls <= 0) {
  176. Recovery = "False";
  177. }
  178. LastMultiplier = CurrentMultiplier;
  179. LastBet = CurrentBet;
  180. GamesPlayed = GamesPlayed.toString();
  181. if (GamesPlayed.endsWith('25') || GamesPlayed.endsWith('50') || GamesPlayed.endsWith('75') || GamesPlayed.endsWith('00')) {
  182. EndTime = new Date();
  183. TimeDiff = ((EndTime - StartTime) / 1000 )/ 60;
  184. EndBalance = currency.amount;
  185. Profit = EndBalance - StartBalance;
  186. ProfPerMin = (Profit / TimeDiff);
  187. UpdatePlayer();
  188. updatescript();
  189. console.log('%c~~~~~~~~~~~~~~~~~ Update Completed ~~~~~~~~~~~~~~~~~','color:blue;');
  190. }
  191. function converthigh() {
  192. if (LastRoll > 90099) {
  193. LastRoll = 10;
  194. }else if (LastRoll > 88999) {
  195. LastRoll = 9;
  196. }else if (LastRoll > 87625) {
  197. LastRoll = 8;
  198. }else if (LastRoll > 85857) {
  199. LastRoll = 7;
  200. }else if (LastRoll > 83499) {
  201. LastRoll = 6;
  202. }else if (LastRoll > 80199) {
  203. LastRoll = 5;
  204. }else if (LastRoll > 75249) {
  205. LastRoll = 4;
  206. }else if (LastRoll > 66999) {
  207. LastRoll = 3;
  208. }else if (LastRoll > 50499) {
  209. LastRoll = 2;
  210. }else if (LastRoll <= 50499) {
  211. LastRoll = 1;
  212. }
  213. }
  214. function convertlow() {
  215. if (data.roll >= 50499) {
  216. LastRoll = 1;
  217. }else if (data.roll < 50499) {
  218. LastRoll = 2;
  219. }else if (data.roll < 33000) {
  220. LastRoll = 3;
  221. }else if (data.roll < 24750) {
  222. LastRoll = 4;
  223. }else if (data.roll < 19800) {
  224. LastRoll = 5;
  225. }else if (data.roll < 16500) {
  226. LastRoll = 6;
  227. }else if (data.roll < 14142) {
  228. LastRoll = 7;
  229. }else if (data.roll < 12375) {
  230. LastRoll = 8;
  231. }else if (data.roll <= 11000) {
  232. LastRoll = 9;
  233. }else if (data.roll > 9900) {
  234. LastRoll = 10;
  235. }
  236. }
  237. });
  238. function winorlose() {
  239. if (RollProfit > 0) {
  240. LastResult = "Won";
  241. Losses = 0;
  242. Profit = (RollProfit - CoinLost);
  243. log.info('Roll was Won! Profit of ' + Profit);
  244. console.log('%cRoll was Won! Profit of ' + Profit,'color:Green;font-weight:bold');
  245. CoinLost = 0;
  246. }else{
  247. LastResult = "Lost";
  248. CoinLost = CoinLost + CurrentBet;
  249. Losses++;
  250. }
  251. if (LastResult == "Lost" && Losses > 10) {
  252. log.info('Roll was Lost. Accumulated Losses = ' + CoinLost.toFixed(5));
  253. }else if (LastResult == "Lost") {
  254. log.info('Roll was Lost');
  255. }
  256. if (Losses > BiggestStreak) {
  257. BiggestStreak = Losses;
  258. }
  259. }
  260. function UpdatePlayer() {
  261. console.log('%c~~~~~~~~~~~~~~~~~ Statistics Update ~~~~~~~~~~~~~~~~~','color:blue;font-weight:bold');
  262. console.log("Dice Rolled " + GamesPlayed + " Times in " + TimeDiff.toFixed(2) + " minutes ");
  263. console.log("Profit Per Minute " + ProfPerMin.toFixed(5) + ' ' + currency.currencyName);
  264. console.log("Session Net Profit " + Profit.toFixed(5) + ' ' + currency.currencyName);
  265. console.log("Longest Stretch Without a Win is " + BiggestStreak + " Rolls");
  266. console.log("Biggest Bet Placed " + LargestBet + " " + currency.currencyName);
  267. if (GamesPlayed < 50) {
  268. HistorySlice = 25;
  269. }else{
  270. HistorySlice = 50;
  271. }
  272. }
  273. function updatescript() {
  274. for (i = 0; i < MultiplierArray.length; i++) {
  275. FindThisMultiplier = MultiplierArray[i];
  276. FindMultiplierHistory();
  277. PayOutPercents[i] = ThisAverage;
  278. }
  279. }
  280. function FindMultiplierHistory() {
  281. FindThisMultiplier = (FindThisMultiplier - 0.01);
  282. Array2Filter = ScriptHistory.slice(0,[HistorySlice]);
  283. FilteredArray = Array2Filter.filter(function (e) {
  284. return e > FindThisMultiplier;
  285. });
  286. FindThisMultiplier = (FindThisMultiplier + 0.01);
  287. DisplayTimesSeen();
  288. findpercents();
  289. }
  290. function DisplayTimesSeen() {
  291. FindShouldHave = (Array2Filter.length / FindThisMultiplier);
  292. FindShouldHave = (FindShouldHave * 100);
  293. FindShouldHave = Math.round(FindShouldHave);
  294. FindShouldHave = (FindShouldHave / 100);
  295. console.log("PayOuts " + FindThisMultiplier + "x & Higher " + Math.round(FindShouldHave) + " times. There were " + FilteredArray.length);
  296. }
  297. function findpercents() {
  298. ThisAverage = FilteredArray.length / Math.round(FindShouldHave);
  299. ThisAverage = (ThisAverage * 100);
  300. ThisAverage = Math.round(ThisAverage);
  301. }
  302. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement