Advertisement
GeekGGs

bloxflip crash predictor discord bot

Feb 18th, 2023
7,116
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. from discord.ext import commands
  2. import discord
  3. import cloudscraper
  4.  
  5. s = cloudscraper.create_scraper()
  6. bot = commands.Bot(command_prefix='.', intents=discord.Intents.all())
  7.  
  8. def crashPoint(num):
  9. info = s.get('https://api.bloxflip.com/games/crash').json()['history'][num]['crashPoint']
  10. return info
  11.  
  12. @bot.command()
  13. async def crash(ctx):
  14. one = crashPoint(0)
  15. two = crashPoint(1)
  16. three = crashPoint(2)
  17.  
  18. pst3 = [one, two, three]
  19.  
  20. #get average of paste 3 games
  21. average = sum(pst3) / len(pst3)
  22. prediction = (1 / (average - 2) / 1)
  23. if prediction < 1:
  24. prediction = 1. + prediction
  25. safe = ''
  26. if prediction > 3:
  27. safe = 'Above 2x'
  28. elif prediction < 3:
  29. safe = "Less than 1.5x"
  30. elif prediction > 4:
  31. safe = 'Above 4x'
  32. prediction = "{:.2f}".format(prediction)
  33. em = discord.Embed(color=0xff55ff)
  34. em.add_field(name=f"**Prediction: {prediction}x**", value=f"Average: {int(average)}\nSafe Bet: {safe}")
  35. await ctx.reply(embed=em)
  36.  
  37.  
  38. bot.run('Bot Token')
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement