1
Общие вопросы / Re: Логика работы с программой
« on: March 08, 2016, 12:12:30 AM »Только не 'вот', а вот:
http://crapware.aidf.org/forum/index.php?topic=88.msg1571#msg1571
Там версия 1.5 сблэкджекомколормодом и процентами
Во общем решил не считывать циферки а проверить появление окна о том что не хватает ресурсов.
Получилось вот что:
Code: (clickermann) [Select]
THREAD(take_res, 0)
lDown(1573,309)
waitms(200)
move(1573,311)
waitms(6)
move(1572,313)
waitms(6)
move(1572,315)
waitms(6)
move(1571,320)
waitms(6)
move(1571,325)
waitms(8)
move(1570,328)
waitms(8)
move(1570,332)
waitms(8)
move(1569,336)
waitms(8)
move(1569,339)
waitms(8)
move(1568,342)
waitms(8)
move(1568,345)
waitms(6)
move(1567,348)
waitms(8)
move(1567,350)
waitms(8)
move(1567,353)
waitms(8)
move(1566,357)
waitms(8)
move(1566,359)
waitms(8)
move(1565,362)
waitms(8)
move(1565,364)
waitms(6)
move(1565,366)
waitms(8)
move(1564,368)
waitms(8)
move(1564,370)
waitms(8)
move(1564,372)
waitms(8)
move(1564,374)
waitms(8)
move(1563,378)
waitms(8)
move(1563,380)
waitms(8)
move(1563,383)
waitms(6)
move(1562,386)
waitms(8)
move(1562,389)
waitms(10)
move(1562,392)
waitms(6)
move(1562,394)
waitms(8)
move(1562,397)
waitms(8)
move(1562,400)
waitms(8)
move(1561,402)
waitms(8)
move(1561,406)
waitms(6)
move(1561,409)
waitms(8)
move(1561,412)
waitms(8)
move(1561,415)
waitms(8)
move(1561,417)
waitms(8)
move(1561,420)
waitms(8)
move(1561,423)
waitms(8)
move(1561,426)
waitms(8)
move(1560,429)
waitms(6)
move(1560,432)
waitms(8)
move(1560,435)
waitms(8)
move(1560,438)
waitms(8)
move(1560,440)
waitms(8)
move(1560,443)
waitms(8)
move(1560,447)
waitms(6)
move(1560,450)
waitms(8)
move(1560,452)
waitms(8)
move(1560,455)
waitms(8)
move(1559,458)
waitms(8)
move(1559,462)
waitms(8)
move(1559,465)
waitms(12)
move(1559,468)
waitms(10)
move(1559,474)
waitms(8)
move(1559,477)
waitms(8)
move(1559,481)
waitms(8)
move(1559,484)
waitms(8)
move(1559,488)
waitms(8)
move(1559,491)
waitms(8)
move(1559,496)
waitms(6)
move(1559,500)
waitms(8)
move(1558,503)
waitms(8)
move(1558,506)
waitms(8)
move(1558,509)
waitms(8)
move(1558,512)
waitms(8)
move(1558,515)
waitms(8)
move(1558,518)
waitms(6)
move(1558,521)
waitms(8)
move(1557,525)
waitms(10)
move(1557,527)
waitms(6)
move(1557,530)
waitms(8)
move(1557,533)
waitms(8)
move(1557,535)
waitms(8)
move(1556,537)
waitms(8)
move(1556,540)
waitms(6)
move(1556,543)
waitms(8)
move(1556,545)
waitms(8)
move(1556,548)
waitms(8)
move(1556,552)
waitms(8)
move(1556,555)
waitms(8)
move(1556,557)
waitms(8)
move(1555,560)
waitms(6)
move(1555,562)
waitms(8)
move(1555,565)
waitms(8)
move(1555,567)
waitms(8)
move(1555,570)
waitms(8)
move(1555,573)
waitms(8)
move(1555,577)
waitms(8)
move(1555,580)
waitms(6)
move(1554,582)
waitms(8)
move(1554,585)
waitms(10)
move(1554,587)
waitms(6)
move(1554,590)
waitms(8)
move(1554,593)
waitms(8)
move(1554,595)
waitms(8)
move(1554,598)
waitms(6)
move(1554,600)
waitms(8)
move(1554,604)
waitms(8)
move(1554,606)
waitms(8)
move(1554,609)
waitms(8)
move(1554,611)
waitms(8)
move(1554,614)
waitms(8)
move(1554,616)
waitms(8)
move(1554,618)
waitms(10)
move(1554,621)
waitms(12)
move(1554,625)
waitms(8)
move(1554,628)
waitms(8)
move(1554,630)
waitms(8)
move(1554,632)
waitms(8)
move(1554,634)
waitms(6)
move(1554,636)
waitms(8)
move(1554,639)
waitms(8)
move(1554,641)
waitms(8)
move(1554,644)
waitms(8)
move(1554,646)
waitms(8)
move(1554,649)
waitms(8)
move(1554,651)
waitms(8)
move(1554,653)
waitms(6)
move(1554,655)
waitms(8)
move(1554,656)
waitms(8)
move(1554,658)
waitms(10)
move(1554,659)
waitms(6)
move(1554,660)
waitms(8)
move(1554,662)
waitms(8)
move(1554,663)
waitms(8)
move(1554,664)
waitms(6)
move(1554,666)
waitms(8)
move(1554,667)
waitms(8)
move(1554,668)
waitms(8)
move(1554,669)
waitms(8)
move(1554,671)
waitms(8)
move(1555,673)
waitms(8)
move(1555,674)
waitms(6)
move(1555,676)
waitms(8)
move(1555,678)
waitms(10)
move(1555,680)
waitms(6)
move(1555,682)
waitms(8)
move(1556,684)
waitms(8)
move(1556,686)
waitms(8)
move(1556,688)
waitms(6)
move(1556,690)
waitms(8)
move(1557,692)
waitms(8)
move(1557,695)
waitms(10)
move(1557,697)
waitms(6)
move(1558,701)
waitms(8)
move(1558,703)
waitms(8)
move(1558,705)
waitms(7)
move(1559,708)
waitms(7)
move(1559,710)
waitms(8)
move(1559,712)
waitms(8)
move(1560,715)
waitms(8)
move(1560,717)
waitms(8)
move(1560,719)
waitms(8)
move(1561,721)
waitms(6)
move(1561,722)
waitms(8)
move(1561,724)
waitms(12)
move(1561,725)
waitms(4)
move(1561,726)
waitms(8)
move(1562,727)
waitms(8)
move(1562,729)
waitms(8)
move(1562,730)
waitms(8)
move(1562,732)
waitms(6)
move(1562,734)
waitms(10)
move(1562,737)
waitms(6)
move(1562,738)
waitms(8)
move(1562,740)
waitms(8)
move(1562,742)
waitms(8)
move(1562,744)
waitms(8)
move(1562,746)
waitms(6)
move(1562,748)
waitms(8)
move(1563,750)
waitms(8)
move(1563,752)
waitms(8)
move(1563,755)
waitms(8)
move(1563,759)
waitms(8)
move(1563,761)
waitms(8)
move(1563,763)
waitms(6)
move(1563,765)
waitms(8)
move(1563,766)
waitms(10)
move(1563,768)
waitms(6)
move(1563,769)
waitms(8)
move(1563,770)
waitms(10)
move(1564,771)
waitms(6)
move(1564,773)
waitms(8)
move(1564,775)
waitms(6)
move(1564,776)
waitms(16)
move(1564,777)
waitms(8)
move(1564,778)
waitms(8)
move(1564,779)
waitms(8)
move(1564,780)
waitms(8)
move(1565,780)
waitms(6)
move(1565,781)
waitms(8)
move(1565,782)
waitms(8)
move(1565,783)
waitms(8)
move(1565,785)
waitms(8)
move(1565,786)
waitms(10)
move(1565,787)
waitms(6)
move(1565,788)
waitms(8)
move(1565,789)
waitms(6)
move(1565,790)
waitms(8)
move(1565,791)
waitms(8)
move(1565,792)
waitms(8)
move(1566,793)
waitms(8)
move(1566,794)
waitms(16)
move(1566,795)
waitms(200)
move(1566,796)
waitms(8)
move(1567,797)
waitms(8)
move(1567,798)
waitms(8)
move(1567,799)
waitms(8)
move(1567,800)
waitms(6)
move(1567,801)
waitms(8)
move(1568,802)
waitms(8)
move(1568,803)
waitms(8)
move(1568,804)
waitms(8)
lUp(1568,804)
WAIT(15)
LOGWRITE ("Задание выполнено")
END_THREAD
SUB(get_items,$get, $get1, $get2, $get3, $get4, $get5, $get6, $get7)
GETSCREEN( $get1, $get2, $get3, $get4)
LOGWRITE ("Картинка получена")
COLORMODE(8)
LOGWRITE ("Картинка обработана")
WAITMS(50)
SCANPICTURE($get0, $get1, $get2, $get3, $get4, $get5, $get6, $get7)
LOGWRITE ("Сканирование области выполнено")
WHILE (arrsize($get0) > 0)
$y = arrpop($get0)
$x = arrpop($get0)
If ($get5 = take.bmp)
LCLICK( $x, $y)
WAIT(3)
LCLICK(598,1030)
WAIT(3)
PRINT ("Найдено завершённых предметов :" , $x , ":" , $y)
ELSE
LCLICK(56,710)
WAIT(2)
LCLICK(1513,988)
WAIT(2)
LCLICK(572,705)
WAIT(2)
LCLICK(617,773)
WAIT(2)
LCLICK(1152,399)
WAIT(2)
LCLICK(784,703)
WAIT(2)
LCLICK(624,762)
WAIT(2)
LCLICK(624,762)
WAIT(2)
LCLICK(1153,400)
WAIT(2)
LCLICK(1549,255)
WAIT(2)
LCLICK(624,762)
WAIT(5)
stop:
LCLICK( $x, $y)
WAIT(2)
LCLICK(1513,907)
WAIT(2)
LCLICK(129,599)
WAIT(2)
GETSCREEN( 833, 262, 894, 321)
COLORMODE(8)
IF_PICTURE_IN( 833, 262, 894, 321, "error.bmp", 5026082, 99) // проверка на ресурсы
LOGWRITE ("Ресурсов недостаточно..")
WAIT(2)
LCLICK(1424,295)
WAIT(2)
LCLICK(1539,163)
WAIT(2)
SETTHREAD (take_res, 1)
WAIT(30)
SETTHREAD (take_res, 0)
GOTO(stop)
ELSE
END_IF
PRINT ("Найдено свободных слотов для крафта :" , $x , ":" , $y)
END_IF
END_CYC
END_SUB
LOGWRITE ("Подпрограмма Запускается")
SETTHREAD (take_res, 0)
get_items( $var, 168, 867, 1243, 1015, "take.bmp", 5026082, 95)
WAITMS(50)
get_items( $var1, 168, 867, 1243, 1022, "create.bmp", 5026082, 94)
LOGWRITE ("Подпрограмма Завершена")
SETTHREAD (take_res, 1)
WAIT(10)
Помогите оптимизировать