GETSCREEN
WHILE ($xtime<$_time_t)
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "krasn.bmp", -1, 100)
$red=1
END_IF
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "sin.bmp", -1, 100)
$blue=1
END_IF
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "zhelt.bmp", -1, 100)
$yellow=1
END_IF
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "zelen.bmp", -1, 100)
$green=1
END_IF
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "roz.bmp", -1, 100)
$pink=1
END_IF
$xtime= $_time_t+600
print ($xtime)
print($_time_t)
end_cyc
//if ($start=1)
if ($mynomer=0)//???? ???? ????????, ? ???? ???? ????? ???????????, ?? ???????????
GETSCREEN
IF_PIXEL_IN(519,233, 927,257, 4277214)
$mynomer="cun" //??????? ?????? ????, ?????? ????? ????, ??? ?????? ???
else
IF_PIXEL_IN(519,233, 927,257, 16490549)
$mynomer="kras"
WAITMS(100)
END_IF
END_IF
END_IF
//$krasn[0]=12303604
//$krasn[1]=15132667
//$sin[0]=16571048
//$sin[1]=16708320
// //$zhelt[0]=8257535
//$zhelt[1]=13697023
//$zelen[0]=7338922
//$zelen[1]=13369056
//$roz[0]=14796284
//$roz[1]=16050942
//$bel[0]=14013909
$_ms1= $_ms
$cvet[0] = 12303604 //êðàñ
$cvet[1] = 15132667 // ç êð
$cvet[2] = 16571048 // ñèíèé
$cvet[3] = 16708320// çñèí
$cvet[4] = 8257535 //æ
$cvet[5] = 13697023 //çæ
$cvet[6] = 7338922 // çåë
$cvet[7] = 13369056 // ççåë
$cvet[8] = 14796284 // ðîç
$cvet[9] = 16050942// çðîç
$cvet[10] =14013909 // áåë
SUB(analiz,$pxl_x1,$pxl_y1,$pxl_x2,$pxl_y2)
GETSCREEN
FOR($e=0,$e<11)
if ( $red=1)
if (($e=0)|($e=1))
IF_PIXEL_IN($pxl_x1,$pxl_y1, $pxl_x2,$pxl_y2, $cvet[$e])
ARRPUSH($firma, $cvet[$e])
// print($cvet[$e])
$e=11
END_IF
END_IF
END_IF
if ( $blue=1)
if (($e=2)|($e=3))
IF_PIXEL_IN($pxl_x1,$pxl_y1, $pxl_x2,$pxl_y2, $cvet[$e])
ARRPUSH($firma, $cvet[$e])
// print($cvet[$e])
$e=11
END_IF
END_IF
END_IF
if ($yellow=1)
if (($e=4)|($e=5))
IF_PIXEL_IN($pxl_x1,$pxl_y1, $pxl_x2,$pxl_y2, $cvet[$e])
ARRPUSH($firma, $cvet[$e])
// print($cvet[$e])
$e=11
END_IF
END_IF
END_IF
if ($green=1)
if (($e=6)|($e=7))
IF_PIXEL_IN($pxl_x1,$pxl_y1, $pxl_x2,$pxl_y2, $cvet[$e])
ARRPUSH($firma, $cvet[$e])
//print($cvet[$e])
$e=11
END_IF
END_IF
END_IF
if ($pink=1 )
if (($e=8)|($e=9))
IF_PIXEL_IN($pxl_x1,$pxl_y1, $pxl_x2,$pxl_y2, $cvet[$e])
ARRPUSH($firma, $cvet[$e])
//print($cvet[$e])
// $e=11
END_IF
END_IF
END_IF
if ($e=10)
IF_PIXEL_IN($pxl_x1,$pxl_y1, $pxl_x2,$pxl_y2, $cvet[$e])
ARRPUSH($firma, $cvet[$e])
// print($cvet[$e])
$e=11
END_IF
END_IF
END_CYC
END_SUB
UNDEFINE($firma)
analiz(424,219,454,219) // êàôå 0 //ñìîòðèèì ÷òî êàêîãî öâåòà ó íàñ
analiz(512,219,542,219) // áàð
analiz(557,219,587,219) // ðåñòîðàí 2
//ýòî áëîêè ôèðì, ñîáðàâ áëîê ïîëíîñòüþ ìîæíî ïðîêà÷èâàòü êàæäûé äîì, äëÿ óâåëè÷åíèÿ ñâîåé ïðèáûëè
analiz(645,219,675,219) // ìîñêâà 3
analiz(949,359,951,391) //êèåâ
analiz(689,532,719,532) //ïàðèæ
analiz(416,359,417,391) //ëîíäîí 6
analiz(689,219,719,219) //ðåêë.àãåíñòâî 7
analiz(733,219,763,219) //ìîäåëüíîå àãåíñòâî
analiz(822,219,852,219) //òóðàãåíñòâî 9
analiz(866,219,896,219) //ðàäèîñòàíöèÿ 10
analiz(910,219,940,219) //òåëåöåíòð 11
analiz(416,227,417,257) //àëì.ïðèèñê 12
analiz(416,315,417,347) //çîë.ïðèèñê 13
analiz(416,404,417,434) //êàðèáû 14
analiz(416,448,417,478) //òàèòè
analiz(416,492,417,522) //ôèäæè 16
analiz(424,532,454,532) //ãàç.êîìïàíèÿ 17
analiz(468,532,498,532) //í.êîìïàíèÿ 18
analiz(512,532,542,532) //àâèàêîìïàíèÿ 19
analiz(601,532,631,532) //àâòîì.êîìïàíèÿ
analiz(645,532,675,532) //ñóäîñòðîèò.êîìïàíèÿ 21
analiz(777,532,807,532) //ôóòá.êëóá 22
analiz(822,532,852,532) //áàêñ.êîìàíäà
analiz(910,532,940,532) //õîêê.êîìàíäà 24
analiz(949,227,951,257) //òàáà÷íàÿ ôàáðèêà 25
analiz(949,271,951,301) //ïèïîâàðíÿ
analiz(949,315,952,347) //ñïèðòçàâîä 27
analiz(950,404,952,434) //íî÷íîé êëóá 28
analiz(950,492,952,522) //êàçèíî 29
print($_ms-$_ms1)
$_ms2= $_ms
if ($my=0)
if ($mynomer="cun") //åñëè öâåò íàøåé ôèøêè ñèíèé, îáîçíà÷àåì êàêèå öâåòà ìîè, êàêèå âðàæåñêèå. äîáàâëÿåì â ìîé ìàññèâ ñèíèé, âî âðàæåñêèé - êðàñíûå öâåòà
$pustoi=14013909
$moi[0]=16571048 //êóïëåííàÿ ìîÿ
$moi[1]=16708320 //çàëîæåííàÿ ìîÿ
$vrag[0]=12303604
$vrag[1]=15132667
end_if
if ($mynomer="kras")
$pustoi=14013909
$moi[0]=12303604
$moi[1]=15132667
$vrag[0]=16571048
$vrag[1]=16708320
end_if
$my=1
end_if
sub(pole, $firms) // ïîäïðîãðàììà, ïîëå, ïåðìåííàÿ ôèðìñ
SWITCH($firms) // â âûçîâå óêàçàòü îò 1 äî 10
CASE(1) //åñëè âõîäíîé ðàâåí 1
$u1=0 //îãäà àíàëèçèðóåì áëîê:êàôå, ðåñòîðàí, êîôåéíÿ
$u2=3
CASE(2) //åñëè âõîäíîé ðàâåí 2
$u1=7
$u2=10
CASE(3)
$u1=10
$u2=12
CASE(4)
$u1=12
$u2=14
CASE(5)
$u1=14
$u2=17
CASE(6)
$u1=17
$u2=19
CASE(7)
$u1=19
$u2=22
CASE(8)
$u1=22
$u2=25
CASE(9)
$u1=25
$u2=28
CASE(10)
$u1=28
$u2=30
DEFAULT
END_SWITCH
for ($o=$u1, $o<$u2)//êðóòèì íäåêñû ìàññèâà ôèðìà, ïî áëîêàì ìîíîïîëèé
$q=$firma[$o]
if ($pustoi=$q) // åñëè íàõîäèì ïóñòóþ ôèðìó,
$p=1 //ïåðåìåííàÿ åäèíè÷êà
arrpush($pp, $o) //äîáàâëÿåì â ìàññèâ èíäåêñ ìàññèâà ôèðìÀ, äëÿ èñïîëüçîðâàíèÿ â äàëüíåéøåì
end_if
if (($moi[0]=$q)|($moi[1]=$q)) ///òî æå ñàìîå
$m=1
arrpush($mm, $o)
end_if
if (($vrag[0]=$q)|($vrag[1]=$q))
$v=1
arrpush($vv, $o)
end_if
end_cyc
if ($p=1) //àíàëèç âàæíîñòè ôèðì
if ($m=1)
if ($v=1)
// print("íå íàäî áðàòü.ïîòðàòèøü âïóñòóþ äåíüãè")
//ýòî áëîê íåíóæíûõ!!!
//áëîê çàêëàäûâàíèÿ
for($k=0, $k<arrsize($pp))
arrpush($low, ($pp[$k]))
end_cyc
for($k=0, $k<arrsize($mm))
arrpush($sale, ($mm[$k]))
end_cyc
for($k=0, $k<arrsize($vv))
arrpush($arend, ($vv[$k]))
end_cyc
else
// print("áåðè, äëÿ ïîëíîé êîëëåêöèè")
//áëîê íóæíûõ!!!
for($k=0, $k<arrsize($pp))
arrpush($high, ($pp[$k]))
end_cyc
//end_cyc
end_if
else
if ($v=1)
// print("ìîèõ íåò, áåðè, ÷òîáû âðàã íå ðàçâèâàë ìîíîïîëèþ")
//áëîê íóæíûõ!!
for($k=0, $k<arrsize($pp))
arrpush($high, ($pp[$k]))
end_cyc
for($k=0, $k<arrsize($vv))
arrpush($arend, ($vv[$k]))
end_cyc
else
// print("âñå ïóñòî")
for($k=0, $k<arrsize($pp))
arrpush($high, ($pp[$k]))
end_cyc
//áëîê íóæíûõ
end_if
end_if
else
if ($m=1)
if ($v=1)
// print("ïîðîâíó ñ âðàãîì")
for($k=0, $k<arrsize($mm))
arrpush($sale, ($mm[$k]))
end_cyc
for($k=0, $k<arrsize($vv))
arrpush($arend, ($vv[$k]))
end_cyc
//áëîê çàêëàäûâàíèÿ
else
print("âñå ìîå")
//áëîê ïîñòðîéêè ôèðì
for($k=0, $k<arrsize($mm))
arrpush($proect, ($mm[$k]))
end_cyc
end_if
else
for($k=0, $k<arrsize($vv))
arrpush($arend, ($vv[$k]))
end_cyc // print("âñå ó ïðîòèâíèêà")
end_if
end_if
UNDEFINE($v)
UNDEFINE($m)
UNDEFINE($p)
UNDEFINE($vv)
UNDEFINE($mm)
UNDEFINE($pp)
//ñîçäàòü 4 ìàññèâà. âàæíûå äëÿ ïîêóïêè. íåíóæíûå ïîêóïêè. çàêëàäûâàíèå ôèðì, áëîê ïîñòðîéêè(4)
end_sub
UNDEFINE($proect)
UNDEFINE($arend)
UNDEFINE($low)
UNDEFINE($high)
UNDEFINE($sale)
//print("îáùåïèò")
Pole(1)
//print("ðåêëàìà")
Pole(2)
//print("ðàäèî")
Pole(3)
//print("ïðèèñê")
Pole(4)
//print("îñòðîâà")
Pole(5)
//print("íåôòü")
Pole(6)
//print("òðàíñïîðò")
Pole(7)
//print("ñïîðò")
Pole(8)
//print("çàâîä")
Pole(9)
//print("êëóáû")
Pole(10)
for($k=0, $k<arrsize($proect)) //
print($proect[$k],"ñòðîéê")
end_cyc
for($k=0, $k<arrsize($low))
print($low[$k],"íåâàæí")
end_cyc
for($k=0, $k<arrsize($high))
print($high[$k],"âàæí")
end_cyc
for($k=0, $k<arrsize($sale))
print($sale[$k],"çàêëàä")
end_cyc
print($_ms-$_ms2)
if ($massiv=0)
STRSEPARATE("418:461:506:550:594:639:683:727:771:816:859:903:947:1065", ":", $pos_coord_X1)
STRSEPARATE("264:309:354:397:441:486:529", ":", $pos_coord_y1)
STRSEPARATE("948:903:859:816:771:727:683:639:595:550:506:462:418:302", ":", $pos_coord_x2)
STRSEPARATE("486:442:397:353:309:264:221", ":", $pos_coord_y2)
$massiv=1
End_if
$_ms3=$_ms2
GETSCREEN
if ($mynomer="kras")
IF_PICTURE_IN (302,105, 1063,645, "krasn.bmp") //èùåì êðàñíûé
$avatar_X = $_return1 //îáçûâàåì âîçâðàò àâàòàðîì_õ
$avatar_Y = $_return2
print("----------")
END_IF
else
if ($mynomer="cun")
IF_PICTURE_IN (302,105, 1063,645, "sin.bmp") //èùåì êðàñíûé
$avatar_X = $_return1 //îáçûâàåì âîçâðàò àâàòàðîì_õ
$avatar_Y = $_return2
print("----------")
END_IF
END_IF
END_IF
IF($avatar_Y < 222) // âåðõíèé ðÿä
FOR($i=0, $i < ARRSIZE($pos_coord_X1)) // îò ïåðâîãî ýëåìåíòà ìàññèâà ïî ïîñëåäíèé
IF($avatar_X < $pos_coord_X1[$i]) //åñëè àâàòàð ìåíüøå ÷åì ïðîïèñàííàÿ êîîðäèíàòà
$field = $i //òî ôàéëä ðàâåí ïîçèöèè íà êîòîðîé ñòîþ. ïðèìåð, ÿ íà 7 êëåòêå, 0123456. ýòî 7 ýëåìåíò ìàññèâà, ôàéëä= 6
$i = 100 //ïðåðûâàåì
print($field)
END_IF
END_CYC
else
IF($avatar_Y > 529) // âåðõíèé ðÿä
FOR($i=0, $i < ARRSIZE($pos_coord_X2)) // îò ïåðâîãî ýëåìåíòà ìàññèâà ïî ïîñëåäíèé
IF($avatar_X > $pos_coord_X2[$i]) //åñëè àâàòàð , áîëüøå ÷åì ïðîïèñàííàÿ êîîðäèíàòà
$field = $i + 21 //òî ôàéëä ðàâåí ïîçèöèè íà êîòîðîé ñòîþ. ïðèìåð, ÿ íà 7 êëåòêå, 0123456. ýòî 7 ýëåìåíò ìàññèâà, ôàéëä= 6
$i = 100 //ïðåðûâàåì
print($field)
END_IF
END_CYC
END_IF
END_IF
IF($avatar_X > 948) //íèæíèé ðÿä
FOR($i=0, $i < ARRSIZE($pos_coord_y1))
IF($avatar_Y < $pos_coord_y1[$i])
$field = 14+$i
// òóò íóæíî ïåðåñ÷èòàòü èíäåêñ â íîìåð ïîëÿ íàïðèìåð:
// $field = 16 + 9 - $i // 9 ââåðõó+6 ñïðàâà + èíâåðò íèçà
$i = 100
print($field)
END_IF
END_CYC
else
IF($avatar_X < 417) //íèæíèé ðÿä
FOR($i=0, $i < ARRSIZE($pos_coord_y2))
IF($avatar_Y > $pos_coord_y2[$i])
$field = 35+$i
// òóò íóæíî ïåðåñ÷èòàòü èíäåêñ â íîìåð ïîëÿ íàïðèìåð:
// $field = 16 + 9 - $i // 9 ââåðõó+6 ñïðàâà + èíâåðò íèçà
$i = 100
print($field)
END_IF
END_CYC
END_IF
END_IF
print($_ms-$_ms3," ìóð")
if ($mynomer="cun")
$noxodme1= 3014841
$noxodme2= 1507421
$xodme1= 16215040
$xodme2= 8140288
else
if ($mynomer="kras")
$noxodme1= 16215040
$noxodme2= 8140288
$xodme1= 3014841
$xodme2= 1507421
END_IF
END_IF
//íèæå èíäèêàòîð.
GETSCREEN
IF_PIXEL_IN(524,660,835,686, $xodme1)// ìîé õîä
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "brosok.bmp", -1, 100)
if (arrsize($proect)<1)
if ($field!13)
LCLICK($_return1, $_return2)
MOVE(1365,290)
WAITMS(100)
END_IF
END_IF
END_IF
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "oplata.bmp", -1, 100)
if (($field=2)|($field=9)|($field=19)|($field=23)|($field=30)|($field=40))
LCLICK($_return1, $_return2)
MOVE(1365,290)
WAITMS(100)
else
for($k=0, $k<arrsize($arend))
if ($field=$arend[$k])
LCLICK($_return1, $_return2)
MOVE(1365,290)
$k=100
END_IF
end_cyc
END_IF
END_IF
IF_PICTURE_IN (0,0, $_xmax,$_ymax, "kupit.bmp", -1, 100)
for($k=0, $k<arrsize($high))
if ($field=$high[$k])
LCLICK($_return1, $_return2)
MOVE(1365,290)
$k=100
END_IF
end_cyc
END_IF
END_IF
//else
// IF_PIXEL_IN(524,660,835,686, $noxodme2)//íå ìîé õîä àêöèîí
// WAITMS(1000)
// else
// IF_PIXEL_IN(524,660,835,686, $xodme1)//ÿ õîæó
// $xozhu=1
// WAITMS(1000)
// else
// IF_PIXEL_IN(524,660,835,686, $xodme2)//ÿ õîæó
// $xozhu=1
// WAITMS(1000)
// END_IF
// END_IF
// END_IF
//END_IF
////äåéñòâèå ïðè ìîåì õîäå.
//if ($xozhu=1)
// GETSCREEN
// IF_PIXEL_IN(297,46,994,92, 234206)
// LOGWRITE ("ìîé õîä")
// WAITMS(1000)
// else
// IF_PIXEL_IN(297,46,994,92, 827129)
// LOGWRITE ("ìîé õîä")
// WAITMS(1000)
// else
// IF_PIXEL_IN(297,46,994,92, 350078)
// LOGWRITE ("ìîé õîä")
// WAITMS(1000)
// else
// IF_PIXEL_IN(297,46,994,92, 84591)
// LOGWRITE ("ìîé õîä")
// WAITMS(1000)
// END_IF
// END_IF
// END_IF
// END_IF
//END_IF
Вот что вышло. позже допилю, а пока скидываю может кому надо.