1337 Time


SUBMITTED BY: Guest

DATE: Aug. 27, 2016, 8:52 p.m.

FORMAT: Text only

SIZE: 4.0 kB

HITS: 436

  1. function myPrint (msgStr , msgLevel )
  2. msgLevel = msgLevel or -99
  3. debugLevel = debugLevel or 10
  4. if msgLevel <= debugLevel and msgStr ~= nil then
  5. --- print (msgStr)
  6. print (msgLevel.. ":" .. msgStr)
  7. end
  8. end -- myPrint ()
  9. function round(num, idp)
  10. local mult = 10^(idp or 0)
  11. return math.floor(num * mult + 0.5) / mult
  12. end
  13. function roundup(num, idp)
  14. local mult = 10^(idp or 0)
  15. return math.ceil(num * mult ) / mult
  16. end
  17. -- execution starts from here....
  18. math.randomseed( os.time() )
  19. minBet=0.00000001 --the minimum Amount you want to bet
  20. maxBet=0.00000500 -- the maximum amount you want to bet
  21. minChance=88 --the min chance you want to bet at. >0
  22. maxChance=88 --the max chance you want to bet at <=98
  23. maxRoll = 99
  24. hEdge = 1
  25. betMultiplier = (maxRoll+hEdge)/(maxRoll)
  26. --betMultiplier = 1
  27. winNumber = 1
  28. loseNumber = 1
  29. avgWinNumber = (maxRoll+hEdge)/chance
  30. avgLoseNumber = (maxRoll+hEdge)/(maxRoll+hEdge-chance)
  31. raWinNumber = 0
  32. raLoseNumber = 0
  33. loseCount = 0
  34. winCount = 0
  35. pMultiple = 0.000011355
  36. lMultiple = 1.15 * pMultiple / (1-pMultiple) -- was 1.10
  37. chance = maxChance
  38. bpMultiple = 0.90
  39. betProfit = bpMultiple * (maxRoll-chance)/chance
  40. nextbet= 0.01
  41. betDivisor = 50
  42. calcBetDivisor = 1
  43. prevExpProfit = balance * pMultiple
  44. myPrint (string.format("lossMultiple:%.4f" ,lMultiple ) , 5)
  45. prevBalance =balance
  46. startBalance = balance
  47. prevChance = chance
  48. prevbet = nextbet
  49. function dobet ()
  50. myPrint ("..Start........................", 0)
  51. if (prevBalance <= balance) then
  52. myPrint ( string.format(" GAINED...:%.8f", balance - prevBalance) , 5)
  53. else
  54. myPrint ( string.format(" LOST.....:%.8f", prevBalance - balance) , 5)
  55. end
  56. if (win ) then
  57. winCount += 1
  58. raWinNumber += (winNumber - raWinNumber)/winCount
  59. winNumber = 1
  60. loseNumber += 1
  61. myPrint ("BetID:" .. lastBet.Id .. " was WIN " , 5)
  62. else
  63. loseCount += 1
  64. raLoseNumber += (loseNumber - raLoseNumber)/loseCount
  65. loseNumber = 1
  66. winNumber += 1
  67. expProfit2 += lastBet.amount / betDivisor
  68. myPrint ("BetID:" .. lastBet.Id .. " was LOSE " , 5)
  69. end
  70. --set nextbet
  71. if (startBalance < balance ) then
  72. startBalance = balance
  73. expProfit2 = balance * pMultiple
  74. myPrint ( "........Restarted........",5 )
  75. else
  76. myPrint ( string.format(" bal*lMultiple:%.8f",balance * lMultiple) , 5)
  77. myPrint ( string.format("diff Balance:%.8f",(startBalance - balance)) , 15)
  78. end
  79. betLimit = math.min( balance * pMultiple * 100 , maxBet )
  80. myPrint ( string.format("expProfit2:%.10f", expProfit2) , 5)
  81. nextbet = expProfit2 / betProfit
  82. if ( nextbet/math.ceil(chance / (maxRoll - chance)) < minBet ) then
  83. myPrint(" No possible profit ...increase bet OR reduce Chance..." , 5)
  84. nextbet = minBet * math.ceil(chance / (maxRoll - chance))
  85. end
  86. if nextbet > betLimit then
  87. expProfit2 = expProfit2 / betMultiplier
  88. nextbet = nextbet / betMultiplier
  89. end
  90. nextbet = roundup(nextbet ,8)
  91. myPrint ( string.format("startBalance:%.8f", startBalance) , 5)
  92. myPrint ( string.format("prevBalance:%.8f", prevBalance) , 15)
  93. myPrint ( string.format("balance:%.8f", balance) , 5)
  94. myPrint ( string.format("diff Balance:%.8f", startBalance - balance) , 5)
  95. myPrint ( string.format("prevChance:%.2f", prevChance) , 15)
  96. myPrint ("chance:" .. chance , 5)
  97. myPrint ( string.format("prevbet:%.8f", prevbet) , 15)
  98. myPrint ( string.format("nextbet:%.8f", nextbet) , 5)
  99. myPrint ("WinCount:" .. winCount .. " LoseCount:" .. loseCount, 5)
  100. myPrint ( string.format("Win/Lose ideal:%.4f Real:%.4f",
  101. wlIdeal, wlReal ) , 5)
  102. myPrint ( string.format("taWinNumber:%.4f taLoseNumber:%.4f",
  103. avgWinNumber, avgLoseNumber ), 5)
  104. myPrint ( string.format("raWinNumber:%.4f raLoseNumber:%.4f",
  105. raWinNumber, raLoseNumber ), 5)
  106. myPrint ("..End........................", 0)
  107. prevBalance = balance
  108. prevChance = chance
  109. prevbet = nextbet
  110. prevExpProfit = expProfit
  111. end

comments powered by Disqus