Kibor пишет:
..
CODE:
// news
int px[1], py[1];
int n = 0;
int error_time = 0, fatal_error = 0;
//глобальні змінні
string login_sent[100];
//
win w = window (-1, "WebViewHost", -1);
activate(w);
//Виклик
load_image();
logwrite("KrafterMT by Kosminskij. MADE IN UA");
sleep(3000);
logwrite("Подготовка к работе...");
//
loop()
{
if(findimage(1, #i_check_load_page_proxy[0][0], 0, #px[0], #py[0], 0, 0, 1366, 768, w)==1)
{
sleep(1000);
logwrite("Выполняеться переход на страницу авторизации.");
sleep(1000);
sendmouse(LEFT, px[0] + 200, py[0] + 90, w);
sendlanguage("00000409", w);
sendkey("m.vten.ru/login",0, w); sleep(500); sendkey(RETURN, w); sleep(500); //filling and enter
}
if(findimage(1, #i_enter[0][0], 0, #px[0], #py[0], 0, 0, 1366, 768, w)==1)
{
sleep(1000);
logwrite("Авторизация...");
sleep(1000);
login();
}
sleep(1000);
}
//
function check_error(int error_time_out)
{
error_time ++;
if(error_time >= error_time_out)
{
sendkey(F5, 0, w);
error_time = 0;
}
sleep(1000);
}
function logwrite(string log)
{
if(fopen("C:\krafterMT\logfile.txt", "w")!=0)
{
fwrite(log);
fclose();
}
}
function login()
{
if(fopen ("D:\test.txt", "r")!=0)
{
while(freadline(login_sent[n])!=0)
{
if(findimage(1, #i_name_pers[0][0], 0, #px[0], #py[0], 0, 0, 1366, 768, w)==1)
{
sendmouse(LEFT, px[0] + 25, py[0] + 25, w);
delete_input();
sleep(1000);
sendkey(login_sent[n], 0, w);
sleep(1000);
sendkey(TAB, w);
sleep(1000);
sendkey("8246291", 0, w);
sleep(1000);
//sendkey(RETURN, w);
logwrite("Производиться вход.");
sleep(1000);
}
n++;
}
fclose();
}
}
function delete_input()
{
keydown(17); keydown(65); sleep(500);
keyup(17); keyup(65); sleep(500); key(BACK);
}
int i_check_load_page_proxy[200][200], i_enter[100][100], i_name_pers[150][100], i_check_load_game[50][50], i_send_url_quest[40][40];
function load_image()
{
loadimage (#i_check_load_page_proxy[0][0], "D:\afm\texture\check_load_page_proxy.bmp");
loadimage (#i_enter[0][0], "D:\afm\texture\enter.bmp");
loadimage (#i_name_pers[0][0], "D:\afm\texture\name_pers.bmp");
loadimage (#i_check_load_game[0][0], "D:\afm\texture\check_load_game.bmp");
loadimage (#i_send_url_quest[0][0], "D:\afm\texture\send_url_quest.bmp");
}
int px[1], py[1];
int n = 0;
int error_time = 0, fatal_error = 0;
//глобальні змінні
string login_sent[100];
//
win w = window (-1, "WebViewHost", -1);
activate(w);
//Виклик
load_image();
logwrite("KrafterMT by Kosminskij. MADE IN UA");
sleep(3000);
logwrite("Подготовка к работе...");
//
loop()
{
if(findimage(1, #i_check_load_page_proxy[0][0], 0, #px[0], #py[0], 0, 0, 1366, 768, w)==1)
{
sleep(1000);
logwrite("Выполняеться переход на страницу авторизации.");
sleep(1000);
sendmouse(LEFT, px[0] + 200, py[0] + 90, w);
sendlanguage("00000409", w);
sendkey("m.vten.ru/login",0, w); sleep(500); sendkey(RETURN, w); sleep(500); //filling and enter
}
if(findimage(1, #i_enter[0][0], 0, #px[0], #py[0], 0, 0, 1366, 768, w)==1)
{
sleep(1000);
logwrite("Авторизация...");
sleep(1000);
login();
}
sleep(1000);
}
//
function check_error(int error_time_out)
{
error_time ++;
if(error_time >= error_time_out)
{
sendkey(F5, 0, w);
error_time = 0;
}
sleep(1000);
}
function logwrite(string log)
{
if(fopen("C:\krafterMT\logfile.txt", "w")!=0)
{
fwrite(log);
fclose();
}
}
function login()
{
if(fopen ("D:\test.txt", "r")!=0)
{
while(freadline(login_sent[n])!=0)
{
if(findimage(1, #i_name_pers[0][0], 0, #px[0], #py[0], 0, 0, 1366, 768, w)==1)
{
sendmouse(LEFT, px[0] + 25, py[0] + 25, w);
delete_input();
sleep(1000);
sendkey(login_sent[n], 0, w);
sleep(1000);
sendkey(TAB, w);
sleep(1000);
sendkey("8246291", 0, w);
sleep(1000);
//sendkey(RETURN, w);
logwrite("Производиться вход.");
sleep(1000);
}
n++;
}
fclose();
}
}
function delete_input()
{
keydown(17); keydown(65); sleep(500);
keyup(17); keyup(65); sleep(500); key(BACK);
}
int i_check_load_page_proxy[200][200], i_enter[100][100], i_name_pers[150][100], i_check_load_game[50][50], i_send_url_quest[40][40];
function load_image()
{
loadimage (#i_check_load_page_proxy[0][0], "D:\afm\texture\check_load_page_proxy.bmp");
loadimage (#i_enter[0][0], "D:\afm\texture\enter.bmp");
loadimage (#i_name_pers[0][0], "D:\afm\texture\name_pers.bmp");
loadimage (#i_check_load_game[0][0], "D:\afm\texture\check_load_game.bmp");
loadimage (#i_send_url_quest[0][0], "D:\afm\texture\send_url_quest.bmp");
}