Adree |
Отправлено: 06 Октября, 2013 - 12:53:24
|


Прохожий

Покинул форум
Сообщений всего: 19
Дата рег-ции: Окт. 2013
Репутация: 0

|
Kibor пишет: Adree пишет: Скажите пожалуйста как сделать чтобы функция sleep была с каким-то интервалом? Например от 1000 до 2500 мс sleep(rand(1000, 2500));
Спасибо за быстрый ответ! У меня еще один вопрос. Вот у меня есть скрипт:
CODE:int Image_1[88][16];
int Image_0[101][14];
int Image_2[103][16];
int Image_3[99][19];
int PosX_0[1], PosY_0[1];
int PosA_0[1], PosS_0[1];
int Pos1_0[1], Pos2_0[1];
int Pos3_0[1], Pos4_0[1];
int k;
int m;
int b;
int f;
loadimage (#Image_0[0][0], "C:\1\Image_0.bmp");
loadimage (#Image_1[0][0], "C:\1\Image_1.bmp");
loadimage (#Image_2[0][0], "C:\1\Image_2.bmp");
loadimage (#Image_3[0][0], "C:\1\Image_3.bmp");
int color, xe, ye;
getdisplay(color, xe, ye);
n:
k=findimage(1, #Image_0[0][0], 255, #PosX_0[0], #PosY_0[0], 0, 0, xe, ye, -1);
if (k==1)
{
mousedbl(LEFT,PosX_0[0], PosY_0[0]) ;
sleep(rand(1988,2312));
goto n ;
}
m=findimage(1, #Image_2[0][0], 255, #Pos1_0[0], #Pos2_0[0], 0, 0, xe, ye, -1);
if (m==1)
{
mousedbl(LEFT,Pos1_0[0], Pos2_0[0]) ;
sleep(rand(1985,2327));
goto n ;
}
f=findimage(1, #Image_1[0][0], 255, #PosA_0[0], #PosS_0[0], 0, 0, xe, ye, -1);
if (f==1)
{
mousedbl(LEFT,PosA_0[0], PosS_0[0]);
sleep(rand(2123,3012));
goto n ;
}
sleep(rand(2254,3012));
goto n;
}
b=findimage(1, #Image_3[0][0], 255, #Pos3_0[0], #Pos4_0[0], 0, 0, xe, ye, -1);
if (b==1)
{
mousedbl(LEFT,Pos3_0[0], Pos4_0[0]) ;
sleep(rand(1985,2327));
goto n ;
Как мне сделать чтобы условие "b" выполнялось только если не выполняются все остальные , ну или не выполнялось только условие "f"
Язык программирования не знаю поэтому слепил из шаблонов |
|
|
Kibor |
Отправлено: 06 Октября, 2013 - 13:16:07
|


Эксперт

Покинул форум
Сообщений всего: 8248
Дата рег-ции: Март 2013
Откуда: Одесса
Репутация: 357

|
Ошибка синтаксиса. Сравните этот код с вашим и увидите. Ошибка в скобках и лишние
sleep(rand(2254,3012));
goto n;
Цитата: int Image_1[88][16];
int Image_0[101][14];
int Image_2[103][16];
int Image_3[99][19];
int PosX_0[1], PosY_0[1];
int PosA_0[1], PosS_0[1];
int Pos1_0[1], Pos2_0[1];
int Pos3_0[1], Pos4_0[1];
int k;
int m;
int b;
int f;
loadimage (#Image_0[0][0], "C:\1\Image_0.bmp");
loadimage (#Image_1[0][0], "C:\1\Image_1.bmp");
loadimage (#Image_2[0][0], "C:\1\Image_2.bmp");
loadimage (#Image_3[0][0], "C:\1\Image_3.bmp");
int color, xe, ye;
getdisplay(color, xe, ye);
n:
k=findimage(1, #Image_0[0][0], 255, #PosX_0[0], #PosY_0[0], 0, 0, xe, ye, -1);
if (k==1)
{
mousedbl(LEFT,PosX_0[0], PosY_0[0]) ;
sleep(rand(1988,2312));
goto n ;
}
m=findimage(1, #Image_2[0][0], 255, #Pos1_0[0], #Pos2_0[0], 0, 0, xe, ye, -1);
if (m==1)
{
mousedbl(LEFT,Pos1_0[0], Pos2_0[0]) ;
sleep(rand(1985,2327));
goto n ;
}
f=findimage(1, #Image_1[0][0], 255, #PosA_0[0], #PosS_0[0], 0, 0, xe, ye, -1);
if (f==1)
{
mousedbl(LEFT,PosA_0[0], PosS_0[0]);
sleep(rand(2123,3012));
goto n ;
}
b=findimage(1, #Image_3[0][0], 255, #Pos3_0[0], #Pos4_0[0], 0, 0, xe, ye, -1);
if (b==1)
{
mousedbl(LEFT,Pos3_0[0], Pos4_0[0]) ;
sleep(rand(1985,2327));
goto n ;
}
|
|
|
|