Skip to content

Instantly share code, notes, and snippets.

@mydicebot
Created April 25, 2020 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mydicebot/3846d6f4b615200048927649d410640e to your computer and use it in GitHub Desktop.
Save mydicebot/3846d6f4b615200048927649d410640e to your computer and use it in GitHub Desktop.
Demo of resume() #mydicebot#
chance = 1
multiplier = 2
basebet = 0.00000001
bethigh = false
nextbet = basebet
my_variable = 1
function sleep(n)
t0 = os.clock()
while os.clock() - t0 <= n do end
end
function dobet()
print('chance is ' .. tostring(chance))
print('my_variable is ' .. tostring(my_variable))
if(chance == 3) then
print('chance is ' .. tostring(chance) .. ', so stop and sleep for a while and resume from here again.')
stop()
sleep(2)
resume()
end
chance = chance + 1
my_variable = my_variable + 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment