ну что тут могу сказать
раз ты прав, то кину скриптик, который с своей задачей справлялся
может и грубая работа, но в фоне прекрасно всю энергию спускало и ждало пока будет на поход, + там помощь жмякало...переключился на другой уровень, учусь писать без гото
блочные циклы и условия с масивами
[spoiler]
$hwnd = HGET(60,95)
hset($hwnd, 1)
print($hwnd)
wndsize(wndfind("VNC Viewer"), 252, 252)
wndpos(wndfind("VNC Viewer"), -4, -4)
t:
$t = 0
pix:
WAIT(1)
GETSCREEN
WAITMS(100)
COLORMODE(7)
WAITMS(rnd(100,200))
$p = pxl(55, 22)
$p2 = pxl(55, 23)
$p3 = pxl(56, 22)
$p4 = pxl(56, 23)
IF($p | $p2 | $p3 & $p4 = 8388479 | 16777087)
print($p,"-",$p2,"-",$p3,"-",$p4)
GOTO(o1)
ELSE
print("\","$p:55,22-",$p,":","$p2:55,23-",$p2,"$p3:55,23-",$p3,"$p4:55,23-",$p4)
WAIT(rnd(6,9))
GOTO(pom)
o1:
WAIT(rnd(1,2))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(53,27, 66,41, "sl.bmp",-1,10)
WAIT(rnd(0,1))
GOTO(o2)
ELSE
print("o1")
GOTO(poisk)
o2:
WAIT(rnd(1,2))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(53,39, 66,54, "sl.bmp",-1,10)
WAIT(rnd(2,3))
GOTO(o3)
ELSE
print("o2")
GOTO(poisk)
o3:
WAIT(rnd(1,2))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(58,50, 73,58, "o36+.bmp",-1,25)
print("найден третий отрÑд GOTO(pom)")
WAIT(rnd(2,3))
GOTO(pom)
ELSE
print("o3")
GOTO(poisk)
poisk:
WAIT(rnd(4,4))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(169,115, 188,134, "poisk6.bmp",-1,60)
$xpo = $_return1+rnd(0,7)
$ypo = $_return2+rnd(0,8)
print("\x-"$xpo, "\y-"$ypo, " poisk+++++++++")
WAITMS(rnd(100,200))
postmessage($hwnd, 0x0201, 0x0001, $xpo + ($ypo*65536));
WAITMS(rnd(1000,2000))
postmessage($hwnd, 0x0202, 0x0000, $xpo + ($ypo*65536));
WAITMS(rnd(800,1200))
GOTO(pm)
ELSE
print("\x-"$xpo, "\y-"$ypo, "no poisk-------")
inc($t,1)
while($t < 4)
WAIT(rnd(0,1))
GOTO(poisk)
ELSE
WAIT(rnd(0,1))
$t = 0
GOTO(t)
pm:
WAIT(rnd(4,4))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(97,92, 154,110, "poisk7-10.bmp",-1,65)
$xpm = $_return1+rnd(-20,9)
$ypm = $_return2+rnd(0,4)
print("\x-"$xpm, "\y-"$ypm, " poisk monstrov+++++++++")
postmessage($hwnd, 0x0201, 0x0001, $xpm + ($ypm*65536));
WAITMS(rnd(1000,2000))
postmessage($hwnd, 0x0202, 0x0000, $xpm + ($ypm*65536));
WAITMS(rnd(800,1200))
WAIT(rnd(1,2))
GOTO(atm)
ELSE
print("\x-"$xpm, "\y-"$ypm, "no poisk monstrov-------")
inc($t,1)
while($t < 4)
WAIT(rnd(0,1))
GOTO(pm)
ELSE
WAIT(rnd(0,1))
$t = 0
GOTO(t)
atm:
WAIT(rnd(4,4))
GETSCREEN
WAITMS(rnd(50,100))
COLORMODE(6)
WAITMS(rnd(50,100))
IF_PICTURE_IN(145,75, 173,141, "atakam.bmp",-1,60)
$xatm = $_return1+rnd(1,14)
$yatm = $_return2+rnd(1,4)
print("\x-"$xatm, "\y-"$yatm, " atakam+++++++++")
postmessage($hwnd, 0x0201, 0x0001, $xatm + ($yatm*65536));
WAITMS(rnd(1000,2000))
postmessage($hwnd, 0x0202, 0x0000, $xatm + ($yatm*65536));
WAITMS(rnd(900,1200))
GOTO(at)
ELSE
print("\x-"$xatm, "\y-"$yatm, "no atakam------")
inc($t,1)
while($t < 4)
WAIT(rnd(0,1))
GOTO(atm)
ELSE
WAIT(rnd(0,1))
$t = 0
GOTO(t)
at:
WAIT(rnd(3,3))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(95,121, 148,145, "ataka.bmp",-1,70)
$xat = $_return1+rnd(2,39)
$yat = $_return2+rnd(2,10)
print("\x-"$xat, "\y-"$yat, " ataka+++++++++")
postmessage($hwnd, 0x0201, 0x0001, $xat + ($yat*65536));
WAITMS(rnd(1000,2000))
postmessage($hwnd, 0x0202, 0x0000, $xat + ($yat*65536));
WAITMS(rnd(800,1200))
GOTO(vpohod)
ELSE
WAIT(rnd(4,4))
inc($t,1)
logwrite("повторов: ", $t)
$xap = rnd(115,126)
$yap = rnd(86,95)
print("\x-"$xap, "\y-"$yap, " ataka+rep++++")
postmessage($hwnd, 0x0201, 0x0001, $xap + ($yap*65536));
WAITMS(rnd(1000,2000))
postmessage($hwnd, 0x0202, 0x0000, $xap + ($yap*65536));
WAITMS(rnd(800,1200))
WAIT(rnd(3,3))
while($t < 3)
GOTO(at)
ELSE
GOTO(t)
vpohod:
print("\x-"$xvp, "\y-"$yvp, " vpohod++")
WAIT(rnd(4,5))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(128,159, 179,179, "vpohod.bmp",-1,40)
$xvp = $_return1+rnd(3,40)
$yvp = $_return2+rnd(3,10)
print("\x-"$xvp, "\y-"$yvp, " vpohod++")
postmessage($hwnd, 0x0201, 0x0001, $xvp + ($yvp*65536));
WAITMS(rnd(800,1200))
postmessage($hwnd, 0x0202, 0x0000, $xvp + ($yvp*65536));
WAITMS(rnd(800,1200))
print("vpohod!!!")
WAIT(rnd(4,6))
GOTO(t)
ELSE
GOTO(vpohod)
pom:
WAIT(rnd(1,2))
GETSCREEN
COLORMODE(6)
IF_PICTURE_IN(168,134, 188,151, "pr6.bmp",-1,50)
$xpom = $_return1+rnd(1,6)
$ypom = $_return2+rnd(1,5)
postmessage($hwnd, 0x0201, 0x0001, $xpom + ($ypom*65536));
WAITMS(rnd(100,200))
postmessage($hwnd, 0x0202, 0x0000, $xpom + ($ypom*65536));
WAITMS(rnd(100,200))
print("\x-"$xpom, "\y-"$ypom, " pomosh+++")
GOTO(pvsem)
ELSE
GOTO(t)
pvsem:
WAIT(rnd(2,3))
GETSCREEN
COLORMODE(6)
IF_PICTURE_IN(91,157, 149,177, "pvsem6.bmp",-1,70)
$xpv = $_return1+rnd(0,47)
$ypv = $_return2+rnd(0,8)
postmessage($hwnd, 0x0201, 0x0001, $xpv + ($ypv*65536));
WAITMS(rnd(100,200))
postmessage($hwnd, 0x0202, 0x0000, $xpv + ($ypv*65536));
WAITMS(rnd(50,60))
print("\x-"$xpv, "\y-"$ypv, " pomosh vsem+++++")
GOTO(x)
ELSE
print("\x-"$xpv, "\y-"$ypv, " pomosh vsem----")
GOTO(x)
x:
WAIT(rnd(1,2))
GETSCREEN
COLORMODE(6)
IF_PICTURE_IN(170,0, 188,18, "x6.bmp",-1,40)
$xx = $_return1+rnd(1,10)
$yx = $_return2+rnd(0,8)
postmessage($hwnd, 0x0201, 0x0001, $xx + ($yx*65536));
WAITMS(rnd(100,200))
postmessage($hwnd, 0x0202, 0x0000, $xx + ($yx*65536));
WAITMS(rnd(50,60))
print("\x-"$xx, "\y-"$yx, " krestik+++++")
WAIT(rnd(1,2))
GOTO(t)
ELSE
print("\x-"$xx, "\y-"$yx, " krestik---")
WAIT(rnd(0,1))
GOTO(t)
[/spoiler]
а вот пример как учусь писать блочными циклами 0=) может и много я задаю массивов, и понимаю что достаточно 1, что бы запустить следующий цикл.. но всё впереди
[spoiler]
$o1 = 0
$o11 = 0
while(($o1 < 1) & ($o11 < 3))
WAIT(rnd(1,2))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(53,27, 66,41, "sl.bmp",-1,10)
WAIT(rnd(0,1))
print("o1+", $o1)
$o2 = 0
$o1 = 1
$poisk = 0
ELSE
$o1 = 1
$o2 = 1
$o3 = 1
$poisk = 1
print("o1-")
END_IF
while($o2 < 1)
WAIT(rnd(1,2))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(53,39, 66,54, "sl.bmp",-1,25)
print("o2+", $o2)
WAIT(rnd(2,3))
$o3 = 0
$o2 = 1
$poisk = 0
ELSE
print("o2-")
$o1 = 1
$o3 = 1
$o2 = 1
$poisk = 1
END_IF
while($o3 < 1)
WAIT(rnd(1,2))
GETSCREEN
WAITMS(rnd(50,60))
COLORMODE(6)
WAITMS(rnd(50,60))
IF_PICTURE_IN(56,49, 72,58, "o36+.bmp",-1,40)
WAIT(rnd(2,3))
print("o3+", $o3)
$o1 = 0
$o3 = 1
$poisk = 0
inc($o11,1)
print("inc($o11,1)"$o11)
ELSE
print("o3-")
$o1 = 1
$o2 = 1
$o3 = 1
$poisk = 1
END_IF
END_CYC
END_CYC
END_CYC
[/spoiler]
вот только не понимаю смысл между while и фор