Advertisement
Keiich

fibo_hunt+strange-martingale

Oct 16th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.36 KB | None | 0 0
  1. --@ Hunt+Fibo_by_Keiichi
  2.  
  3. --@ Fibonacci function written by -CttCJim- (c)
  4.  
  5.  
  6.  
  7. -- The script will roll in 2 stages:
  8.  
  9. -- 1. Hunting Stage
  10. --    Will plainbet with selected chance for selected number of rolls
  11. --    On win will reset the number of rolls to 0
  12.  
  13. -- 2. Fibo Stage
  14. --    Triggered after Hunting stage is over
  15. --    Will increase the bet amount with each roll using factored Fibonacci sequence
  16. --    Will increase chance % with each roll by selected amount, factored by lenth of lossStreak
  17. --    On win will reset to Hunting Stage
  18.  
  19. -- Good luck
  20.  
  21. -----------------SETTINGS------------------
  22. -------------------------------------------
  23. -------------------------------------------
  24. targetb = 0.00210000 -- Target Balance
  25. --@ Rolling will stop when this balance reached
  26.  
  27. basebet = 10 -- Will be used as basebet by default if 'autotune = false'
  28. --@ Use whole integers (i.e. "10" = 10 sats = 0.00000010)
  29.  
  30. minbet = basebet  -- Will be used if 'autotune = true' as minimum possible bet
  31. --@ Use whole integers
  32.  
  33. HUNTChance = 0.05-- Chance that will be used during Hunting Stage
  34. --@ The Fibo Stage will start with this chance
  35.  
  36. HUNTRollsNumber = 3 -- Number of rolls to do during Hunting Stage
  37. --@ Put 0 if you want to use the number based on selected HUNTChance
  38.  
  39. HUNTRollsPercent = 0.0 -- Number of rolls to do during Hunting Stage in % according to selected HUNTChance
  40. --@ i.e 1.00 = 100% - 100 rolls for x100 or 990 rolls for x990. Put 0 if you want to use plain number selected in HUNTRollsNumber
  41.  
  42. bbMult = 1.00 -- Multiplier for Hunting. Basebet will be multiplied by this number during Huntung Stage.
  43. --@ WILL NOT INFLUENCE THE FIBO STAGE (Change basebet for that)
  44.  
  45.  
  46. -------------------------------------------
  47. ----ADJUST-THIS-SETTINGS-TO-UR-PLAYSTYLE---
  48. fibStepBase = 0.033 -- Fibonacci stepping amount
  49. --@ Will adjust each FiboStep on this number
  50.  
  51. chanceStepBase = 0.014-- Chance stepping amount
  52. --@ Will increase chance on this amount each roll during Fibo-Stage
  53. ------------------------------------------
  54. -------------------------------------------
  55.  
  56.  
  57. -------------------MISC-------------------
  58. showStats = true -- Show stats in console
  59. --@ Can slow down the rolling. Try switching to false.
  60.  
  61. sound = true -- 'Pling' on Win
  62.  
  63. housePercent = 1 -- House Edge used by casino. Used for number of HUNT rolls calculation
  64. --@ Leave 1 as default if not known
  65.  
  66. seedEachRoll = true -- Set to true to change seed on each roll (Dont use together with seedOnWin)
  67.  
  68. seedOnWin = false -- Set to true to change seed on win (Dont use together with seedEachRoll)
  69.  
  70. HiLoOnWin = false -- Set to true to change HiLo on 1-3 wins randomly
  71.  
  72. HiLoAvgCalc = false -- Set to true to change HiLo dynamicly based on previous rolls
  73.  
  74. autotune = false -- Set to true to calculate basebet based on current balance
  75. -------------------------------------------
  76. -------------------------------------------
  77. -------------------------------------------
  78.  
  79.  
  80.  
  81.  
  82.  
  83. --------------BASE-VARIABLES---------------
  84. betCount = 0
  85. mGale = false
  86. chanceStep = chanceStepBase
  87. fibstep = fibStepBase
  88. if HUNTRollsPercent > 0 then
  89.   winAmount = (100 - (100 * (housePercent / 100))) / HUNTChance
  90.   fiboStart = winAmount * HUNTRollsPercent
  91. end
  92. if HUNTRollsNumber > 0 then
  93.   fiboStart = HUNTRollsNumber
  94. end
  95. curbal = balance
  96. targetpercent = curbal / targetb * 100
  97. wincount = 0
  98. change = 0
  99. minbet = minbet * 0.00000001
  100. basebet = basebet * 0.00000001
  101. stepsTo100 = 100 / chanceStepBase
  102. currentStep = 0
  103. lossCount = 0
  104. stepCount = 0
  105. highLowAverage = {}
  106. averageCount = 0
  107. averageIndex = 0
  108. averageMax = 4
  109. if not (HiLoAvgCalc) and not (HiLoOnWin) then
  110.   bethigh = true
  111. end
  112. name = "|             HUNT-STAGE                 |"
  113. huntName1 = "Chance = " .. string.format("%3.2f",HUNTChance) .. "%"
  114. huntName2 = "Payout = x" .. string.format("%3.0f",9900 / (HUNTChance * 100))
  115. huntName3 = "Range: > " .. string.format("%3.0f",9999 - (HUNTChance * 100)) .. " or <" .. string.format("%3.0f",(HUNTChance * 100))
  116. -------------------------------------------
  117.  
  118.  
  119.  
  120. --------------HiLo-AVERAGE-ARRAY-----------
  121. for i=0, averageMax do
  122.   highLowAverage[i] = 0
  123. end
  124. -------------------------------------------
  125.  
  126.  
  127. --------------BASEBET-AUTOCALC-------------
  128. function autocalc()
  129.   if(autotune == true) then
  130.     if(lossCount == 0) then
  131.       basebet = balance / 100000
  132.       basebet = basebet / (10 - HUNTChance)
  133.       if basebet < minbet then
  134.         basebet = minbet
  135.       end
  136.     end
  137.   end
  138. end
  139. -------------------------------------------
  140.  
  141.  
  142. --------------FIBO-CALCULATION-------------
  143. --@ Routine was written by -CttCJim- (c)
  144. function myfib(level)
  145.   fibno=basebet
  146.   temp=0
  147.   prevfibno=0
  148.   if level == 0 then
  149.     fibno= basebet
  150.   else
  151.     for j=0,level-1,1 do
  152.  
  153.       temp=fibno
  154.       fibno=fibno + (prevfibno * fibstep)
  155.       prevfibno=temp
  156.     end
  157.   end
  158.   return fibno
  159. end
  160. -------------------------------------------
  161.  
  162.  
  163. --------------STARTING-SETTINGS------------
  164. autocalc()
  165. chance = HUNTChance
  166. nextbet=basebet * bbMult
  167. -------------------------------------------
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174. -------------------------------------------
  175. -------------------------------------------
  176. -------------------DOBET-------------------
  177. -------------------------------------------
  178. -------------------------------------------
  179. function dobet()
  180.  
  181.   betCount += 1
  182.   autocalc()
  183.   -------------------------------------------
  184.   if seedEachRoll then
  185.     resetseed()
  186.   end
  187.   ------------------ON-WIN-------------------
  188.   if win then
  189.  
  190.     if seedOnWin then
  191.       resetseed()
  192.     end
  193.  
  194.     if sound then
  195.       ching()
  196.     end
  197.  
  198.     if HiLoOnWin then
  199.       wincount += 1
  200.       change = math.random(1,3)
  201.       if wincount >= change then
  202.         bethigh = not bethigh
  203.         wincount = 0
  204.       end
  205.  
  206.     end
  207.     curbal = balance
  208.     if curbal >= targetb then
  209.       print("\n---------")
  210.       print("---------\n")
  211.       print("Target Reached - Congratulations ")
  212.       print("\n---------")
  213.       print("---------\n")
  214.       stop()
  215.     end
  216.     if mGale then
  217.       mGale = false
  218.     else
  219.       mGale = true
  220.     end
  221.  
  222.     if mGale then
  223.       name = "|          MARTINGALE-STAGE             |"
  224.       fibstep = fibStepBase -- reset
  225.       chance = 49.5 -- reset
  226.       chanceStep = 0 -- reset
  227.       lossCount = 0 -- reset
  228.       nextbet = basebet * bbMult -- reset
  229.       stepCount = 0 -- reset
  230.     else
  231.  
  232.       name = "|             HUNT-STAGE                 |"
  233.       fibstep = fibStepBase -- reset
  234.       chance = HUNTChance -- reset
  235.       chanceStep = chanceStepBase -- reset
  236.       lossCount = 0 -- reset
  237.       nextbet = basebet * bbMult -- reset
  238.       stepCount = 0 -- reset
  239.     end
  240.     ------------------------------------------
  241.  
  242.  
  243.     -----------------ON-LOSE------------------
  244.   else
  245.     lossCount += 1
  246.  
  247.  
  248.     if mGale then
  249.       if lossCount > 0 then
  250.         nextbet = previousbet * 2
  251.       end
  252.  
  253.     else
  254.  
  255.  
  256.       if lossCount > fiboStart then
  257.         stepCount += 1
  258.         name = "|             FIBO-STAGE                   |"
  259.  
  260.         if lossCount <= fiboStart + (stepsTo100 * 0.02) then
  261.           fibstep = fibStepBase -- * 0.55
  262.           chanceStep = chanceStepBase -- * 0.93
  263.         elseif lossCount <= fiboStart + (stepsTo100 * 0.03) then
  264.           fibstep = fibStepBase -- * 0.66
  265.           chanceStep = chanceStepBase -- * 1.11
  266.         elseif lossCount <= fiboStart + (stepsTo100 * 0.05) then
  267.           fibstep = fibStepBase -- * 0.77
  268.           chanceStep = chanceStepBase -- * 1.22
  269.         elseif lossCount <= fiboStart + (stepsTo100 * 0.07) then
  270.           fibstep = fibStepBase -- * 0.88
  271.           chanceStep = chanceStepBase -- * 1.33
  272.         elseif lossCount <= fiboStart + (stepsTo100 * 0.09) then
  273.           fibstep = fibStepBase
  274.           chanceStep = chanceStepBase -- * 1.11
  275.         elseif lossCount <= fiboStart + (stepsTo100 * 0.11) then
  276.           fibstep = fibStepBase
  277.           chanceStep = chanceStepBase
  278.         else
  279.           fibstep = fibStepBase
  280.           chanceStep = chanceStepBase -- * 0.88
  281.         end
  282.  
  283.         chance += chanceStep
  284.         nextbet = myfib(stepCount)
  285.       end
  286.     end
  287.   end
  288.   ------------------------------------------
  289.  
  290.  
  291.  
  292.   -----------LoHi-AVERAGE-CALC------------
  293.   if HiLoAvgCalc then
  294.     if(lastBet.Roll >= 50) then
  295.       highLowAverage[averageIndex] = 1
  296.     else
  297.       highLowAverage[averageIndex] = 0
  298.     end
  299.     averageIndex += 1
  300.     if(averageIndex >= averageMax) then
  301.       averageIndex = 0
  302.     end
  303.     if(averageCount < averageMax) then
  304.       averageCount += 1
  305.     end
  306.     average = 0.00
  307.     for i=0, averageCount do
  308.       average += highLowAverage[i]
  309.     end
  310.     average = average / averageCount
  311.     if average >= 0.5 then
  312.       bethigh = true
  313.     else
  314.       bethigh = false
  315.     end
  316.   end
  317.   -----------------------------------------
  318.  
  319.  
  320.  
  321.   ----------------BALANCE------------------
  322.   curbal = balance
  323.   targetpercent = curbal / targetb * 100
  324.   -----------------------------------------
  325.  
  326.  
  327.   ----------------PRINTS-------------------
  328.   if showStats then
  329.     print("\n---------\n")
  330.     print("\n---------\n")
  331.     print("\n---------\n")
  332.     print("\n---------\n")
  333.     print("\n---------\n")
  334.     print("\n---------\n")
  335.     print("\n---------\n")
  336.     print("\n---------\n")
  337.     print("\n---------\n")
  338.     print("\n---------\n")
  339.     print("\n---------\n")
  340.     print("\n---------\n")
  341.     print("\n---------\n")
  342.     print("\n------------------------------------------------------")
  343.     print("------------------------------------------------------")
  344.     print("|                                                     |")
  345.     print(name)
  346.     if name == "|             HUNT-STAGE                 |" then
  347.       print("|                                                     |")
  348.       print("|           " .. huntName1 .. "                |")
  349.       print("|                                                     |")
  350.       print("|           " .. huntName2 .. "                 |")
  351.       print("|                                                     |")
  352.       print("|       " .. huntName3 .. "           |")
  353.       print("|                                                     |")
  354.       print("|        Rolls = " .. lossCount .. "  Out Of  " .. string.format("%3.0f",fiboStart) .. "            |")
  355.       print("|                                                     |")
  356.     else
  357.       print("|                                                     |")
  358.       print("|      Current Fibo Step = " .. string.format("%3.3f",fibstep) .. "       |")
  359.       print("|                                                     |")
  360.       print("|    Current Chance Step = " .. string.format("%3.2f",chanceStep) .. "     |")
  361.       print("|                                                     |")
  362.       print("|          LoseStreak = " .. lossCount .. "                 |")
  363.       print("|                                                     |")
  364.     end
  365.     print("------------------------------------------------------")
  366.     print("------------------------------------------------------\n")
  367.     print("\n---------\n")
  368.     print("\n---------\n")
  369.     print("Total Bets = " .. betCount)
  370.     print("\n\nTarget Balance = " .. targetb)
  371.     print("\n% of Target Reached = " .. string.format("%3.2f",targetpercent) .. "%")
  372.     print("\n---------\n")
  373.     print("\n---------\n")
  374.   end
  375.   -----------------------------------------
  376.   -----------------------------------------
  377.   -----------------------------------------
  378.  
  379. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement