Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Tue Nov 20, 2018 10:44 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: If color at coordinate is not within..?
Thanked: 1 time(s)  Unread post Posted: Fri Mar 13, 2015 12:59 am 
New User
New User



Joined: Mon Mar 09, 2015 6:55 pm
Posts: 10
Location: italy
Been thanked: 1 time(s)
Has thanked: 3 time(s)
Contribution Points: 10
hi, i'm starting to programme my roulette bot and i'm doing some practice with gigus's codes bot on pkr and playtech.
But i've a problem, my bot doesn't double my bet whether i win or lose. why? where is the mistake? help me pleaseee :(
i attached 2 investigor's screenshot:
1- when i lose so there aren't fiches in x:334 y:532
2- when i win so there are fiches in x 334 y 532

I copy my codes here:
Replace locate
Code:
 begin
     Window.Set location("Roulette Pro - William Hill Casino", "yes", "1", "1")
 end

Spin
Code:
 begin
     Variable.Set random number("ms", "500", "2000")
     Macro.Pause("{ms}")
 end
 begin
     Mouse.Click at coordinate relative to window("180", "420", "left", "Roulette Pro - William Hill Casino", "yes")
 end

Check if we won
Code:
begin
     Variable.Set("won", "no")
     if  Color.At coordinate is not within (RGB range)("255", "255", "255", "0", "334", "532")
          begin
               Variable.Set("won", "yes")
          end
 end

Place bet
Code:
begin
     Mouse.Click at coordinate relative to window("359", "393", "left", "Roulette Pro - William Hill Casino", "yes")
     Macro.Pause("500")
 end


-------------------------------------------------------------------------------------------------------------------------------------------
Play
Code:
begin
     Macro.Execute new("Gigus", "replace locate", "yes")
     Macro.Execute new passing 1 argument("Gigus", "Place Bet", "yes", "Spin", "0")
     Macro.Pause("500")
     Macro.Execute new passing 1 argument("Gigus", "Spin", "yes", "currentBet", "1")
     Macro.Pause("800")
     Macro.Execute new passing 1 argument("Gigus", "Check if we won", "yes", "won", "0")
 end
 if  Variable.Is equal to("won", "0")
     begin
          Variable.Multiply (Math)("Bet", "2")
          if  Variable.Is greater than (Math)("Bet", "{maxBet}")
               begin
                    Variable.Set("Bet", "{startingBet}")
               end
     end
 if  Variable.Is equal to("won", "1")
     begin
          Variable.Set("currentBet", "{startingBet}")
     end

variables:
Code:
{startingBet} 1
{bet} 1
{maxBet} 64
{won} 0


Attachments:
roulette 2.png
roulette 2.png [ 895.81 KiB | Viewed 2188 times ]
roulette.png
roulette.png [ 900.69 KiB | Viewed 2188 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: If color at coordinate is not within..?
Thanked: 0 time(s)  Unread post Posted: Fri Mar 13, 2015 3:16 am 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1839
Location: USA
Been thanked: 393 time(s)
Has thanked: 33 time(s)
Contribution Points: 16376
The most important aspect of roulette bots is making sure it is able to accurately determine if you win or lose. It's also the most common problem when first creating roulette bots.

There's a couple of ways to determine what the actual problem is. The best way (for a doubling strategy) is to wait for a loss, then view the execution log. The log will tell if BEM determined it was a win or loss. If it's not reading it correctly, then you know that's the area you need to work on.

If you could label where you looking for a win/loss on those images, I could help you out more. All I can tell is that it seems to be somewhere at the bottom of the table near the chips, but your script says "if it is not white, then we won". I don't understand that part. Other than that, I would say add a little bit of tolerance to the range. You have it as "0" right now, at least bump it up to "10".

_________________
----------------------------------------Syrifina---------------------------------------------------
PM me for licenses and/or licensing information: Click Here
[Be sure to include and update your profile with your BE ID]

Forum Rules
Reminder of rules regarding Contribution points
Getting started in 1, 2, 3
Virtual Drivers; Manual Installers


Top
 Profile  
Reply with quote  
 Post subject: Re: If color at coordinate is not within..?
Thanked: 0 time(s)  Unread post Posted: Fri Mar 13, 2015 9:12 am 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4523
Been thanked: 1192 time(s)
Has thanked: 132 time(s)
Contribution Points: 32845
Id suggest decorating all your conditional logic with reporting code, that way the log will show you exactly what BE read from the game, and thereby knowing what it acted based on.

You can do that by using:
Code:
     Macro.Report progress("Result was black")
     Macro.Report progress("We won")


Once you run the macro then, it will show you exactly where the problem is.

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: If color at coordinate is not within..?
Thanked: 0 time(s)  Unread post Posted: Fri Mar 13, 2015 9:56 am 
New User
New User



Joined: Mon Mar 09, 2015 6:55 pm
Posts: 10
Location: italy
Been thanked: 1 time(s)
Has thanked: 3 time(s)
Contribution Points: 10
thank for the answer so i added the string for the log this is result:
1° i've lost
2° i've lost
3° i've win

Code:
Started
Executing: Macro.Report progress(Progress: Result was black)
Executing: Macro.Report progress(Progress: We won)
Executing: Macro.Execute new(Macro Category: Gigus, Macro Name: replace locate, Wait: yes)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Place Bet, Wait: yes, Argument 1 Name: Spin, Argument 1 Value: 0)
Executing: Macro.Pause(Duration: 500)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Spin, Wait: yes, Argument 1 Name: currentBet, Argument 1 Value: 1)
Executing: Macro.Pause(Duration: 800)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Check if we won, Wait: yes, Argument 1 Name: won, Argument 1 Value: 0)
Checking if: Variable.Is equal to(Variable name: won, Value: 0)
Result: No
Checking if: Variable.Is equal to(Variable name: won, Value: 1)
Result: No
Executing: Macro.Report progress(Progress: Result was black)
Executing: Macro.Report progress(Progress: We won)
Executing: Macro.Execute new(Macro Category: Gigus, Macro Name: replace locate, Wait: yes)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Place Bet, Wait: yes, Argument 1 Name: Spin, Argument 1 Value: 0)
Executing: Macro.Pause(Duration: 500)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Spin, Wait: yes, Argument 1 Name: currentBet, Argument 1 Value: 1)
Executing: Macro.Pause(Duration: 800)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Check if we won, Wait: yes, Argument 1 Name: won, Argument 1 Value: 0)
Checking if: Variable.Is equal to(Variable name: won, Value: 0)
Result: No
Checking if: Variable.Is equal to(Variable name: won, Value: 1)
Result: No
Executing: Macro.Report progress(Progress: Result was black)
Executing: Macro.Report progress(Progress: We won)
Executing: Macro.Execute new(Macro Category: Gigus, Macro Name: replace locate, Wait: yes)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Place Bet, Wait: yes, Argument 1 Name: Spin, Argument 1 Value: 0)
Executing: Macro.Pause(Duration: 500)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Spin, Wait: yes, Argument 1 Name: currentBet, Argument 1 Value: 1)
Executing: Macro.Pause(Duration: 800)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Check if we won, Wait: yes, Argument 1 Name: won, Argument 1 Value: 0)
Checking if: Variable.Is equal to(Variable name: won, Value: 0)
Result: No
Checking if: Variable.Is equal to(Variable name: won, Value: 1)
Result: No
Executing: Macro.Report progress(Progress: Result was black)
Executing: Macro.Report progress(Progress: We won)
Executing: Macro.Execute new(Macro Category: Gigus, Macro Name: replace locate, Wait: yes)
Aborted


and i've changed ''check if we lost'' In:
Code:
 if  Color.At coordinate is within (RGB range)("255", "255", "255", "10", "334", "532")


it should be : if white is at those coordinate we win...i think :lol: but it stil doesn't work :oops:


Top
 Profile  
Reply with quote  
 Post subject: Re: If color at coordinate is not within..?
Thanked: 0 time(s)  Unread post Posted: Fri Mar 13, 2015 10:17 pm 
Partner / Developer
Partner / Developer
User avatar



Joined: Mon Jan 18, 2010 11:51 am
Posts: 4523
Been thanked: 1192 time(s)
Has thanked: 132 time(s)
Contribution Points: 32845
Please update your original post with the new code, I think you may have misunderstood or misplaced some of the reporting code.
The reports should tell what actually happened in the game, not just hardcoded "Result was black" or "we won".

_________________
Blue Eye - Developer / Moderator
Code:
Gigus


Please read the rules about contribution points - click here

Do you know everything about BE, the forum, licenses and contribution points?
Please take a minute to read this introduction & guidelines.


Top
 Profile  
Reply with quote  
 Post subject: Re: If color at coordinate is not within..?
Thanked: 0 time(s)  Unread post Posted: Sat Mar 14, 2015 9:56 am 
New User
New User



Joined: Mon Mar 09, 2015 6:55 pm
Posts: 10
Location: italy
Been thanked: 1 time(s)
Has thanked: 3 time(s)
Contribution Points: 10
Gigus wrote:
Please update your original post with the new code, I think you may have misunderstood or misplaced some of the reporting code.
The reports should tell what actually happened in the game, not just hardcoded "Result was black" or "we won".


replace locate
Code:
 begin
     Window.Set location("Roulette Pro - William Hill Casino", "yes", "1", "1")
 end

spin
Code:
 
 begin
    Variable.Set random number("ms", "500", "2000")
     Macro.Pause("{ms}")
 end
 begin
     Mouse.Click at coordinate relative to window("180", "420", "left", "Roulette Pro - William Hill Casino", "yes")
 end

place bet
Code:
 begin
     Mouse.Click at coordinate relative to window("359", "393", "left", "Roulette Pro - William Hill Casino", "yes")
     Macro.Pause("500")
 end


check if we won
Code:
begin
     Variable.Set("won", "no")
     if  Color.At coordinate is within (RGB range)("255", "255", "255", "10", "334", "532")
          begin
               Variable.Set("won", "yes")
          end
 end

play
Code:
begin
     Macro.Report progress("Result was black")
     Macro.Report progress("We won")
     Macro.Execute new("Gigus", "replace locate", "yes")
     Macro.Execute new passing 1 argument("Gigus", "Place Bet", "yes", "Spin", "0")
     Macro.Pause("500")
     Macro.Execute new passing 1 argument("Gigus", "Spin", "yes", "currentBet", "1")
     Macro.Pause("800")
     Macro.Execute new passing 1 argument("Gigus", "Check if we won", "yes", "won", "0")
 end
 if  Variable.Is equal to("won", "0")
     begin
          Variable.Multiply (Math)("Bet", "2")
          if  Variable.Is greater than (Math)("Bet", "{maxBet}")
               begin
                    Variable.Set("Bet", "{startingBet}")
               end
     end
 if  Variable.Is equal to("won", "1")
     begin
          Variable.Set("currentBet", "{startingBet}")
     end


and the execution log is the same:
1° i've lost
2° i've lost
3° i've win

Code:
Started
Executing: Macro.Report progress(Progress: Result was black)
Executing: Macro.Report progress(Progress: We won)
Executing: Macro.Execute new(Macro Category: Gigus, Macro Name: replace locate, Wait: yes)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Place Bet, Wait: yes, Argument 1 Name: Spin, Argument 1 Value: 0)
Executing: Macro.Pause(Duration: 500)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Spin, Wait: yes, Argument 1 Name: currentBet, Argument 1 Value: 1)
Executing: Macro.Pause(Duration: 800)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Check if we won, Wait: yes, Argument 1 Name: won, Argument 1 Value: 0)
Checking if: Variable.Is equal to(Variable name: won, Value: 0)
Result: No
Checking if: Variable.Is equal to(Variable name: won, Value: 1)
Result: No
Executing: Macro.Report progress(Progress: Result was black)
Executing: Macro.Report progress(Progress: We won)
Executing: Macro.Execute new(Macro Category: Gigus, Macro Name: replace locate, Wait: yes)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Place Bet, Wait: yes, Argument 1 Name: Spin, Argument 1 Value: 0)
Executing: Macro.Pause(Duration: 500)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Spin, Wait: yes, Argument 1 Name: currentBet, Argument 1 Value: 1)
Executing: Macro.Pause(Duration: 800)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Check if we won, Wait: yes, Argument 1 Name: won, Argument 1 Value: 0)
Checking if: Variable.Is equal to(Variable name: won, Value: 0)
Result: No
Checking if: Variable.Is equal to(Variable name: won, Value: 1)
Result: No
Executing: Macro.Report progress(Progress: Result was black)
Executing: Macro.Report progress(Progress: We won)
Executing: Macro.Execute new(Macro Category: Gigus, Macro Name: replace locate, Wait: yes)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Place Bet, Wait: yes, Argument 1 Name: Spin, Argument 1 Value: 0)
Executing: Macro.Pause(Duration: 500)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Spin, Wait: yes, Argument 1 Name: currentBet, Argument 1 Value: 1)
Executing: Macro.Pause(Duration: 800)
Executing: Macro.Execute new passing 1 argument(Macro Category: Gigus, Macro Name: Check if we won, Wait: yes, Argument 1 Name: won, Argument 1 Value: 0)
Checking if: Variable.Is equal to(Variable name: won, Value: 0)
Result: No
Checking if: Variable.Is equal to(Variable name: won, Value: 1)
Result: No
Executing: Macro.Report progress(Progress: Result was black)
Executing: Macro.Report progress(Progress: We won)
Executing: Macro.Execute new(Macro Category: Gigus, Macro Name: replace locate, Wait: yes)
Aborted


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group