Hello Guest

# sum 10 roll

• 6 Replies
• 586 Views

#### parakazani

• 6
• +0/-0
##### sum 10 roll
« on: August 13, 2019, 10:03:25 pm »
Hi, I want to write a code
I want to say (sum of last 10 roll )= X
how can I write it?
in every roll this X value will chance

#### BlueSuede

• 10
• +1/-0
• Programmer In Training
##### Re: sum 10 roll
« Reply #1 on: August 13, 2019, 11:24:27 pm »
Do you want the sum of the last 10 rolls to be the next bet amount? The payout amount?
@RCORE - Your inbox is full. I can't send you PM's.

Need help programming a script? Contact me.
Discord: XclusiveDigital#8102

#### parakazani

• 6
• +0/-0
##### Re: sum 10 roll
« Reply #2 on: August 13, 2019, 11:56:14 pm »
actualyy, I want to sum last 10  99/Roll value(A)   and  sum last 30   99/Roll  Value(B)
while  A<B  I want to make bet amount 0.0001   else 0.0000001

#### BlueSuede

• 10
• +1/-0
• Programmer In Training
##### Re: sum 10 roll
« Reply #3 on: August 14, 2019, 12:12:37 am »
actualyy, I want to sum last 10  99/Roll value(A)   and  sum last 30   99/Roll  Value(B)
while  A<B  I want to make bet amount 0.0001   else 0.0000001

I'm not sure I'm understanding clearly. Lets say the last 10 rolls are 14.72, 13.18, 18.05, 61.47, 8.04, 72.03, 98.04, 77.88, 43.59, 13.91. You want to add all these up, which comes out to 420.91. From here you want 99/420.91, which comes out to 0.235204675583854. This number gets added to variable A.

Then the same thing is done for B, but with the sum of the last 30 rolls.

@RCORE - Your inbox is full. I can't send you PM's.

Need help programming a script? Contact me.
Discord: XclusiveDigital#8102

#### parakazani

• 6
• +0/-0
##### Re: sum 10 roll
« Reply #4 on: August 14, 2019, 12:56:11 am »
14.72, 13.18, 18.05, 61.47, 8.04, 72.03, 98.04, 77.88, 43.59, 13.91.   these are rolls,   99/14,72 + 99/13,18  + ..... +99/13,91    I'll calculate its average I mean Im  gonna divide it 10 and lets say A to this avg
Then the same thing is done for B, but with the sum of the last 30 rolls.  Im gonna divide It 30 and I ll find the average again. Lets say B to this avg.

then I want to do tihs;

if B>A
betamount 0.001
else
betamount 0.0000001

PLEASE REMOVE THİS VARIFICATION , It asks 0-0  I say 0 but it says no,  it asks 100-550 , answer is -450 but it says no, It makes me crazy.

#### BlueSuede

• 10
• +1/-0
• Programmer In Training
##### Re: sum 10 roll
« Reply #5 on: August 14, 2019, 12:20:27 pm »
Code: [Select]
myBasebet = 0.0000001
nextbet = myBasebet
chance    = 50.00
bethigh   = true
betA = 0.0000001   -- Bet this amount if B < A
betB = 0.001    -- Bet this amount if B > A

debugInfo = true

maxProfit = 0.01  -- stop script after profit goal reached
target = balance+maxProfit

resetseed()  -- Reset seed at start of script
resetstats() -- Reset stats at start of script

-- Average Variables

arrayA = {}  -- Array to store last 10 rolls
arrayA_sum = 0
arrayA_avg = 0
arrayA_maxSize = 10

arrayB = {}  -- Array to store last 30 rolls
arrayB_sum = 0
arrayB_avg = 0
arrayB_maxSize = 30

function dobet()

table.insert(arrayA, lastBet.Roll)
if(table.getn(arrayA) > arrayA_maxSize) then
table.remove(arrayA, 1)
end
arrayA_sum = 0
for k, v in ipairs(arrayA) do
arrayA_sum += v
end
arrayA_avg = arrayA_sum / table.getn(arrayA)

table.insert(arrayB, lastBet.Roll)
if(table.getn(arrayB) > arrayB_maxSize) then
table.remove(arrayB, 1)
end
arrayB_sum = 0
for k, v in ipairs(arrayB) do
arrayB_sum += v
end
arrayB_avg = arrayB_sum / table.getn(arrayB)

if(arrayB_avg > arrayA_avg) then
nextbet = betB
else
nextbet = betA
end

if(debugInfo) then
print("arrayA: " .. table.concat(arrayA,", "))
print("arrayA Size: " .. table.getn(arrayA))
print("arrayA Sum: " .. arrayA_sum)
print("arrayA Avg: " .. arrayA_avg)
print("================================")
print("arrayB: " .. table.concat(arrayB,", "))
print("arrayB Size: " .. table.getn(arrayB))
print("arrayB Sum: " .. arrayB_sum)
print("arrayB Avg: " .. arrayB_avg)
end

end

I believe this is what you're looking for. If you need any adjustments, please let me know.
@RCORE - Your inbox is full. I can't send you PM's.

Need help programming a script? Contact me.
Discord: XclusiveDigital#8102

#### parakazani

• 6
• +0/-0
##### Re: sum 10 roll
« Reply #6 on: August 14, 2019, 10:28:40 pm »
you r great! thank u so much, I can change some values , no problem:)