Blake's CSGODOUBLE Script

try to take over the world!

  1. // ==UserScript==
  2. // @name Blake's CSGODOUBLE Script
  3. // @namespace https://github.com/GamrCorps/CSGODOUBLE/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match http://www.csgodouble.com/
  8. // @grant none
  9. // @updateUrl https://rawgit.com/GamrCorps/CSGODOUBLE/master/csgodouble4.js
  10. // ==/UserScript==
  11.  
  12. //Customizable Options
  13. startingBet = 1
  14. maxBet = 128
  15. maxSteps = 100
  16. pattern = ["black", "black", "black", "red"]
  17. betWrongFactor = 2
  18. resetBetOnGreen = false;
  19.  
  20. function getNextColor(step){
  21. return pattern[step % pattern.length]
  22. }
  23.  
  24. function getNextBet(bet, correct){
  25. return correct ? startingBet : bet * betWrongFactor
  26. }
  27.  
  28. function numToColor(num){
  29. return num==0?"green":num<8?"red":"black"
  30. }
  31.  
  32. function placeBet(color, bet) {
  33. input.value = bet.toString()
  34. if (color == "red") {
  35. redButton.click()
  36. } else if (color == "green") {
  37. greenButton.click()
  38. } else {
  39. blackButton.click()
  40. }
  41. input.value = ""
  42. }
  43.  
  44. currentColorStep = 0
  45. currentStep = 0
  46. currentBet = startingBet
  47. banner = document.getElementById('banner')
  48. past = document.getElementById('past')
  49. redButton = document.getElementById('panel1-7').children[0].children[0]
  50. greenButton = document.getElementById('panel0-0').children[0].children[0]
  51. blackButton = document.getElementById('panel8-14').children[0].children[0]
  52. input = document.getElementById('betAmount')
  53. betInStep = false;
  54. lastCorrect = true;
  55.  
  56. setInterval(function(){
  57. if (banner.innerHTML == "***ROLLING***") {
  58. betInStep = false;
  59. } else if (banner.innerHTML.startsWith("Rolling") && !betInStep){
  60. pastColor = numToColor(parseInt(past.children[9].innerHTML))
  61. color = getNextColor(currentColorStep)
  62. if (pastColor!=getNextColor(currentColorStep-1)) {
  63. lastCorrect=false
  64. } else {
  65. lastCorrect=true
  66. }
  67. amount = getNextBet(currentBet, lastCorrect)
  68. currentBet = getNextBet(currentBet, lastCorrect)
  69. if (pastColor=="green") {
  70. currentColorStep = 0
  71. if (resetBetOnGreen) {
  72. amount = startingBet
  73. currentBet = startingBet
  74. }
  75. color = getNextColor(currentColorStep)
  76. }
  77. console.log(color+": "+amount.toString())
  78. placeBet(color, Math.min(amount, maxBet))
  79. currentColorStep += 1
  80. currentStep += 1
  81. betInStep = true
  82. }
  83. },500);