Welcome, Guest
Please Login or Register.    Lost Password?

how to determine the shield armor and hull
(0 viewing) 
Go to bottomPage: 1
TOPIC: how to determine the shield armor and hull
#48807
how to determine the shield armor and hull 2 Years, 4 Months ago Karma: 0
Hello i have a question i didn't undertsand the algorythm editor so iwould like to make a script for battle if it is possible but i don't have any idea of the solution to know exactly how the pourcent can be define in real time i know that the the pixel color is grey and after it is red so
have i to define the position of each carre of the shield armor and structure and verify if they are red to define 1 pourcent or have i to count hom many carre is red?

if someone has an exemple to script it will be kind because i am a noob i just start to begin
daywatch
Fresh Boarder
Posts: 10
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#48810
Re: how to determine the shield armor and hull 2 Years, 4 Months ago Karma: 33
It would be nice if EP's CheckHP module would write the HP percents to an INI and had result values that allowed you to path based on HP. Result2 isn't helpful "Returns 2 if success"... It would be better if it were:
0: Error or Neither Space Nor Station detected
1: Station Detected
2: HP Good (None of the others are true)
3: Armor Rule 2 Active (If 3 and 4 are true, returns 3 because it is more important)
4: Shield Rule 2 Active (If 3 and 4 are true, returns 3 because it is more important)

I think that would allow the default algorithms to work the same way as before..

But to specifically answer your question, even I haven't done HP detection. It wouldn't be difficult.
Take a (Alt-PrntScrn) screenshot of the window and paste it into paint
Find an anchor image (like the HUD +) and save the small anchor image
Save a single red pixel as an image (and use it with an ImageSearch with adequate variation)
Decide how may positions you want to check (4/5/10) and then determine the square width/height needed for each and what their individual X/Y values are, with respect to where the anchor image was found
Decide whether you want to do the searches sequentially or binary (check 50%, if red search left until white or all checked. If white, search right until red found or all checked)
Do that for Shield/Armor
Done

(My method would be a bit more complicated. Returning all red pixels and use math/triangulation to determine the left-most pixel on each half circle.)
However, EP seems to check HP after AHK runs, so I've never seen much need to do that. If HP is beyond the warp out value, EP jumps to the "WO:" tag, which should be "WO: StationSpaceCheck()" because EP sometimes jumps there while it is in the station. If in space, it then goes to my AHK recovery/warpHome script.
innominate
Gold Boarder
Posts: 632
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: Slav2
© Macro Laboratory 2020
All rights reserved!
Design by Ivan Kozyrin