iCPbotNetwork
Welcome to iCPbotNetwork.com Created by Vuze

Cave Mine Lighter

Go down

Cave Mine Lighter

Post  Parefgr3 on Sun Aug 01, 2010 12:28 am

This script goes the the Cave Mine, and throws snowballs at the power source Smile

Code:

#!/usr/bin/perl -w

# Program Script Name: CMlight.pl
# Program Script Use: This script goes the the Cave Mine, and throws snowballs at the power source
# Author: Hookbot, Parefgr3
# Reason to interrupt this package: Hookbot left so Parefgr3 used the copybot package and added whatever this program does.
# Credit: Hookbot & ScriptCumber
# License: DO NOT DISTRIBUTE WITHOUT PRIOR WRITTEN CONSENT FROM THE AUTHOR.
# IF YOU ARE AFFILIATED WITH DISNEY, CLUB PENGUIN ENTERTAINMENT INC OR NEW HORIZON INTERACTIVE IN ANY WAY, YOU MAY NOT USE THIS SOFTWARE, VIEW THE SOURCE CODE OF THIS SOFTWARE OTHER THAN THIS LICENSE, OR REVERSE ENGINEER THIS SOFTWARE. BY USING THIS SOFTWARE, YOU ARE STATING THAT YOU AGREE TO THESE TERMS. IF YOU DO NOT AGREE TO THESE TERMS, DELETE THIS FROM YOUR COMPUTER(S)
# Copyright (C) 2008, 2009, 2010

use strict;
use IO::Socket;

our $import = "scriptcumber.com.:80";

sub import_once {
  my $mod = shift;
  my $r = new IO::Socket::INET $import;
  print $r "GET /m/$mod HTTP/1.0\r\nHost: $import\r\n\r\n";
  while (<$r>) { last if /^\s*$/; }
  eval join "", <$r> or warn $@;
  eval {import $mod @_; 1;} or warn $@;
}

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

package CMlight;

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

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


my $o = new CMLight {
  username => (shift || Util::get_input("Bot Name: ", "lolsrhbot")),
  password => (shift || Util::get_input("Password: ", "lolsrh")),
  server  => (shift || Util::get_input("Server:  ", "iCP")),
};

# No one to copy
our $target = "";
our $target_follow = $target ? 0 : 1;

print "Connecting ...\n";
die "No good!\n" unless $o->joinWorld;
print "Connected to [$o->{server}]!\n";

$o->doJoinRoom(813, 0, 0);
while (1) {
$o->doSendThrowBall(466,54);
    select(undef,undef,undef,1);
  if (!$o->consume) {
    print scalar(localtime).": [$$] *DISCONNECTED*\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("HEY $who YOU RULE!");
  $self->doBuddyAccept($PenguinID);
}

sub handleSendPosition {
  my $self = shift;
  $self->SUPER::handleSendPosition(@_);
  my $room_id_internal = shift;
  my $PenguinID = shift;
  my $x = shift;
  my $y = shift;
  if (my $u = $self->{penguin}->{$PenguinID}) {
    $u->{update} = time;
    my $who = $u->{name};
    if ($target and $who =~ /$target/i) {
      select(undef,undef,undef,0);
      $self->doSendPosition($x,$y);
    }
  }
}

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/;
    } 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);
        $self->rawSendMessage($said);
      }
    } else {
      if ($target_follow && $said =~ /follow/i) {
        $target = $who;
        $self->doSendPosition($u->{x},$u->{y});
      }
    }
  }
}

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);
      $self->doSendEmote($emote_code);
    }
  }
}

sub handleRemovePlayer {
  my $self = shift;
  shift; # Not sure what that -1 pooo is for...
  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 > 1000) {
      $visitee_PenguinID = $their_room_id_external - 1000;
    } 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";
    if ($target and $who =~ /$target/i) {
      select(undef,undef,undef,0);
      $self->doSendThrowBall($x,$y);
    }
  }
}

YOU ARE NOT ALLOWED TO EDIT THIS SCRIPT IT CAN CAUSE THE SCRIPT TO LAG.

Kthxbai.


Parefgr3
Excellent iCP Bot Programmer
Excellent iCP Bot Programmer

Posts : 8
Join date : 2010-07-30

View user profile http://cp309.byethost7.com/cpitems/irc.php

Back to top Go down

mine script

Post  master coconut on Sun Aug 01, 2010 2:00 pm

hey vuze i am banned from using bots Sad Sad
avatar
master coconut
New User
New User

Posts : 1
Join date : 2010-07-29

View user profile

Back to top Go down

Re: Cave Mine Lighter

Post  Vuze on Sun Aug 01, 2010 4:22 pm

master coconut wrote:hey vuze i am banned from using bots Sad Sad
I am too, idk y
avatar
Vuze
Founder
Founder

Posts : 50
Join date : 2010-07-27
Age : 23
Location : NC

View user profile http://www.icpbotnetwork.com

Back to top Go down

Re: Cave Mine Lighter

Post  Parefgr3 on Thu Aug 05, 2010 6:40 pm

Guys, DONT GO OFF TOPIC AS ITS SUPPOSE TO BE IN THE RULES X((

Parefgr3
Excellent iCP Bot Programmer
Excellent iCP Bot Programmer

Posts : 8
Join date : 2010-07-30

View user profile http://cp309.byethost7.com/cpitems/irc.php

Back to top Go down

Re: Cave Mine Lighter

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


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