Kibor Bot Autoclicker » Kibor - Integrated development environment for bots » Textbook Kibor » Create a bot for Music Wars in real time

Страниц (1): [1]
 

1. Kibor - 25 Июля, 2018 - 23:34:09 - перейти к сообщению
The lesson of creating a bot for Music Wars in Kibor in real time with explanations. The bot scans and recognizes the number of available battles, the amount of energy. Recognizes the parameters of our character and rivals. Spends battles with the opponent weaker than us.



Download the recognition database here Text recognition function

Script:
CODE:
int lx [3], ly [3];
lx [0]=426; ly [0]=353;
lx [1]=561; ly [1]=355;
lx [2]=697; ly [2]=355;

string text, text1;

string A [4];
string V1 [4];
string V2 [4];

int t;

int col_text [1];
col_text [0]=16711422;


loadsymbolbase ("C:\basetext.sib");
pause (1000);
enablerealmouse (10, 7, 5, 5);


loop ()
{
for (int n=0; n <3; n ++)
{
expectation();

t=comparison ();
if (t == - 1) {mouse (LEFT, 196, 298); pause (3000); goto ff;}
if (t == 1) mouse (LEFT, 530, 743);
if (t == 2) mouse (LEFT, 911, 745);
pause (3000);
mousemove (733, 531);
pause (1200);
mouse (LEFT, 733, 531);
pause (3000);
mouse (LEFT, 733, 531);
pause (1000);
mouse (LEFT, 196, 298);
pause (2000);
ff :;
}
}

function comparison ()
{
mousemove (488, 334);
pause (2000);
readtext (NUM, #A [0], 1, -1, -1, -1, -1, #col_text [0], -1, 0, -1, 504, 303, 526, 379, -1);
readtext (NUM, # V1 [0], 1, -1, -1, -1, -1, #col_text [0], -1, 0, -1, 617, 487, 642, 566, -1);
readtext (NUM, # V2 [0], 1, -1, -1, -1, -1, #col_text [0], -1, 0, -1, 1003, 489, 1025, 566, -1);

for (int i=0; i <4; i ++)
{
if (formatsn (A [i]) <= formatsn (V1 [i])) goto e;
}
return 1;
e :;

for (i=0; i <4; i ++)
{
if (formatsn (A [i]) <= formatsn (V2 [i])) return -1;
}
return 2;
}


function wait ()
{
loop ()
{
a: readtext (NUM, #text, 8, 1, -1, -1, -1, -1, -1, 0, -1, 398, 200, 417, 214, -1);
if (formatsn (text)> 0)
{
pause (1000);
readtext (NUM, #text, 8, 1, -1, -1, -1, -1, -1, 0, -1, 398, 200, 417, 214, -1);
if (formatsn (text) <1) goto a;
else goto uu;
}
sleep (500);
}
uu :;
loop ()
{
a1: readtext (NUM, # text1, 8, 1, -1, -1, -1, -1, -1, 0, -1, 489, 200, 507, 214, -1);
if (formatsn (text1)> 1)
{
pause (1000);
readtext (NUM, # text1, 8, 1, -1, -1, -1, -1, -1, 0, -1, 489, 200, 507, 214, -1);
if (formatsn (text1) <2) goto a1;
else goto ee;
}
sleep (500);
}
ee :;
mouse (LEFT, lx [n], ly [n]);
sleep (700);
mouse (LEFT, lx [n], ly [n]);
pause (3000);
}

Powered by ExBB FM 1.0 Final