set_settings(2,'request_add',1);$stat = 'OK (REQUESTS ACCEPT)';} elseif($p1 == 'не принимать заявки'){$this->set_settings(2,'request_add',0);$stat = 'OK (REQUESTS DONT ACCEPT)';} elseif($p1 == 'послать online'){$this->api('account.setOnline&voip=0access_token='.$this->token);$stat = 'OK (ONLINE SEND)';} elseif($p1 == 'послать offline'){$this->api('account.setOffline?access_token='.$this->token);$stat = 'OK (OFFLINE SEND)';} elseif($p1 == 'включить вечный online'){$this->set_settings(4,'online',1);$stat = 'OK (ONLINE ON)';} elseif($p1 == 'выключить вечный online'){$this->set_settings(4,'online',0);$stat = 'OK (ONLINE OFF)';} elseif($p1 == 'выключить бота'){$this->set_settings(5,'bot',0);$stat = 'OK (BOT OFF)';} elseif($p1 == 'включить бота'){$this->set_settings(5,'bot',1);$stat = 'OK (BOT ON)';} elseif($p1 == 'постить и в комментариях на на стене'){$this->set_settings(6,'post',1);$stat = 'OK (ALL POST`S)';} elseif($p1 == 'постить только в комментариях'){$this->set_settings(6,'post',2);$stat = 'OK (COMMENTS ONLY)';} elseif($p1 == 'постить на стене'){$this->set_settings(6,'post',3);$stat = 'OK (WALL ONLY)';} elseif($p1 == 'включить рукапчу'){$this->set_settings(11,'rucapcha',1);$stat = 'OK (RUCAPCHA ON)';} elseif($p1 == 'выключить рукапчу'){$this->set_settings(11,'rucapcha',0);$stat = 'OK (RUCAPCHA OFF)';} if($stat){$dsas = $this->api('messages.send?user_id='.$this->uid.'&message=⏩'.urlencode($stat).'⏪¬ification=0&v=5.53&access_token='.$this->token_duble);} } public function set($p1, $p2){ return $this->$p1 = $p2; } public function set_settings($p1,$p2,$p3){ $data= '$global->set("'.$p2.'", "'.$p3.'");' . "\n"; $file = 'setting.php'; $array=file( $file ); $array[$p1-1]=$data; file_put_contents( $file, $array ); } public function flood_start() { $groups_get = $this->api('groups.search?q='.urlencode($this->request_group).'&type=group&future=0&market=0&sort=2&offset='.rand(1,50).'&count='.$this->post_count.'&v=5.53&access_token='.$this->token); for($i = 0; $i < $this->post_count; $i++) { $group_list .= $groups_get['items'][$i]['id'].','; } $group_list = substr($group_list, 0, -1); $groups = explode(",",$group_list); for($i = 0; $i < count($groups); $i++){ $attachments = $this->random(explode(",",$this->attachments)); $txt_comment = $this->random(explode(",",$this->comment)); if($this->post != 3) { $post_id_rand = $this->api('wall.get?owner_id=-'.$groups[$i].'&offset=1&count=1&filter=others&extended=0&v=5.53&access_token='.$this->token); $comment_create = $this->api('wall.createComment?owner_id='.$post_id_rand['items'][0]['owner_id'].'&post_id='.$post_id_rand['items'][0]['id'].'&from_group=0&message='.urlencode($txt_comment).'&v=5.53&access_token='.$this->token); if($comment_create["error_code"] == 14 and $this->rucapcha == 1){ $captcha_sid = $comment_create["captcha_sid"]; $this->download($comment_create["captcha_img"]); $recognize = $this->recognize(dirname(__FILE__)."/captcha.png", $this->key_capcha, true, "rucaptcha.com"); $comment_create = $this->api('wall.createComment?captcha_sid='.$captcha_sid.'&captcha_key='.$recognize.'&owner_id='.$post_id_rand['items'][0]['owner_id'].'&post_id='.$post_id_rand['items'][0]['id'].'&from_group=0&message='.urlencode($txt_comment).'&v=5.53&access_token='.$this->token); } if($this->rucapcha != 1) {sleep(2);}else{sleep(1);} } if($this->post != 2){ $post = $this->api('wall.post?owner_id=-'.$groups[$i].'&message='.urlencode($this->message).'&attachments='.$attachments.'&access_token='.$this->token); if($this->rucapcha != 1) {sleep(2);}else{sleep(1);} } if($post["error_code"] == 14 and $this->rucapcha == 1) { $captcha_sid = $post["captcha_sid"]; $this->download($post["captcha_img"]); $recognize = $this->recognize(dirname(__FILE__)."/captcha.png", $this->key_capcha, true, "rucaptcha.com"); $post = $this->api('wall.post?captcha_sid='.$captcha_sid.'&captcha_key='.$recognize.'&owner_id=-'.$groups[$i].'&message='.urlencode($this->message).'&attachments='.$attachments.'&access_token='.$this->token); } if($post['post_id']) { $file = fopen('post.txt' , 'a'); fputs($file,$groups[$i]."|".$post['post_id']."|".time().PHP_EOL); fclose($file); } } } public function DelNote() { $fp = "post.txt"; $file = file($fp); for($i = 0; $i < count($file); $i++) { $post_list = explode("|",$file[$i]); if($post_list[2] < time() - 900) { $this->api('wall.delete?owner_id='.$post_list[0].'&post_id='.$post_list[1].'&v=5.52&access_token='.$this->token); unset($file[$i]); file_put_contents("post.txt",$file); } } } public function addFriends() { $groups_get = $this->api('groups.search?q='.urlencode($this->request_group).'&type=group&future=0&market=0&sort=2&offset='.rand(1,50).'&count='.$this->post_count.'&v=5.53&access_token='.$this->token); for($i = 0; $i < $this->post_count; $i++) { $group_list .= $groups_get['items'][$i]['id'].','; } $group_list = substr($group_list, 0, -1); $group = $this->random(explode(",",$this->group_list)); $text_message = $this->random(explode(",",$this->message_list)); $addFriends = $this->api('wall.get?owner_id=-'.$group.'&offset=1&count=1&filter=others&extended=0&v=5.52&access_token='.$this->token); $add = $this->api('friends.add?user_id='.$addFriends['items'][0]['from_id'].'&access_token='.$this->token); if($add == 1 and $add != 2){ $add = $this->api('messages.send?user_id='.$addFriends['items'][0]['from_id'].'&message=⏩'.urlencode($text_message).'&v=5.52&access_token='.$this->token); } } public function download($picture) { if ($picture) { $pic = curl_init($picture); $file = fopen("captcha.png", "wb"); curl_setopt($pic, CURLOPT_FILE, $file); curl_setopt($pic, CURLOPT_HEADER, 0); curl_exec($pic); curl_close($pic); fclose($file); } } public function recognize($filename, $apikey, $is_verbose = true, $domain = "rucaptcha.com", $rtimeout = 5, $mtimeout = 120, $is_phrase = 0, $is_regsense = 0, $is_numeric = 0, $min_len = 0, $max_len = 0, $language = 0) { if (!file_exists($filename)) { if ($is_verbose) return false; } $postdata = array( 'method' => 'post', 'key' => $apikey, 'file' => '@'.$filename, 'phrase' => $is_phrase, 'regsense' => $is_regsense, 'numeric' => $is_numeric, 'min_len' => $min_len, 'max_len' => $max_len, 'language' => $language ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://$domain/in.php"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); $result = curl_exec($ch); if (curl_errno($ch)) { if ($is_verbose) return false; } curl_close($ch); if (strpos($result, "ERROR")!==false) { if ($is_verbose) return false; } else { $ex = explode("|", $result); $captcha_id = $ex[1]; if ($is_verbose) $waittime = 0; if ($is_verbose) sleep($rtimeout); while(true) { $result = file_get_contents("http://$domain/res.php?key=".$apikey.'&action=get&id='.$captcha_id); if (strpos($result, 'ERROR')!==false) { if ($is_verbose) return false; } if ($result=="CAPCHA_NOT_READY") { if ($is_verbose) $waittime += $rtimeout; if ($waittime>$mtimeout) { if ($is_verbose) break; } if ($is_verbose) sleep($rtimeout); } else { $ex = explode('|', $result); if (trim($ex[0])=='OK') return trim($ex[1]); } } return false; } } public function getRequests() { $getRequests = $this->api('friends.getRequests?count='.$this->request_add_count.'&out=0&access_token='.$this->token_duble); if ($getRequests) { for ($i = 0; $i < $this->request_add_count; $i++) { $this->api('friends.add?user_id='.$getRequests[$i].'&access_token='.$this->token_duble); } } } public function delRequests() { $delRequests = $this->api('friends.getRequests?out=1&count='.$this->requests_del.'&access_token='.$this->token_duble); for($i = 0; $i < count($delRequests); $i++){ $friends_delete = $this->api('friends.delete?user_id='.$delRequests[$i].'&access_token='.$this->token_duble); } } public function addlike() { $notifications = $this->api("notifications.get?access_token=".$this->token_duble); if($notifications["items"][1]["type"] == "like_post" || $notifications["items"][1]["type"] == "like_photo") { $photosGet = $this->api("photos.get?owner_id=".$notifications["items"][1]["feedback"][0]["owner_id"]."&album_id=profile&rev=1&extended=1&access_token=".$this->token_duble); if($photosGet[0]["pid"]) { if($photosGet[0]["likes"]["user_likes"] != 1) { $type = "photo"; $item_id = $photosGet[0]["pid"]; } } else { $wallGet = $this->api("wall.get?owner_id=".$notifications["items"][1]["feedback"][0]["owner_id"]."&filter=owner&extended=1&access_token=".$this->token_duble); if($wallGet["wall"][1]["likes"]["user_likes"] != 1) { $type = "post"; $item_id = $wallGet["wall"][1]["id"]; } } $this->api("likes.add?owner_id=".$notifications["items"][1]["feedback"][0]["owner_id"]."&item_id=".$item_id."&type=".$type."&access_token=".$this->token_duble); } } public function api($p1){ $ch = curl_init("https://api.vk.com/method/".$p1); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false); curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false); $response = curl_exec($ch); curl_close($ch); $json = json_decode($response, true); if($json["error"]["error_msg"]) { return $json["error"]; } else { return $json["response"]; } } public function random($p1){ $random = mt_rand (0, count($p1)-1); return $p1[$random]; } } ?>