TroExol / WF.KIWI

// ==UserScript==
// @name         WF.KIWI
// @namespace    https://vk.com/TroExol
// @version      1.0.2.7
// @description  Автоматическая отправка на задания и открытие/принятие кейсов
// @author       TroExol
// @copyright    2018, TroExol (https://vk.com/TroExol)
// @license      MIT
// @match        https://wf.mail.ru/kiwi
// @grant        none
// ==/UserScript==

// ==OpenUserJS==
// @author TroExol
// ==/OpenUserJS==

(function (d, s) {
  s = d.createElement('script');
  s.src = 'https://progamestak.ru/src/libs/js/jquery-3.2.1.min.js';
  (d.head || d.documentElement).appendChild(s)
})(document);

// Открытие кейсов
setTimeout(function () {
  $('head').append('<style>a, a:active, a:focus, button, button:active, button:focus, input, input:active, input:focus{outline: none; text-decoration: none; border: none;} .te_btn{position: absolute; z-index: 99999; cursor: pointer; border-radius: 11px; padding: 3px; transition: 0.2s} .te_btn:hover{-moz-transform: scale(1.05); -o-transform: scale(1.05); -ms-transform: scale(1.05); -webkit-transform: scale(1.05); transform: scale(1.05);} hr.res.hr{margin-block-start: 2px;} li.res.resources.res_1{color: red;} li.res.resources.res_2{color: orange;} li.res.resources.res_3{color: yellow;} li.res.resources.res_4{color: violet;} li.res.resources.res_5{color: green;} li.res.avatar.fail{color: red;} li.res.avatar.temp{color: orange;} li.res.avatar.forever{color: green;}</style>');
  $('body').append('<button id="te_open_cases" class="te_btn" style="top: 5px; left: 5px;">Проверить кейсы</button>');
  $('body').append('<button id="te_send_job" class="te_btn" style="position: absolute; z-index: 99999; top: 30px; left: 5px;">Проверить задание</button>');
  $('body').append('<button id="te_trans_resources" class="te_btn" style="top: 5px; left: 125px;">Проверить ресурсы</button>');
  $('body').append('<button id="te_clear_open_send" class="te_btn" style="bottom: 5px; left: 5px; padding: 5px;">Остановить автоматическую отправку</button>');
  $('body').append('<button id="te_start_open_send" class="te_btn" style="bottom: 41px; left: 5px; padding: 5px;" onclick="location.reload();">Начать автоматическую отправку</button>');
  if (localStorage.getItem('hideRes') != 1) {
    $('body').append('<div id="gotResources" class="te_res" style="position: absolute; z-index: 99999; top: 82px; left: 5px; width: 140px; border: 1px solid #fff; padding: 5px; background-color: #1f2126;"><h2>Полученные ресурсы:</h2><ul style="height: 203px; overflow: auto;"></ul><button class="te_btn" style="left: 0; bottom: -17px; background-color: rgba(160,160,160, 0.7);">Очистить log</button></div>');
    $('body').append('<div id="gotAvatarRewards" class="te_res" style="position: absolute; z-index: 99999; top: 82px; left: 185px; width: 140px; border: 1px solid #fff; padding: 5px; background-color: #1f2126;"><h2>Результаты персонажа:</h2><ul style="height: 203px; overflow: auto;"></ul><button class="te_btn" style="left: 0; bottom: -17px; background-color: rgba(160,160,160, 0.7);">Очистить log</button></div>');
    var hideResText = 'Скрыть';
  }
  else {
    var hideResText = 'Показать';
  }
  $('body').append('<button id="te_hide_res" class="te_btn" style="top: 55px; left: 5px; background-color: rgba(120,120,120, 1);">' + hideResText + ' результаты</button>');
}, 1000);

// Скрытие результатов
function hideRes() {
  if ($('.te_res').length != 0) {
    localStorage.setItem('hideRes', 1);
    location.reload();
  }
  else {
    localStorage.setItem('hideRes', 0);
    location.reload();
  }
}

// Очистка результатов
function clearLog(el) {
  localStorage.removeItem(el);
  $('#got' + el + ' > ul').html('');
}

// Заполнение результатами
setTimeout(function () {
  if (localStorage.getItem('AvatarRewards') !== null) {
    var arrayAvatarRewards = localStorage.getItem('AvatarRewards').split(';');
    for (i = arrayAvatarRewards.length - 1; i >= 0; i--) {
      if (arrayAvatarRewards[i] != '') {
        if (arrayAvatarRewards[i].indexOf('не пройдено') != -1) {
          $('#gotAvatarRewards > ul').append('<hr class="res hr"><li class="res avatar fail">' + arrayAvatarRewards[i] + '</li>');
        }
        else if (arrayAvatarRewards[i].indexOf('ч.') != -1) {
          $('#gotAvatarRewards > ul').append('<hr class="res hr"><li class="res avatar temp">' + arrayAvatarRewards[i] + '</li>');
        }
        else if (arrayAvatarRewards[i].indexOf('навсегда') != -1) {
          $('#gotAvatarRewards > ul').append('<hr class="res hr"><li class="res avatar forever">' + arrayAvatarRewards[i] + '</li>');
        }
      }
    }
  }
  if (localStorage.getItem('Resources') !== null) {
    var arrayResources = localStorage.getItem('Resources').split(';');
    for (i = arrayResources.length - 1; i >= 0; i--) {
      if (arrayResources[i] != '') {
        if (arrayResources[i].indexOf('1 уровень') != -1) {
          $('#gotResources > ul').append('<hr class="res hr"><li class="res resources res_1">' + arrayResources[i] + '</li>');
        }
        else if (arrayResources[i].indexOf('2 уровень') != -1) {
          $('#gotResources > ul').append('<hr class="res hr"><li class="res resources res_2">' + arrayResources[i] + '</li>');
        }
        else if (arrayResources[i].indexOf('3 уровень') != -1) {
          $('#gotResources > ul').append('<hr class="res hr"><li class="res resources res_3">' + arrayResources[i] + '</li>');
        }
        else if (arrayResources[i].indexOf('4 уровень') != -1) {
          $('#gotResources > ul').append('<hr class="res hr"><li class="res resources res_4">' + arrayResources[i] + '</li>');
        }
        else if (arrayResources[i].indexOf('5 уровень') != -1) {
          $('#gotResources > ul').append('<hr class="res hr"><li class="res resources res_5">' + arrayResources[i] + '</li>');
        }
      }
    }
  }
}, 1000)

// Отправка на задание
function te_sendToJob() {
  $('.stars_container .stars_list:nth-child(3)').click(); // Можно менять 3 (Сколько звезд)
  setTimeout(function () {
    if ($('.stars_container .stars_list:nth-child(3)').hasClass('active')) { // Можно менять 3 (Сколько звезд)
      $('.stars_container .stars_list:nth-child(3)').click(); // Можно менять 3 (Сколько звезд)
      if ($('.stars_container .stars_list:nth-child(3)').hasClass('active')) { // Можно менять 3 (Сколько звезд)
        $('.tasks__window.double_mix_border.corner_big.avatar.pos_3 .button.button--white').click();
      }
      else $('.screen__inner.squares__inner > .close').click();
    }
    setTimeout(function () {
      $('.screen__inner.squares__inner > .close').click();
    }, 2000)
  }, 1000)
}

// Функции персонажа
function te_autoSendJob() {
  $('.screen__inner.squares__inner > .close').click();
  $('.map__point.point-volcano > div.map__point__inner.squares__inner > div.map__point__options > div:nth-child(1)').click(); // Можно менять point-volcano (Какой континент)
  setTimeout(function () {
    $('.tasks__item.level_3 .tasks__item__one.row_5.avatar').click(); // Можно менять level_3 и row_5 (Какое задание персонажа)
    setTimeout(function () {
      if ($('.tasks__window.double_mix_border.avatar.pos_3 .button.button--white').html() == "Отправить") {
        if ($('.header__nav__item.app.energy .value').html().replace('%', '') >= 15) { // Можно менять 15 (Сколько энергии тратит задание)
          te_sendToJob();
        }
        else $('.screen__inner.squares__inner > .close').click();
      }
      else if ($('.tasks__window.double_mix_border.avatar.pos_3 .button.button--white').html() == "Закрыть") {
        // Запись результата в localstorage
        var date = new Date();
        if (date.getMonth() < 10) {
          var month = date.getMonth() + 1;
          month = '0' + month;
        }
        else month = date.getMonth() + 1;
        if (date.getDate() < 10) {
          var day = date.getDate();
          day = '0' + day;
        }
        else day = date.getDate();
        if (date.getHours() < 10) {
          var hours = date.getHours();
          hours = '0' + hours;
        }
        else hours = date.getHours();
        if (date.getMinutes() < 10) {
          var minutes = date.getMinutes();
          minutes = '0' + minutes;
        }
        else minutes = date.getMinutes();
        if (localStorage.getItem('AvatarRewards') === null) {
          if ($('.avatar__reward .failed').html() == 'Задание не пройдено!') {
            localStorage.setItem('AvatarRewards', day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .failed').html() + ';');
            $('#gotAvatarRewards > ul').prepend('<hr class="res hr"><li class="res avatar fail">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .failed').html() + '</li>');
          }
          else if ($('.avatar__reward .success').html() == 'Задание пройдено!') {
            if ($('.avatar__reward .prize_item .time').html().indexOf('ч.') != -1) {
              localStorage.setItem('AvatarRewards', day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .prize_item .name').html() + ' ' + $('.avatar__reward .prize_item .time').html() + ';');
              $('#gotAvatarRewards > ul').prepend('<hr class="res hr"><li class="res avatar temp">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .prize_item .name').html() + ' ' + $('.avatar__reward .prize_item .time').html() + '</li>');
            }
            else if ($('.avatar__reward .prize_item .time').html().indexOf('навсегда') != -1) {
              localStorage.setItem('AvatarRewards', day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .prize_item .name').html() + ' ' + $('.avatar__reward .prize_item .time').html() + ';');
              $('#gotAvatarRewards > ul').prepend('<hr class="res hr"><li class="res avatar forever">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .prize_item .name').html() + ' ' + $('.avatar__reward .prize_item .time').html() + '</li>');
            }
          }
        }
        else {
          var avatarRewards = localStorage.getItem('AvatarRewards');
          if ($('.avatar__reward .failed').html() == 'Задание не пройдено!') {
            localStorage.setItem('AvatarRewards', avatarRewards + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .failed').html() + ';');
            $('#gotAvatarRewards > ul').prepend('<hr class="res hr"><li class="res avatar fail">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .failed').html() + '</li>');
          }
          else if ($('.avatar__reward .success').html() == 'Задание пройдено!') {
            if ($('.avatar__reward .prize_item .time').html().indexOf('ч.') != -1) {
              localStorage.setItem('AvatarRewards', avatarRewards + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .prize_item .name').html() + ' ' + $('.avatar__reward .prize_item .time').html() + ';');
              $('#gotAvatarRewards > ul').prepend('<hr class="res hr"><li class="res avatar temp">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .prize_item .name').html() + ' ' + $('.avatar__reward .prize_item .time').html() + '</li>');
            }
            else if ($('.avatar__reward .prize_item .time').html().indexOf('навсегда') != -1) {
              localStorage.setItem('AvatarRewards', avatarRewards + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .prize_item .name').html() + ' ' + $('.avatar__reward .prize_item .time').html() + ';');
              $('#gotAvatarRewards > ul').prepend('<hr class="res hr"><li class="res avatar forever">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + $('.avatar__reward .prize_item .name').html() + ' ' + $('.avatar__reward .prize_item .time').html() + '</li>');
            }
          }
        }
        // end Запись результата в localstorage
        $('.tasks__window.double_mix_border.avatar.pos_3 .button.button--white').click();
        if ($('.header__nav__item.app.energy .value').html().replace('%', '') >= 15) { // Можно менять 15 (Сколько энергии тратит задание)
          te_sendToJob();
        }
        else $('.screen__inner.squares__inner > .close').click();
      }
      else $('.screen__inner.squares__inner > .close').click();
    }, 5000)
  }, 2000)
}

// Открытие кейсов
function te_autoOpenCases() {
  $('.screen__inner.squares__inner > .close').click();
  $('.icon.icon-nav-craft').click();
  setTimeout(function () {
    $('.bp-nav__item:nth-child(1)').click();
    setTimeout(function () {
      var i = 1,
        r = 0;
      if ($('.craft-container [button_title="Забрать содержимое"]').length != 0 || $('[button_title="Открыть кейс"]').length != 0) {
        while (r != 1 && i <= 8) {
          if ($('.craft-container:nth-child(' + i + ') [button_title="Забрать содержимое"]').length != 0) {
            $('.craft-container:nth-child(' + i + ') [button_title="Забрать содержимое"]').click();
            setTimeout(function () {
              // Получение времени
              var date = new Date();
              if (date.getMonth() < 10) {
                var month = date.getMonth() + 1;
                month = '0' + month;
              }
              else month = date.getMonth() + 1;
              if (date.getDate() < 10) {
                var day = date.getDate();
                day = '0' + day;
              }
              else day = date.getDate();
              if (date.getHours() < 10) {
                var hours = date.getHours();
                hours = '0' + hours;
              }
              else hours = date.getHours();
              if (date.getMinutes() < 10) {
                var minutes = date.getMinutes();
                minutes = '0' + minutes;
              }
              else minutes = date.getMinutes();
              // end Получение времени
              // Запись результата в localstorage
              if (localStorage.getItem('Resources') === null) {
                if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--1').length != 0) {
                  localStorage.setItem('Resources', day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '1 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_1">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '1 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
                else if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--2').length != 0) {
                  localStorage.setItem('Resources', day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '2 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_2">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '2 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
                else if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--3').length != 0) {
                  localStorage.setItem('Resources', day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '3 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_3">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '3 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
                else if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--4').length != 0) {
                  localStorage.setItem('Resources', day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '4 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_4">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '4 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
                else if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--5').length != 0) {
                  localStorage.setItem('Resources', day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '5 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_5">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '5 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
              }
              else {
                var Resources = localStorage.getItem('Resources');
                if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--1').length != 0) {
                  localStorage.setItem('Resources', Resources + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '1 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_1">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '1 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
                else if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--2').length != 0) {
                  localStorage.setItem('Resources', Resources + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '2 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_2">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '2 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
                else if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--3').length != 0) {
                  localStorage.setItem('Resources', Resources + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '3 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_3">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '3 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
                else if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--4').length != 0) {
                  localStorage.setItem('Resources', Resources + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '4 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_4">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '4 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
                else if ($('.craft-container-popup-reward .craft-container-popup-reward__resource .craft-resource-icon.craft-resource-icon--5').length != 0) {
                  localStorage.setItem('Resources', Resources + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '5 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + ';');
                  $('#gotResources > ul').prepend('<hr class="res hr"><li class="res resources res_5">' + day + '.' + month + ' ' + hours + ':' + minutes + ' ' + '5 уровень: ' + $('.craft-container-popup-reward .craft-container-popup-reward__amount').html() + '</li>');
                }
              }
              // end Запись результата в localstorage
              $('.craft-container-popup__button.button').click();
              setTimeout(function () {
                $('.screen__inner.squares__inner > .close').click();
              }, 2000);
            }, 1000);
            r = 1;
          }
          else if ($('[button_title="Открыть кейс"]').length > 0) {
            $('[button_title="Открыть кейс"]').click();
            setTimeout(function () {
              $('.craft-container-popup-controls__button.craft-container-popup-controls__button--open.button').click();
              setTimeout(function () {
                $('.screen__inner.squares__inner > .close').click();
              }, 1000);
            }, 1000);
            r = 1;
          }
          i++;
        }
      }
      else $('.screen__inner.squares__inner > .close').click();
    }, 1000);
  }, 500);
}

// Перевод ресурсов
function te_autoTransResource() {
  $('.screen__inner.squares__inner > .close').click();
  $('.icon.icon-nav-craft').click();
  setTimeout(function () {
    $('.bp-nav__item:nth-child(2)').click();
    setTimeout(function () {
      $('.craft-resource-select__icon.craft-resource-icon.craft-resource-icon--2').click();
      setTimeout(function () {
        var avail = $('.craft-resources-trade__header').html().replace('Доступно ресурса для обмена: ', '');
        if (avail >= 50) {
          avail = Math.trunc(avail / 50);
          for (var i = 0; i < avail; i++) {
            $('.counter-input .counter-input__control:contains("+")').click();
          }
          setTimeout(function () {
            $('.craft-resources-trade-button:contains("Перевести")').click();
          }, 80);
        }
        setTimeout(function () {
          $('.craft-resource-select__icon.craft-resource-icon.craft-resource-icon--3').click();
          setTimeout(function () {
            var avail = $('.craft-resources-trade__header').html().replace('Доступно ресурса для обмена: ', '');
            if (avail >= 50) {
              avail = Math.trunc(avail / 50);
              for (var i = 0; i < avail; i++) {
                $('.counter-input .counter-input__control:contains("+")').click();
              }
              setTimeout(function () {
                $('.craft-resources-trade-button:contains("Перевести")').click();
              }, 80);
            }
            setTimeout(function () {
              $('.craft-resource-select__icon.craft-resource-icon.craft-resource-icon--4').click();
              setTimeout(function () {
                var avail = $('.craft-resources-trade__header').html().replace('Доступно ресурса для обмена: ', '');
                if (avail >= 35) {
                  avail = Math.trunc(avail / 35);
                  for (var i = 0; i < avail; i++) {
                    $('.counter-input .counter-input__control:contains("+")').click();
                  }
                  setTimeout(function () {
                    $('.craft-resources-trade-button:contains("Перевести")').click();
                  }, 80);
                }
                setTimeout(function () {
                  $('.craft-resource-select__icon.craft-resource-icon.craft-resource-icon--5').click();
                  setTimeout(function () {
                    var avail = $('.craft-resources-trade__header').html().replace('Доступно ресурса для обмена: ', '');
                    if (avail >= 25) {
                      avail = Math.trunc(avail / 25);
                      for (var i = 0; i < avail; i++) {
                        $('.counter-input .counter-input__control:contains("+")').click();
                      }
                      setTimeout(function () {
                        $('.craft-resources-trade-button:contains("Перевести")').click();
                      }, 80);
                    }
                    $('.screen__inner.squares__inner > .close').click();
                  }, 1000);
                }, 900);
              }, 1000);
            }, 900);
          }, 1000);
        }, 900);
      }, 1000);
    }, 1000);
  }, 1000);
}

setTimeout(function () {
  $('#te_open_cases').click(function () {
    te_autoOpenCases();
  });
  $('#te_send_job').click(function () {
    te_autoSendJob();
  });
  $('#te_trans_resources').click(function () {
    te_autoTransResource();
  });
  $('#te_hide_res').click(function () {
    hideRes();
  });
  $('#gotAvatarRewards button').click(function () {
    clearLog('AvatarRewards');
  });
  $('#gotResources button').click(function () {
    clearLog('Resources');
  });

  $('#te_clear_open_send').click(function () {
    clearInterval(auto_open_send_interval);
    clearTimeout(auto_open_send_timeout);
  });

  var auto_open_send_interval = setInterval(function () {
    te_autoOpenCases();
    setTimeout(function () {
      te_autoSendJob();
      setTimeout(function () {
        te_autoTransResource();
      }, 70000);
    }, 90000);
  }, 200000);

}, 3000);

var auto_open_send_timeout = setTimeout(function () {
  location.reload();
}, 600000);