Advertisement
Guest User

Untitled

a guest
Mar 7th, 2012
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.97 KB | None | 0 0
  1. # maf.class.php
  2.  
  3. <?php
  4.  
  5.  
  6. class LolMafiacore
  7. {
  8.  
  9.     public $user = ''; #fill this out
  10.     public $pass = ''; #fill this out
  11.     public $xp = 0;
  12.     public $prof;
  13.    
  14.    
  15.     public function login()
  16.     {
  17.         $c = curl_init('http://mafiacore.net/index.mc');
  18.         curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
  19.         curl_setopt($c, CURLOPT_COOKIEJAR, '/var/www/mafcor/c.j');
  20.         curl_setopt($c, CURLOPT_COOKIEFILE, '/var/www/mafcor/c.j');
  21.         curl_setopt($c, CURLOPT_POSTFIELDS, "user={$this->user}&pass={$this->pass}&submit=Submit");
  22.         curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
  23.         $cx = curl_exec($c);
  24.        
  25.         return true;
  26.     }
  27.    
  28.     public function commitCrime($crime)
  29.     {
  30.         $cr = curl_init('http://mafiacore.net/crime.mc');
  31.         curl_setopt($cr, CURLOPT_RETURNTRANSFER, true);
  32.         curl_setopt($cr, CURLOPT_COOKIEJAR, '/var/www/mafcor/c.j');
  33.         curl_setopt($cr, CURLOPT_COOKIEFILE, '/var/www/mafcor/c.j');
  34.         curl_setopt($cr, CURLOPT_FOLLOWLOCATION, true);
  35.        
  36.        
  37.         switch($crime)
  38.         {
  39.             case 'mug':
  40.                 curl_setopt($cr, CURLOPT_POSTFIELDS, "crime=1&submit=Commit+the+crime");
  41.             break;
  42.        
  43.        
  44.        
  45.         }
  46.        
  47.         $crx = curl_exec($cr);
  48.         preg_match("'<div class=\'success\'>.+</div>'", $crx, $status);
  49.         preg_match("'<div class=\'error\'>.+</div>'", $crx, $fail);
  50.         preg_match("'<div class=\'warning\'>.+</div>'", $crx, $warn);
  51.        
  52.         if($status)
  53.         {
  54.             preg_match("/\£\d+/", $status[0], $money);
  55.             preg_match('/\d{1,}\s(XP)/', $status[0], $exp);
  56.         }
  57.        
  58.        
  59.         if($status) { $this->xp += str_replace(" XP", "", $exp[0]); $this->prof += str_replace("£", "", $money[0]);
  60.         return "Success! Loot: ". $money[0] . ", XP: ". $exp[0] . " Total this session: {$this->xp} xp, {$this->prof} money.\n"; }
  61.         elseif($fail) { return strip_tags($fail[0]) ."\n"; }
  62.         else { return strip_tags($warn[0]) ."\n"; }
  63.     }
  64.  
  65.  
  66.  
  67. }
  68.  
  69.  
  70. ?>
  71.  
  72. # bot.php
  73.  
  74. <?php
  75.  
  76. include('maf.class.php');
  77.  
  78. $bot = new LolMafiacore;
  79.  
  80. $i = 1;
  81.  
  82. if($bot->login())
  83. {
  84.     while($i)
  85.     {
  86.         echo $bot->commitCrime('mug');
  87.         sleep(12);
  88.     }
  89. }
  90.  
  91.  
  92. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement