Здравствуйте!
Изучаю AutoIT недавно, ставлю задачи и пытаюсь их решать, в связи с чем решил написать робота для простой игрушки "взрыватель[/anc]]http://7ba.ru/ex/download/375568/vzryvatel.zip".
Попробовал вот такой способ:
но при первом запуске понял, что он очень медленный, и при смене строки уже тыкает не туда куда надо...потому не стал даже продолжать, решил найти другой способ, но в результате даже не смог определить куда двигаться. Догадываюсь, что нужно делать скриншот экрана->анализировать сам скрин в буфере(памяти)-> и собственно клики, без участия PixelGetColor и тем более If..Then?!
Подскажите пожалуйста в каком направлении думать, и желательно ссылки на подобные темы, хоть как-то затрагивающие решение!
Изучаю AutoIT недавно, ставлю задачи и пытаюсь их решать, в связи с чем решил написать робота для простой игрушки "взрыватель[/anc]]http://7ba.ru/ex/download/375568/vzryvatel.zip".
Попробовал вот такой способ:
Код:
Global $Paused
HotKeySet("{F1}", "TPause")
HotKeySet("{ESC}", "vyx")
Opt("MouseCoordMode", 2)
Opt("PixelCoordMode", 2)
WinActivate("Взрыватель")
WinWaitActive("Взрыватель")
While 1
$1 = PixelGetColor ( 599, 449)
$2 = PixelGetColor ( 559, 449)
$3 = PixelGetColor ( 519, 449)
$4 = PixelGetColor ( 479, 449)
$5 = PixelGetColor ( 439, 449)
$6 = PixelGetColor ( 399, 449)
$7 = PixelGetColor ( 359, 449)
$8 = PixelGetColor ( 319, 449)
$9 = PixelGetColor ( 279, 449)
$10 = PixelGetColor ( 239, 449)
$11 = PixelGetColor ( 199, 449)
$12 = PixelGetColor ( 159, 449)
$13 = PixelGetColor ( 599, 409)
$14 = PixelGetColor ( 559, 409)
$15 = PixelGetColor ( 519, 409)
$16 = PixelGetColor ( 479, 409)
$17 = PixelGetColor ( 439, 409)
$18 = PixelGetColor ( 399, 409)
$19 = PixelGetColor ( 359, 409)
$20 = PixelGetColor ( 319, 409)
$21 = PixelGetColor ( 279, 409)
$22 = PixelGetColor ( 239, 409)
$23 = PixelGetColor ( 199, 409)
$24 = PixelGetColor ( 159, 409)
$25 = PixelGetColor ( 599, 369)
$26 = PixelGetColor ( 559, 369)
$27 = PixelGetColor ( 519, 369)
$28 = PixelGetColor ( 479, 369)
$29 = PixelGetColor ( 439, 369)
$30 = PixelGetColor ( 399, 369)
$31 = PixelGetColor ( 359, 369)
$32 = PixelGetColor ( 319, 369)
$33 = PixelGetColor ( 279, 369)
$34 = PixelGetColor ( 239, 369)
$35 = PixelGetColor ( 199, 369)
$36 = PixelGetColor ( 159, 369)
#cs
$37 = PixelGetColor ( 599, 329)
$38 = PixelGetColor ( 559, 329)
$39 = PixelGetColor ( 519, 329)
$40 = PixelGetColor ( 479, 329)
$41 = PixelGetColor ( 439, 329)
$42 = PixelGetColor ( 399, 329)
$43 = PixelGetColor ( 359, 329)
$44 = PixelGetColor ( 319, 329)
$45 = PixelGetColor ( 279, 329)
$46 = PixelGetColor ( 239, 329)
$47 = PixelGetColor ( 199, 329)
$48 = PixelGetColor ( 159, 329)
$49 = PixelGetColor ( 599, 289)
$50 = PixelGetColor ( 559, 289)
$51 = PixelGetColor ( 519, 289)
$52 = PixelGetColor ( 479, 289)
$53 = PixelGetColor ( 439, 289)
$54 = PixelGetColor ( 399, 289)
$55 = PixelGetColor ( 359, 289)
$56 = PixelGetColor ( 319, 289)
$57 = PixelGetColor ( 279, 289)
$58 = PixelGetColor ( 239, 289)
$59 = PixelGetColor ( 199, 289)
$60 = PixelGetColor ( 159, 289)
$61 = PixelGetColor ( 599, 249)
$62 = PixelGetColor ( 559, 249)
$63 = PixelGetColor ( 519, 249)
$64 = PixelGetColor ( 479, 249)
$65 = PixelGetColor ( 439, 249)
$66 = PixelGetColor ( 399, 249)
$67 = PixelGetColor ( 359, 249)
$68 = PixelGetColor ( 319, 249)
$69 = PixelGetColor ( 279, 249)
$70 = PixelGetColor ( 239, 249)
$71 = PixelGetColor ( 199, 249)
$72 = PixelGetColor ( 159, 249)
#ce
if $1 = $2 And $2 = $3 then MouseClick("primary", 599, 449, 1, 0)
if $1 = $13 and $13 = $25 Then MouseClick("primary", 599, 449, 1, 0)
if $2 = $3 and $3 = $4 Then MouseClick("primary", 559, 449, 1, 0)
if $3 = $4 and $4= $5 Then MouseClick("primary", 519, 449, 1, 0)
if $4 = $5 and $5= $6 Then MouseClick("primary", 479, 449, 1, 0)
if $5 = $6 and $6= $7 Then MouseClick("primary", 439, 449, 1, 0)
if $6 = $7 and $7 = $8 Then MouseClick("primary", 399, 449, 1, 0)
if $7 = $8 and $8 = $9 Then MouseClick("primary", 359, 449, 1, 0)
if $8 = $9 and $9 = $10 Then MouseClick("primary", 319, 449, 1, 0)
if $9 = $10 and $10 = $11 Then MouseClick("primary", 279, 449, 1, 0)
If $10 = $11 and $11 = $12 Then MouseClick("primary", 239, 449, 1, 0)
if $12 = $24 and $24 = $36 Then MouseClick("primary", 159, 449, 1, 0)
if $13 = $1 and $1 = $2 Then MouseClick("primary", 599, 409, 1, 0)
if $13 = $14 and $14 = $26 Then MouseClick("primary", 599, 409, 1, 0)
if $13 = $25 and $25 = $26 Then MouseClick("primary", 599, 409, 1, 0)
if $13 = $14 and $14 = $2 Then MouseClick("primary", 599, 409, 1, 0)
if $14 = $13 and $13 = $15 Then MouseClick("primary", 559, 409, 1, 0)
if $14 = $13 and $13 = $2 Then MouseClick("primary", 559, 409, 1, 0)
if $14 = $15 and $15 = $2 Then MouseClick("primary", 559, 409, 1, 0)
If $14 = $2 and $2 = $26 Then MouseClick("primary", 559, 409, 1, 0)
if $14 = $2 and $2 = $1 Then MouseClick("primary", 559, 409, 1, 0)
if $14 = $13 and $13 = $1 Then MouseClick("primary", 559, 409, 1, 0)
if $14 = $2 and $2 = $3 Then MouseClick("primary", 559, 409, 1, 0)
if $14 = $15 and $15 = $3 Then MouseClick("primary", 559, 409, 1, 0)
if $14 = $15 and $15 = $27 Then MouseClick("primary", 559, 409, 1, 0)
if $14 = $13 and $13 = $25 Then MouseClick("primary", 559, 409, 1, 0)
if $15 = $14 and $14 = $15 Then MouseClick("primary", 519, 409, 1, 0)
if $15 = $3 and $3 = $27 Then MouseClick("primary", 519, 409, 1, 0)
if $15 = $3 and $3 = $4 Then MouseClick("primary", 519, 409, 1, 0)
if $15 = $3 and $3 = $2 Then MouseClick("primary", 519, 409, 1, 0)
if $15 = $16 and $16 = $4 Then MouseClick("primary", 519, 409, 1, 0)
if $15 = $16 and $16 = $28 Then MouseClick("primary", 519, 409, 1, 0)
if $15 = $14 and $14 = $2 Then MouseClick("primary", 519, 409, 1, 0)
if $15 = $14 and $14 = $26 Then MouseClick("primary", 519, 409, 1, 0)
if $15 = $27 and $27 = $26 Then MouseClick("primary", 519, 409, 1, 0)
if $15 = $27 and $27 = $28 Then MouseClick("primary", 519, 409, 1, 0)
if $16 = $15 and $15 = $17 Then MouseClick("primary", 479, 409, 1, 0)
if $16 = $4 and $4 = $28 Then MouseClick("primary", 479, 409, 1, 0)
if $16 = $15 and $15 = $3 Then MouseClick("primary", 479, 409, 1, 0)
if $16 = $4 and $4 = $3 Then MouseClick("primary", 479, 409, 1, 0)
if $16 = $17 and $17 = $5 Then MouseClick("primary", 479, 409, 1, 0)
if $16 = $17 and $17 = $29 Then MouseClick("primary", 479, 409, 1, 0)
if $16 = $15 and $15 = $27 Then MouseClick("primary", 479, 409, 1, 0)
if $16 = $4 and $4 = $5 Then MouseClick("primary", 479, 409, 1, 0)
if $16 = $28 and $28 = $27 Then MouseClick("primary", 479, 409, 1, 0)
if $16 = $28 and $28 = $29 Then MouseClick("primary", 479, 409, 1, 0)
if $17 = $16 and $16 = $18 Then MouseClick("primary", 439, 409, 1, 0)
if $17 = $5 and $5 = $29 Then MouseClick("primary", 439, 409, 1, 0)
if $17 = $18 and $18 = $6 Then MouseClick("primary", 439, 409, 1, 0)
if $18 = $6 and $6 = $5 Then MouseClick("primary", 399, 409, 1, 0)
if $18 = $6 and $6 = $7 Then MouseClick("primary", 399, 409, 1, 0)
if $18 = $17 and $17 = $5 Then MouseClick("primary", 399, 409, 1, 0)
if $18 = $17 and $17 = $29 Then MouseClick("primary", 399, 409, 1, 0)
if $18 = $19 and $19 = $7 Then MouseClick("primary", 399, 409, 1, 0)
if $18 = $19 and $19 = $31 Then MouseClick("primary", 399, 409, 1, 0)
if $18 = $30 and $30 = $31 Then MouseClick("primary", 399, 409, 1, 0)
if $18 = $30 and $30 = $29 Then MouseClick("primary", 399, 409, 1, 0)
if $18 = $17 and $17 = $19 Then MouseClick("primary", 399, 409, 1, 0)
if $18 = $6 and $6 = $30 Then MouseClick("primary", 399, 409, 1, 0)
if $19 = $18 and $18 = $20 Then MouseClick("primary", 359, 409, 1, 0)
if $19 = $7 and $7 = $31 Then MouseClick("primary", 359, 409, 1, 0)
if $24 = $23 and $23 = $12 Then MouseClick("primary", 159, 409, 1, 0)
if $24 = $36 and $36 = $23 Then MouseClick("primary", 159, 409, 1, 0)
if $23 = $11 and $11 = $12 Then MouseClick("primary", 199, 409, 1, 0)
if $23 = $11 and $11 = $10 Then MouseClick("primary", 199, 409, 1, 0)
if $23 = $35 and $35 = $36 Then MouseClick("primary", 199, 409, 1, 0)
if $23 = $35 and $35 = $34 Then MouseClick("primary", 199, 409, 1, 0)
if $23 = $24 and $24 = $12 Then MouseClick("primary", 199, 409, 1, 0)
if $23 = $24 and $24 = $36 Then MouseClick("primary", 199, 409, 1, 0)
if $23 = $22 and $22 = $10 Then MouseClick("primary", 199, 409, 1, 0)
if $23 = $22 and $22 = $34 Then MouseClick("primary", 199, 409, 1, 0)
if $23 = $11 and $11 = $35 Then MouseClick("primary", 199, 409, 1, 0)
if $23 = $24 and $24 = $22 Then MouseClick("primary", 199, 409, 1, 0)
if $22 = $23 and $23 = $21 Then MouseClick("primary", 239, 409)
if $22 = $10 and $10 = $34 Then MouseClick("primary", 239, 409)
if $21 = $9 and $9 = $8 Then MouseClick("primary", 279, 409, 1, 0)
if $21 = $9 and $9 = $10 Then MouseClick("primary", 279, 409, 1, 0)
if $21 = $33 and $33 = $34 Then MouseClick("primary", 279, 409, 1, 0)
if $21 = $33 and $33 = $32 Then MouseClick("primary", 279, 409, 1, 0)
if $21 = $22 and $22 = $10 Then MouseClick("primary", 279, 409, 1, 0)
if $21 = $22 and $22 = $34 Then MouseClick("primary", 279, 409, 1, 0)
if $21 = $20 and $20 = $8 Then MouseClick("primary", 279, 409, 1, 0)
if $21 = $20 and $20 = $32 Then MouseClick("primary", 279, 409, 1, 0)
if $21 = $33 and $33 = $9 Then MouseClick("primary", 279, 409, 1, 0)
if $21 = $22 and $22 = $20 Then MouseClick("primary", 279, 409, 1, 0)
if $20 = $19 and $19 = $21 Then MouseClick("primary", 319, 409, 1, 0)
if $20 = $8 and $8 = $7 Then MouseClick("primary", 319, 409, 1, 0)
if $20 = $8 and $8 = $9 Then MouseClick("primary", 319, 409, 1, 0)
if $20 = $19 and $19 = $7 Then MouseClick("primary", 319, 409, 1, 0)
if $20 = $19 and $19 = $31 Then MouseClick("primary", 319, 409, 1, 0)
if $20 = $32 and $32 = $33 Then MouseClick("primary", 319, 409, 1, 0)
if $20 = $32 and $32 = $31 Then MouseClick("primary", 319, 409, 1, 0)
if $20 = $21 and $21 = $9 Then MouseClick("primary", 319, 409, 1, 0)
if $20 = $21 and $21 = $33 Then MouseClick("primary", 319, 409, 1, 0)
if $20 = $8 and $8 = $32 Then MouseClick("primary", 319, 409, 1, 0)
WEnd
ToolTip ("конец", 0,0)
Sleep (3000)
Func TPause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc
Func vyx()
ToolTip ( "Good Buy", 0,0)
Sleep (3000)
Exit
EndFunc
Подскажите пожалуйста в каком направлении думать, и желательно ссылки на подобные темы, хоть как-то затрагивающие решение!