CODE:
char Time[100];
char Date[100];
int Year, Month, DayOfWeek, Day, Hour, Minute, Second, Milliseconds;
loop()
{
getlocaltime(Year, Month, DayOfWeek, Day, Hour, Minute, Second, Milliseconds);
Strftime(address(#Time[0]), sizearray(Time), "[%X] - ", Hour, Minute, Second, Day, Month, Year);
Strftime(address(#Date[0]), sizearray(Date), "*%d.%m.%y*", Hour, Minute, Second, Day, Month, Year);
}
function Log(string s)
{
int count;
int Size[2];
new char c[size(s)+1];
strcpy(#c[0], s);
GetTextExtentPoint32(DC_Listbox1, address(#c[0]), sizearray(c), address(#Size[0]));
if(Listbox1_TextLength < Size[0])
{
Listbox1_TextLength = Size[0];
sendmessage(LB_SETHORIZONTALEXTENT, Size[0], 0, formatiw(Object_Listbox1));
}
sendmessage(LB_ADDSTRING, 0, address(#c[0]), formatiw(Object_Listbox1));
count = sendmessage(LB_GETCOUNT, 0, 0, formatiw(Object_Listbox1));
if(format(#Load_Checkbox2[0]) == "1")
{
sendmessage(LB_SETTOPINDEX, count-1, 0, formatiw(Object_Listbox1));
}
//SendMessage(Object_Listbox1, LB_GETTEXT, count-1, address(#Text_Listbox1[0]));
//WritePrivateProfileString ("Default"+format(count), "Object_Listbox1", format(#Text_Listbox1[0]), temp_fold+"Log.txt");
delete c;
}
CREATE_TIMER(2, 1000)
{
Game = window (-1, "GeckoFPSandboxChildWindow", window ("моеокно", "MozillaWindowClass", -1));
if (Game != 0)
{
if(SettingGame == 0)
{
Log(format(#Time[0])+"Идет настройка бота...");
if(findimage(1, #Image_0[0][0], -1, #Image_x[0], #Image_y[0], 0, 0, Game.widthclient, Game.heightclient, Game) > 0)
{
Log(format(#Time[0])+"Обнаружена Image_0.bmp в координатах "+format(Image_x[0])+", "+format(Image_y[0]));
if(format(#Load_Checkbox1[0]) == "1")
{
}
else
{
mouse(LEFT, Image_x[0], Image_y[0], 1, Game);
mouse(LEFT, Image_x[0], Image_y[0], 1, Game);
mouse(LEFT, Image_x[0], Image_y[0], 1, Game);
sleep(500);
Log(format(#Time[0])+"Ищу точку отсчета.");
mousetransfer(LEFT, 200, 100, 845, 450, 0.02, 1, Game);
mousetransfer(LEFT, 200, 100, 845, 450, 0.02, 1, Game);
mousetransfer(LEFT, 200, 100, 845, 450, 0.02, 1, Game);
mousetransfer(LEFT, 200, 100, 845, 450, 0.02, 1, Game);
mousetransfer(LEFT, 200, 100, 845, 450, 0.02, 1, Game);
mousetransfer(LEFT, 573, 454, 194, 133, 0.02, 1, Game);
mousetransfer(LEFT, 701, 198, 333, 459, 0.02, 1, Game);
mousetransfer(LEFT, 819, 535, 342, 273, 0.02, 1, Game);
mousetransfer(LEFT, 943, 610, 443, 351, 0.02, 1, Game);
}
SettingGame = 1;
Log(format(#Time[0])+"Бот настроен.");
}
else
{
StopScript("Не удается найти Image_0.bmp");
}
}
}
else
{
StopScript("Ошибка в работе. Окно игры не найдено.");
}
}