<?php
/*
Автор скрипта https://bymas.ru/id85823
Скрипты, программы на заказ.
Быстро, качественно, недорого.
*/
$login = '';#логин
$passwors = '';#пароль
$agent = 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.125 Safari/537.36 OPR/30.0.1835.88';
function aut($site){
global $login, $passwors, $agent;
$hornbeam = curl_init();
curl_setopt($hornbeam, CURLOPT_URL, $site);
curl_setopt($hornbeam, CURLOPT_USERAGENT, $agent);
curl_setopt($hornbeam, CURLOPT_REFERER, 'https://vrata.mobi/');
curl_setopt($hornbeam, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($hornbeam, CURLOPT_TIMEOUT, 60);
curl_setopt($hornbeam, CURLOPT_POST, 1);
curl_setopt($hornbeam, CURLOPT_POSTFIELDS, 'name='.$login.'&password='.$passwors.'&submit=Войти');
curl_setopt($hornbeam, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($hornbeam, CURLOPT_COOKIEFILE, 'cookie.txt');
$loading = curl_exec($hornbeam);
curl_close($hornbeam);
return $loading;
}
$_carry = aut('https://vrata.mobi/login');
if (!strripos($_carry, 'Пароль'))$_carry = aut('https://vrata.mobi/timer'); else exit('Authorization failed.');
$_main = aut('https://vrata.mobi/main');
preg_match('<a class="button backgreen ib fz8 h16" href="(.*)">', $_main, $main);
$main_go = 'https://vrata.mobi'.$main[1];
preg_match_all('/(a|href)=("|\')[^"\'>]+/i', $_carry, $_go);
$_west = $_go[0][7];
$_west = str_replace('href="', 'https://vrata.mobi', $_west);
$_north = $_go[0][8];
$_north = str_replace('href="', 'https://vrata.mobi', $_north);
$_east = $_go[0][9];
$_east = str_replace('href="', 'https://vrata.mobi', $_east);
$urls = array(
$_west,
$_north,
$_east,
$main_go,
'https://vrata.mobi/arena/notify/joinRivalArena?action=confirm',
'https://vrata.mobi/arena/start?fastaccess=1&type=bots',
'https://vrata.mobi/arena/start?fastaccess=1&type=real'
);
$cmh = curl_multi_init();
$tasks = array();
foreach ($urls as $url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
$tasks[$url] = $ch;
curl_multi_add_handle($cmh, $ch);
}
$active = null;
do {
$mrc = curl_multi_exec($cmh, $active);
}
while ($mrc == CURLM_CALL_MULTI_PERFORM);
while ($active && ($mrc == CURLM_OK)) {
if (curl_multi_select($cmh) != -1) {
do {
$mrc = curl_multi_exec($cmh, $active);
$info = curl_multi_info_read($cmh);
if ($info['msg'] == CURLMSG_DONE) {
$ch = $info['handle'];
$url = array_search($ch, $tasks);
$tasks[$url] = curl_multi_getcontent($ch);
curl_multi_remove_handle($cmh, $ch);
curl_close($ch);
}
}
while ($mrc == CURLM_CALL_MULTI_PERFORM);
}
}
curl_multi_close($cmh);