Monday, October 3, 2011

How to add a function

This tutorial is written by Garetty not me.

First thing you will need is a function.

Open up tasks.php in a text editor and find the first function. This function is called sendRawPacket.

      function sendRawPacket($packet) {    
      fwrite($this->sock, $packet . chr(0)); 
         $info = stream_get_meta_data($this->sock);   
       if ($info['timed_out']) {      
        $this->run = false;         
 }     
 } 

You can add functions before that one, but I like to add them after the second function, just for better organization.

So find this (It is near the top of tasks.php):

      function readRawPacket($length = 8192) {     
     return fread($this->sock, $length);  
    } 


The next line, after the }, copy and paste your function.
For this example, I will be using mine and GaToR's function, addCoins.

I am going to copy this function and paste it after the } in the function readRawPacket.
It should look like this (Starting with sendRawPacket):

      function sendRawPacket($packet) {
           fwrite($this->sock, $packet . chr(0)); 
          $info = stream_get_meta_data($this->sock);
           if ($info['timed_out']) { 
              $this->run = false;   
       }      }  
    function readRawPacket($length = 8192) { 
          return fread($this->sock, $length);  
    }   
 function addCoins($coins) {  
      echo "\nStarting getCoins Function by Garetty and GaToR.\nWe will now attempt to add " . $coins . " to your account.\nThis may take a while, depending on the amount of coins you would like to add.\n"; 
       $addedcoins = $coins;
         $a = 0;    
    $Loop = 0;   
     $this->joinRoom(110);
         if ($coins < 1) { 
            echo "\nCoins must be above 0\n";    
    }        if ($coins > 0 && $coins < 5001) {   
         $this->joinRoom(810);    
        $this->joinGame(912);        
    sleep(1);       
     $this->getCoins($coins);   
     } else {       
     while ($coins > 5000) {     
           $a++;          
      $low = ($coins - 5000);       
         $coins = $low;      
      }            $this->joinRoom(810);    
        $this->joinGame(912);      
      $this->getCoins($coins);       
     while ($Loop < $a) {         
       $Loop++;         
       $this->joinRoom(810);      
          $this->joinGame(912);         
       sleep(1);       
         $this->getCoins(5000);        
        sleep(1);    
        }   
     }      
  echo $addedcoins . " coins have been added to your account.\n"; 
   } 


And that's all it takes.

Some other PCL Tutorials

http://www.penguinclientsystem.com/forum/viewforum.php?f=3&sid=564cbbe8981411be8b20d71c3353f80b

That is the link of the official forums of the PCL Tutorials. Go there for more tutorials but I'll post here also.

New PCL Version

A new version has been released due to changes of Club Penguin handling packets.

http://www.penguinclientsystem.com/forum/viewtopic.php?f=9&t=1763&sid=1bdd68a74976578051279b725dc23bf6


Club Penguin War Bot 2011

This is a remake of my old war bot in PCL. I have re-created it in a new but it does the old same thing but now better.

http://www.penguinclientsystem.com/forum/viewtopic.php?f=8&t=1772&sid=e7f8e0894f9286838c4ce41a7fd12177

Sunday, December 19, 2010

addStamp made by test

  function addStamp($ID){
      $this->sendRawPacket("%xt%s%st#sse%-1%$ID%");
   }