Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Sun Apr 30, 2017 9:08 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: patterns with variables
Thanked: 0 time(s)  Unread post Posted: Sat Sep 10, 2016 11:00 pm 
Silver Contributor
Silver Contributor



Joined: Sun Aug 05, 2012 9:17 pm
Posts: 188
Been thanked: 5 time(s)
Has thanked: 3 time(s)
Contribution Points: 90
first of all i want to apologize if this was allready asked, but i couldn't find anything about it so...

well here is what i'm planning to do:

i wanna get the rgb of 3 point stored into some variables, r1-r3, g1-g3, b1-b3.
this works.

next step is i want to check if this pattern appears on the screen, actually it should because i got the pixels from it.

this way i wanted to try:

Color.Get color at coordinate (RGB)("300", "310", "r1", "g1", "b1")
Color.Get color at coordinate (RGB)("310", "310", "r2", "g2", "b2")
Color.Get color at coordinate (RGB)("300", "335", "r3", "g3", "b3")
if Color.Pixel pattern can be located on screen("{r1},{g1},{b1},10,0,{r2},{g2},{b2},-10,25,{r3},{g3},{b3}", "0")



edit: okay after some time i found my first but surely not last mistake.
the command pixel.pattern wants to get a string, it doesn't transform the values into a string by itselfs.


so now the better version

Color.Get color at coordinate (RGB)("300", "310", "r1", "g1", "b1")
Color.Get color at coordinate (RGB)("310", "310", "r2", "g2", "b2")
Color.Get color at coordinate (RGB)("300", "335", "r3", "g3", "b3")
Variable.Evaluate (Text)("{r1},{g1},{b1},10,0,{r2},{g2},{b2},0,25,{r2},{g3},{b3}", "pattern")
if Color.Pixel pattern can be located on screen("{pattern}", "0")

but... execute log

Executing: Color.Get color at coordinate (RGB)(X Coordinate: 300, Y Coordinate: 310, R: r1, G: g1, B: b1)
Executing: Color.Get color at coordinate (RGB)(X Coordinate: 310, Y Coordinate: 310, R: r2, G: g2, B: b2)
Executing: Color.Get color at coordinate (RGB)(X Coordinate: 300, Y Coordinate: 335, R: r3, G: g3, B: b3)
Executing: Variable.Evaluate (Text)(Expression: {r1},{g1},{b1},10,0,{r2},{g2},{b2},0,25,{r2},{g3},{b3}, To variable: pattern)
Checking if: Color.Pixel pattern can be located on screen(Pattern: 57,58,49,10,0,39,40,29,0,25,39,59,43, Range: 0)
Result: No

so where the heck is the next mistake?
maybe it's the relative x and y coords, but can't figure out what's wrong
and why is there in the log a , at the end? (the red one in the text)


Top
 Profile  
Reply with quote  
 Post subject: Re: patterns with variables
Thanked: 1 time(s)  Unread post Posted: Sun Sep 11, 2016 12:07 am 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1612
Location: USA
Been thanked: 344 time(s)
Has thanked: 25 time(s)
Contribution Points: 15673
There's a lot of issues doing the way you described.

1. It's much easier to make a pixel pattern using the Investigator tool. So you could click on those 3 points and have BEM write it for you
2. The variable.evaluate text portion of your script is not giving you the correct syntax for a pixel pattern. The pixel pattern code is written something similar to this: R,G,B,x coordinate, y coordinate, R,G,B, offset of x coordinate (how many pixels away the next x coordinate is from the first one), offset of y coordinate, ...and then repeats for the remaining number of points you want (or selected).
3. There's no need (as you mentioned) for "If pixel pattern can be found on screen" because you already know it is...therefore, just skip it and write in your next step of the script.

So, "where is your mistake"? It's partly explained in #2 above, but your evaluate expression puts 2 numbers after each RGB except for the last one.

Why is there a comma in red at the end? Because the "variable.evaluate text" is missing (looking for more) information...the last 2 numbers that I just mentioned. Not sure if your "10,0" and "-10, 25" are your offset values that you came up with, but you didn't include those for the last one.

_________________
----------------------------------------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: patterns with variables
Thanked: 0 time(s)  Unread post Posted: Sun Sep 11, 2016 3:17 pm 
Silver Contributor
Silver Contributor



Joined: Sun Aug 05, 2012 9:17 pm
Posts: 188
Been thanked: 5 time(s)
Has thanked: 3 time(s)
Contribution Points: 90
thx for your help... actually it didn't help that much, but i'm gradefull ^^

further investigation:

first of all: you got 3 points, a, b and c. going from a-->b-->c makes up 2 distances, actually 2 delta x coords, and 2 delta y coords.
thats why i've got no x-y-coords behind the last rgb.

here is my whole code, test version.

begin
Color.Get color at coordinate (RGB)("300", "310", "r1", "g1", "b1")
Color.Get color at coordinate (RGB)("310", "310", "r2", "g2", "b2")
Color.Get color at coordinate (RGB)("300", "335", "r3", "g3", "b3")
Variable.Evaluate (Text)("{r1},{g1},{b1},10,0,{r2},{g2},{b2},-10,25,{r3},{g3},{b3}", "pattern")
Window.Display message box("{pattern}", "yes")
if Color.Pixel pattern can be located on screen near coordinate("{pattern}", "0", "390", "435", "150")
begin
Mouse.Move to pixel pattern near coordinate("{pattern}", "0", "yes", "390", "435", "150")
end
end

the thing is... executing it from the editor menue it does exactly what i want.
starting it from main menue i doesn't, main differenz: the mouse is not moving.

try for youself ;)

maybe this is something for gigus, because there must be a tiny little mistake, either in my code, or in BEM.
the same script works in editor mode, but not by starting from main menue, guess it can't be an error of my code, can it?

any way every help is highly apprechiated ^^


Top
 Profile  
Reply with quote  
 Post subject: Re: patterns with variables
Thanked: 0 time(s)  Unread post Posted: Sun Sep 11, 2016 7:05 pm 
Silver Contributor
Silver Contributor



Joined: Sun Aug 05, 2012 9:17 pm
Posts: 188
Been thanked: 5 time(s)
Has thanked: 3 time(s)
Contribution Points: 90
i found out the next thing...
actually it seems that code works, from main menue and from editor mode.
the only thing is which window is opened.

let's say having firefox opened, it works.
but when i have some more windows opened, e.g. desktop as background, main menue from bem, editor mode etc. this seems do trouble bem.

either way now i'm confident to create a dmo anti-macro protector in the next week ^^

if i get it working, i will post the code and give a tutorial on how to adept it for your own bot ^^


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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