Hi all,
In my endeavour to learn more about coding, I have tried to create a more complicated bot for roulette. I am still working on it but here is my current code for a bot using the 12 point divisor betting strategy.
It currently just alternates between red and black, but it should be easy enough to change for your own betting strategies.
You may need to update the co-ordinates for mouse clicking for you computer.
It was made for Casino.com so should work on any Playtech casinos "out of the box" as they use the same software
Any questions just ask. If you want to see a feature added let me know, i am still learning so it may take me a while to add if it's complicated but i will do my best.
If you think there is a better way to do something in my code, feel free to let me know, i am always up for learning more!
Pre-Defined Variables:
{target} - set to your profit target for the session, ie: 10 units
{currentBet} - set to your starting bet...I started with $1 do set to 1, $10 would be 10, etc
{winOdds} - this was set to 1 as playing red/black with odds 1:1, if your doing rows with odds 1:2, then set to 2
{divisor} - this is what you want the target to be divided by. some use 6 but i did this for 12 (hence 12 point divisor)
{tempTarget} - set this to the same as your profit target and the code will change this automatically
{won} - set to 0 and code will change this automatically
{lastBet} - set to black or red and code will change this automatically
{bet} - set to opposite colour of lastBet and code will change this automatically
{maxBet} - set this if you would like a safety brake...basically it won't make a bet higher than this but will continue to bet this amount until you have earned back what you lost.
{minBet} - set this to your starting bet
{newTarget} - set to same profit target for the session and code will change this automatically.
Code:
Code:
Begin
Function.Execute("Spin")
Humanly.Pause("500", "1000")
Function.Execute("Check if we won")
Humanly.Pause("100", "200")
Function.Execute("Determine Betsize")
Humanly.Pause("100", "200")
Function.Execute("Where to Bet")
Humanly.Pause("100", "200")
Function.Execute("Bet")
Humanly.Pause("100", "200")
Function.Execute("Last Bet")
end
function("Spin")
begin
Mouse.Click at coordinate("189", "428", "left")
end
function
function("Check if we won")
begin
// Win - found "w"
if Color.Pixel pattern can be located on screen near coordinate("0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,2,3,1,1,0,0,0,0,0,-1,0,0,0,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,1,0,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,1,0,0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,-1,0,0,0,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,1,0,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,1,0,0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,0,0,0,0,1,0,0,0,1,0,0,1,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0", "0", "647", "167", "20")
begin
Variable.Set("won", "0")
end
// Lose - no "w"
if Color.Pixel pattern can not be located on screen near coordinate("0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,2,3,1,1,0,0,0,0,0,-1,0,0,0,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,1,0,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,1,0,0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,-1,0,0,0,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,1,0,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,1,0,0,0,0,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,254,254,254,0,1,0,0,0,0,1,0,0,0,1,0,0,1,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,-1,254,254,254,0,-1,254,254,254,0,-1,0,0,0", "0", "647", "167", "20")
begin
Variable.Set("won", "1")
end
end
function
function("Determine Betsize")
begin
if Variable.Is equal to("won", "0")
begin
Variable.Multiply (Math)("currentBet", "{winOdds}")
Variable.Subtract (Math)("target", "{currentBet}")
if Variable.Is less than (Math)("target", "1")
begin
Variable.Set("target", "{newTarget}")
end
Variable.Set("tempTarget", "{target}")
Variable.Divide (Math)("tempTarget", "{divisor}")
Variable.Round (Math)("tempTarget", "0")
Variable.Set("currentBet", "{tempTarget}")
end
if Variable.Is equal to("won", "1")
begin
Variable.Add (Math)("target", "{currentBet}")
Variable.Set("tempTarget", "{target}")
Variable.Divide (Math)("tempTarget", "{divisor}")
Variable.Round (Math)("tempTarget", "0")
Variable.Set("currentBet", "{tempTarget}")
end
if Variable.Is greater than (Math)("currentBet", "{maxBet}")
begin
Variable.Set("currentBet", "{maxBet}")
end
if Variable.Is less than (Math)("currentBet", "{minBet}")
begin
Variable.Set("currentBet", "{minBet}")
end
end
function
function("Where to Bet")
if Variable.Is equal to("lastBet", "red")
Begin
Variable.Set("bet", "black")
end
if Variable.Is equal to("lastBet", "black")
begin
Variable.Set("bet", "red")
end
function
function("Bet")
if Variable.Is equal to("bet", "black")
Begin loop("{currentBet}")
Mouse.Click at coordinate("359", "403", "left")
end
if Variable.Is equal to("bet", "red")
begin loop("{currentBet}")
Mouse.Click at coordinate("418", "447", "left")
end
function
function("Last Bet")
if Variable.Is equal to("bet", "black")
Begin
Variable.Set("lastBet", "black")
end
if Variable.Is equal to("bet", "red")
begin
Variable.Set("lastBet", "red")
end
function