Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Wed Jan 24, 2018 9:04 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: I need to enhance "Wait for color to change" script
Thanked: 0 time(s)  Unread post Posted: Thu Nov 09, 2017 6:02 pm 
New User
New User
User avatar



Joined: Mon May 15, 2017 1:17 am
Posts: 21
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 16
Hello

There are 2 simple things that i want to do.. but i couldn't find a proper script.

1 - How to set BEM to move forward with the script whenever a color changes... not only in a specific coordinate.. but in the entire screen?

2 - Pretty much the same thing but instead of entire screen.. only in a area of interest?

Can i use this one?

"Color.Limit area of interest to coordinates("", "", "", "")"

I don't think it will work.. because it says "coordinates".


Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: I need to enhance "Wait for color to change" script
Thanked: 0 time(s)  Unread post Posted: Sat Nov 11, 2017 12:53 pm 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1706
Location: USA
Been thanked: 362 time(s)
Has thanked: 27 time(s)
Contribution Points: 15966
Let's talk about #2 first:

You have to tell BEM what region you want to limit the search to and coordinates is a way to do it. If you read the dialog text on the Instructions page for color.limit area of interest to coordinates it says (viewtopic.php?f=162&t=581),
"The first two arguments is the coordinate set specifying the top left corner of the limited region, the remaining two argument specifies the width and height of the region."
So, you basically drawing a box and telling BEM to only look inside that box.

#1: This question is a little vague...there's a lot of variables that you may need to explain to properly answer your question, or give an example, or post screenshots.

You first need to tell BEM what color your looking for and where (but let's assume you looking at the entire screen). You could use: viewtopic.php?f=150&t=1211. Is that the only instance of that color on the screen? If it's not, you're going to have to define it better; some reference for BEM. If you look at the documentation pages this can be done with areas, coordinates, mouse position, etc.

Assuming that your color only appears once on the screen, you can script it with "if color.can not be located..." (viewtopic.php?f=150&t=1212)...then do something, meaning the color changed or is gone.

If you need something more complex, you should post screenshots or something.

_________________
----------------------------------------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: I need to enhance "Wait for color to change" script
Thanked: 0 time(s)  Unread post Posted: Sat Nov 11, 2017 7:04 pm 
New User
New User
User avatar



Joined: Mon May 15, 2017 1:17 am
Posts: 21
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 16
I'll try to explain not with screenshots.. but simple images

Let's assume that this is my whole PC screen

Image

I set BEM to

Color.Wait for color at coordinate to change("1200", "600")

Image

And then there's a color change at the bottom right corner, which is coordinate 1200x 600y
Ok the color wait script above detects and then move forward.

But... what if there's a color change at other point of the screen??? So what..?
BEM will stay freezed forever, because the color change wasn't on the coordinate i specified.

So it could have a script like that

Color.Wait for color at screen to change("", "")
but there isn't


Now.. as for my question 2

Image

So i configured BEM to only look what happens inside the blue box.
In number 1 case, there's a color change outside of the box.. so bem will do nothing because it's out of the area of interest.

In number 2, there's a color change inside the blue box, BEM detects this change, and move forward with the script.
I would need something like this:

Color.Wait for color to change at area of interest("", "","","")


Top
 Profile  
Reply with quote  
 Post subject: Re: I need to enhance "Wait for color to change" script
Thanked: 0 time(s)  Unread post Posted: Sat Nov 18, 2017 10:55 pm 
Silver Contributor
Silver Contributor



Joined: Thu Nov 24, 2016 12:55 am
Posts: 157
Been thanked: 32 time(s)
Has thanked: 3 time(s)
Contribution Points: 211
Hi!

1. In the image you show the background of the screen is black.
if the background or the screen does not change it's color until the color you are waiting to appear shows up(random color shows up). try using
if color. image cannot be located on screen. the image you will need to use is the image that the color you are waiting has not yet appeared. also set image recognition at 10 on general settings.. also 100% match at the code. then just loop it.
if the back ground or the screen changes a single pixel while waiting for the color to appear then this will not work.

2. Is the color you are waiting is it only 1 pixel or more than 1 pixel that share the same color?
if it is more than 1 pixel you can use
if color.pixel patter can be located on screen. then just loop it.
if it is only one pixel then this won't work.

3. If you are waiting is part of an image then you can use
If color.image can be located on screen. loop it. set image recognition at 10 on general settings.. also 100% match at the code.
However if the image is a bit transparent which changes the color of the image change a little bit.
The this won't work try using the pixel pattern

4. If the color of background is fixed and doesn't share the same color of the color you are waiting for the you can use.
If color. color can be located on screen. then just loop it.

5. if the color you are waiting shares the same color of your background, not an image, changes it's color.
And the background is not fixed. then it would be hard..

6. It would be easier if you can show an actual image so we can help you much easier.

_________________
Ragnarok Online

Bot4You ROPH (will also work on other servers but you need to make your own bypass)
http://www.blueeye-macro.com/viewtopic.php?f=437&t=30450

Creating .spr file or sprite for Pixel bot
http://www.blueeye-macro.com/viewtopic.php?f=435&t=30445

Changing monster sprite and items sprite
http://www.blueeye-macro.com/viewtopic.php?f=435&t=30516


Top
 Profile  
Reply with quote  
 Post subject: Re: I need to enhance "Wait for color to change" script
Thanked: 0 time(s)  Unread post Posted: Sun Nov 19, 2017 2:35 am 
New User
New User
User avatar



Joined: Mon May 15, 2017 1:17 am
Posts: 21
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 16
Roan1234321 wrote:
Hi!

1. In the image you show the background of the screen is black.

Well.. this was just a example, actually the screen could be any color, and can be a mix of a lot of colors.

Roan1234321 wrote:
2. Is the color you are waiting is it only 1 pixel or more than 1 pixel that share the same color?


I'm not waiting for a particular color.. it can be any color, anywhere on screen.

Roan1234321 wrote:
6. It would be easier if you can show an actual image so we can help you much easier.


Image

When i click there on the red arrow, it changes the data.
So i just would need a simple script that can detect any change on the screen.

Actually it's easy to solve the case on this image.
But i would like to learn a more.. general script which i could use in a lot of situations.


Top
 Profile  
Reply with quote  
 Post subject: Re: I need to enhance "Wait for color to change" script
Thanked: 1 time(s)  Unread post Posted: Sun Nov 19, 2017 10:55 am 
Partner / License admin
Partner / License admin
User avatar



Joined: Sun Oct 10, 2010 5:16 pm
Posts: 1706
Location: USA
Been thanked: 362 time(s)
Has thanked: 27 time(s)
Contribution Points: 15966
Yea man, that's totally different. I wouldn't use color at all for that example. Like Roan and I have been saying, just tell us what you're really trying to do and we can help you out.

For this, I would use instructions/criteria under "file" (viewforum.php?f=163). From what you posted this time, I'm assuming that you're doing something with this data and you're trying to see if you already have this information (preventing duplicates).

So I would have BEM read the data, if it's new then copy/save/post some where for you, but if it's not new then click refresh or do nothing. That's easy enough and more than one way to do it.

First since you said when you click on that refresh button...then have BEM wait for mouse.click and then read the data...or just have BEM continually read it, but put in a macro.pause for something like 100ms. That's real quick, it won't interrupt what you're doing, and it will significantly increase performance.

*Side note: I just did this at work about a year ago. When I first wrote it, I didn't have a macro.pause in there and BEM hogged all my resources to continually check. I put a macro.pause in there and it worked beautifully. Also, it doesn't really matter how long the pause is...just put a pause in there.

So I would use the instruction file.read from the link above and then use Regex to look for matches under file->criteria (viewforum.php?f=151).

There's other ways to do it, but that's what I would try first. I can help you script it out if you need help. Just need to know you're real-world examples.

_________________
----------------------------------------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: I need to enhance "Wait for color to change" script
Thanked: 0 time(s)  Unread post Posted: Mon Jan 01, 2018 9:59 pm 
New User
New User
User avatar



Joined: Mon May 15, 2017 1:17 am
Posts: 21
Been thanked: 0 time(s)
Has thanked: 3 time(s)
Contribution Points: 16
Syrifina wrote:
Yea man, that's totally different. I wouldn't use color at all for that example. Like Roan and I have been saying, just tell us what you're really trying to do and we can help you out.

For this, I would use instructions/criteria under "file" (viewforum.php?f=163). From what you posted this time, I'm assuming that you're doing something with this data and you're trying to see if you already have this information (preventing duplicates).

So I would have BEM read the data, if it's new then copy/save/post some where for you, but if it's not new then click refresh or do nothing. That's easy enough and more than one way to do it.

First since you said when you click on that refresh button...then have BEM wait for mouse.click and then read the data...or just have BEM continually read it, but put in a macro.pause for something like 100ms. That's real quick, it won't interrupt what you're doing, and it will significantly increase performance.

*Side note: I just did this at work about a year ago. When I first wrote it, I didn't have a macro.pause in there and BEM hogged all my resources to continually check. I put a macro.pause in there and it worked beautifully. Also, it doesn't really matter how long the pause is...just put a pause in there.

So I would use the instruction file.read from the link above and then use Regex to look for matches under file->criteria (viewforum.php?f=151).

There's other ways to do it, but that's what I would try first. I can help you script it out if you need help. Just need to know you're real-world examples.



Mmm.. maybe that will work, but seems to complicated when i want is something so incredibly simple.
Also i don't like to use macro pauses, i bot lot of things which are bound on time variables, the same actions may take 1 to 10 secs. It varys to much.Making macro pauses inaccurate. I prefer to bot more precisely on color detection.

I'm back here cause i really need to figure out how to make a script that works like this

" Color.Wait for any screen pixel (or color) to change"

That's it. Which script would be closest to this?

Imagine you're a guard securing a treasure, and ANYTHING that shows up in that area you have to shoot.
A person, a bird, a car, a leaf, doesn't matter.
If anything appears in the area you have to shoot. That's my analogy for what i need.


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