Skip to content

Instantly share code, notes, and snippets.

@bilinin
Last active January 26, 2016 20:32
Show Gist options
  • Save bilinin/cd8827b5c429b64d37a7 to your computer and use it in GitHub Desktop.
Save bilinin/cd8827b5c429b64d37a7 to your computer and use it in GitHub Desktop.
var HpCurrent;
var HpMax;
var healcoeff;
var timeFight;
var timeRat;
var timePatrol;
var currentLevel;
var fightLevel=9;
var fightFlag=0;
function heal() {
iimPlay("code:TAG POS=1 TYPE=SPAN ATTR=ID:currenthp EXTRACT=TXT");
HpCurrent = iimGetLastExtract();
iimPlay("code:TAG POS=1 TYPE=SPAN ATTR=ID:maxhp EXTRACT=TXT");
HpMax = iimGetLastExtract();
healcoeff=parseInt(HpCurrent)/parseInt(HpMax);
if(healcoeff!=1){
iimPlay("heal.iim");
}
}
function timerFight() {
iimPlay("code:TAG POS=1 TYPE=A ATTR=ID:timeout EXTRACT=TXT");
timeFight =parseInt(iimGetLastExtract().replace(/\D+/g,""));
if(timeFight>0){
iimDisplay("wait fight");
}
else{
iimPlay("code:URL GOTO=http://www.moswar.ru/alley/");
iimPlay("code:TAG POS=4 TYPE=DIV ATTR=TXT:Отнятьу<SP>слабого1");
while(fightFlag==0){
levelDefine();
}
fightFlag=0;
}
}
function wait() {
iimDisplay("wait 60 seconds");
iimPlay("code:WAIT SECONDS=60");
iimPlay("code:REFRESH");
}
function metro(){
iimPlay("code:URL GOTO=http://www.moswar.ru/metro/");
iimPlay("code:TAG POS=1 TYPE=TD ATTR=ID:ratfight EXTRACT=TXT");
timeRat =parseInt(iimGetLastExtract().replace(/\D+/g,""));
iimPlay("code:TAG POS=1 TYPE=A ATTR=ID:timeout EXTRACT=TXT");
timeFight =parseInt(iimGetLastExtract().replace(/\D+/g,""));
//alert(timeRat);
if((timeRat>0)||(timeFight>0)){
iimDisplay("wait rat");
}
else
iimPlay("metroStart.iim");
}
function patrol(){
iimPlay("code:URL GOTO=http://www.moswar.ru/alley/");
iimPlay("code:TAG POS=1 TYPE=TD ATTR=ID:patrol EXTRACT=TXT");
timePatrol =parseInt(iimGetLastExtract().replace(/\D+/g,""));
//alert(timePatrol);
if(timePatrol>0){
iimDisplay("wait patrol");
}
else
iimPlay("patrol.iim");
}
function neft(){
iimPlay("code:TAG POS=1 TYPE=A ATTR=ID:timeout EXTRACT=TXT");
timeFight =parseInt(iimGetLastExtract().replace(/\D+/g,""));
iimPlay("code:URL GOTO=http://www.moswar.ru/neftlenin/");
if(timeFight>0){
iimDisplay("NO");
}
else{
//iimPlay("neft.iim");
iimPlay("code:TAG POS=1 TYPE=BUTTON ATTR=onclick:NeftLenin.viewPrize();");
iimPlay("code:TAG POS=1 TYPE=BUTTON ATTR=onclick:NeftLenin.attack();");
iimPlay("code:TAG POS=1 TYPE=BUTTON ATTR=TXT:Начать<SP>задание");
iimPlay("code:TAG POS=1 TYPE=BUTTON ATTR=TXT:Приступить<SP>к<SP>выполнению");
iimPlay("code:TAG POS=1 TYPE=BUTTON ATTR=onclick:NeftLenin.viewPreMission1();");
iimPlay("code:TAG POS=1 TYPE=BUTTON ATTR=onclick:NeftLenin.viewPreMission2();");
iimPlay("code:TAG POS=1 TYPE=BUTTON ATTR=onclick:NeftLenin.nextStep();");
iimPlay("code:TAG POS=1 TYPE=BUTTON ATTR=TXT:Сбежать<SP>от<SP>охраны<SP>+30");
}
}
function levelDefine(){
iimPlay("code:TAG POS=1 TYPE=DIV ATTR=CLASS:fighter2 EXTRACT=TXT");
currentLevel = parseInt(iimGetLastExtract().replace(/\D+/g,""));
if(fightLevel>=currentLevel){
iimPlay("fight.iim");
fightFlag=1;
}
else
{
iimPlay("code:TAG POS=1 TYPE=DIV ATTR=CLASS:button<SP>button-search EXTRACT=TXT");
if(iimGetLastExtract()=="Искать другого"){ // КОСТЫЛЬ
iimPlay("code:TAG POS=1 TYPE=A ATTR=TXT:Искать<SP>другого");
}
else
fightFlag=1;
}
}
function shaur(){
iimPlay("code:URL GOTO=http://www.moswar.ru/shaurburgers/");
iimPlay("code:TAG POS=1 TYPE=SPAN ATTR=ID:shaurma-btn");
}
//*********************** MAIN FUNCTION **************************//
while(1){
heal();
// neft();
metro();
heal();
timerFight();
patrol();
heal();
wait();
shaur();
//levelDefine();
}
//class="fighter_hp" span
//Когда моя девочка рядом порхала
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment