# Astra and Aeris "Select number" captcha (both servers use the same dialog).
#
# A 176x241 dialog: "Please solve bot control." / "Select number" / a GREEN
# 8-digit number / four grey buttons, each showing another 8-digit number / a
# countdown. The answer is the button whose number equals the green one, so the
# solver type is click_number_match: read the green number and every button with
# the bitmap digit fonts in digits/, click the one button that matches.
#
# Origin = the dialog's outer top-left border pixel, at 632,418 on a 1456x1056
# client. The anchor is the dialog's top band (border + both title lines), inset
# 3px because the rounded corners let the game show through; hence anchor_dx/dy 3.
# Everything below is measured from the origin. Rebuild the digits/ and detect.tpl
# with tools/number_captcha_profile.py -- its geometry constants mirror these.
name astra_aeris
type click_number_match

search_x0 0
search_y0 0
search_x1 0
search_y1 0
detect_step 3
detect_threshold 0.80
anchor_dx 3
anchor_dy 3

# Green number: search box, font folder (digits/target), ink colour.
target_x 40
target_y 56
target_w 110
target_h 18
target_font target
target_color green
# Ignore each cell's last column: a following "4" pokes 1px into it.
target_trim 1

# First button's number box; each next button is option_dy lower.
option_x 30
option_y 90
option_w 116
option_h 14
option_dy 30
option_count 4
option_font option
option_color light
# Same here: the button "4" crossbar gains a 5th pixel only when a digit follows.
option_trim 1
# Centre of the first button (buttons are 120x20).
option_click_x 86
option_click_y 95

# Both fonts are fixed-pitch (green 8px, buttons 5px). Every digit renders
# pixel-exact, so a read is confident at 0-1 wrong pixels per digit; 6 vs 8 in the
# button font differ by only 3px, hence the margin of 2.
num_digits 8
digit_max_err 1
digit_min_margin 2

scale_min 0.8
scale_max 2.0
scale_steps 7

# Buttons are only 20px tall: keep jitter well inside them.
click_jitter 5
click_delay_min 2000
click_delay_max 5000
