Blue Eye Logo

Blue Eye Macro

Automation is freedom
It is currently Thu Nov 21, 2024 3:07 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Bot for TROY
Thanked: 0 time(s)  Unread post Posted: Mon Oct 10, 2011 12:55 am 
VIP Contributor
VIP Contributor
User avatar



Joined: Mon Sep 12, 2011 8:36 pm
Posts: 1307
Location: Steins;Gate
Been thanked: 91 time(s)
Has thanked: 0 time(s)
Contribution Points: 15369
Read the post I made above yours, it should fix it.

Critical wrote:
Try using one of the Image commands and take a snapshot of the header here. Make the range to be '20' as we want it to detect when the enemy's HP disappears:
Image

Code:
 begin
     if  Image.Can not be located on screen("{Enemy's HP Picture Here}", "20")
          begin
               Keyboard.Press key("{<tab>}")
          end
 end
 

_________________
Image
Code:
> Meanwhile at Blue Eye Macro...
> BEM Video Games Department - Moderator, Coder, Debugger, Math/Physics & Algorithm Enthusiast - USA
Current Project: Mod Duty


Top
 Profile  
Reply with quote  
 Post subject: Re: Bot for TROY
Thanked: 0 time(s)  Unread post Posted: Sat Oct 15, 2011 1:42 pm 
New User
New User



Joined: Sat Oct 15, 2011 1:37 pm
Posts: 1
Been thanked: 0 time(s)
Has thanked: 0 time(s)
Contribution Points: 16
I don't understand how to use this code or and where this
begin
if Image.Can not be located on screen("{Enemy's HP Picture Here}", "20")
begin
Keyboard.Press key("{<tab>}")
end
end
would go for the fix can you guys upload a file that I can import into BE or explain for a noob? :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Bot for TROY
Thanked: 0 time(s)  Unread post Posted: Sat Oct 15, 2011 4:16 pm 
VIP Contributor
VIP Contributor
User avatar



Joined: Mon Sep 12, 2011 8:36 pm
Posts: 1307
Location: Steins;Gate
Been thanked: 91 time(s)
Has thanked: 0 time(s)
Contribution Points: 15369
crazywino wrote:
I don't understand how to use this code or and where this
begin
if Image.Can not be located on screen("{Enemy's HP Picture Here}", "20")
begin
Keyboard.Press key("{<tab>}")
end
end
would go for the fix can you guys upload a file that I can import into BE or explain for a noob? :)


This is a short explanation of the command itself: viewtopic.php?f=164&t=338

As for a descriptive detail, this is how the Image command works:

The parameters needed in order for the Image command to work are:

Code:
Image.Can not be located on screen("{Directory of the Picture That Needs to be Read}", "{Percentage of Pixels Detected that Matches the Picture[up to 100%]}")


As for the {Directory of the Picture That Needs to be Read}, you will need to take a snapshot in-game and crop it to the section that you do need. I will have to refer to an example of one of my macros here so excuse me on that. In my Digimon Bot example [and what you're about to do will be the exact same thing] (viewtopic.php?f=304&t=2251), I basically let it keep track of the enemy's HP bar. You can take a screenshot and paste it on Paint. If you want something a bit easier, I recommend using SnagIt as it takes pictures of regions on the spot, regardless of what you're doing. When you're done cropping your picture and saved it, now you need to locate it's directory. Simply right click your picture and see it's properties, copy and paste the path directory.

Image
(Sorry about the yen symbols, I have a MS Japanese text thing enabled. They're really supposed to be backslashes '\')

I saved it under 'C:\Digimon'. However you need to add something extra. You will also need to add: 'C:\Digimon\<Picture's Name>.<jpg/png>'. So in this case, I made my enemy's HP picture a .png type. Therefore we need to fill this part of the code with:

Code:
Image.Can not be located on screen("C:\Digimon\digimonenemyHP.png", "{Percentage of Pixels Detected that Matches the Picture[up to 100%]}")


Protip: I recommend creating a file in your C-drive just for convenience and name it to your liking.

The second part is easy enough. It compares the image with the entire in-game screen and tries to find it. With the addition of the 'if' statement, the macro states that if it finds a comparison that's at a certain percentage OR higher, it will execute the 'next set' of commands underneath it (from that begin to end). My rule of thumb on the numbers is keep it at 30% or lower (Yes, even 5% sometimes does the trick, but that's all part of the trial and error in creating a macro).

By the way, you can simply copy the previous code I have up there, just delete the curly brackets '{}' and what's inside them. You should end up having somewhere along these lines. The directory on my code is an example, you can change it at anytime:
Code:
begin
     if  Image.Can not be located on screen("C:\BEM Images\troyenemyHP.png", "30")
          begin
               Keyboard.Press key("{<tab>}")
          end
end


Now that you're more knowledgeable with it, you can make good macros. Image and Color commands are powerful and the basis of great gaming macros.

If you want more information on how to use the color commands, just read the previous pages of this thread, I've thoroughly explained it to others and they seem to like it.

Protip 2: If at anytime you get stuck with the commands on what to exactly type (this applies to everything you do in Blue Eye Macro), click anywhere inside the blank as so and it will give you a detailed description on what you need to do:

Image

Oh, and enjoy your stay at Blue Eye Macro: The Gigus Edition. :lol:

_________________
Image
Code:
> Meanwhile at Blue Eye Macro...
> BEM Video Games Department - Moderator, Coder, Debugger, Math/Physics & Algorithm Enthusiast - USA
Current Project: Mod Duty


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2

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