Ball Trade Php Script

Discussion about Helbreath Server Files.
Post Reply
bobek
just visiting
Posts: 9
Joined: Tue Mar 09, 2004 3:50 pm

Post by bobek »

yo, i was download a php script from <a href='http://koti.welho.com/ahoyden/download/ ... hSS.tk.zip' target='_blank'>http://koti.welho.com/ahoyden/download/ ... .tk.zip</a> and i have problem with a trade ball script, i think is broken but i dont know where. Is there someone who knows php and can fix it? the code is:
<?
/* ----------------------------------------------------------------------------------
DarkZero's Trade Script for Helbreath Servers
If you find a bug, have a suggestion for another script,
or need to contact me, please contact me one of the following ways:
Email: dz@suckas.net
AIM: DarkZeroPU
ICQ: 157544686
IRC: irc.hbportal.net #h2 #hbredemption
-------------------------------------------------------------------------------------
This file may be distributed freely as long as this part of the code is left intact.
I do not demand it, but please give me credit if you decide to use my script. No, it's
not that good but it did take a long time to make.
Everything herein is Copyright Brian Seeders 2003
-------------------------------------------------------------------------------------
The only thing you need to do is insert your core directory into the line
below (leave off the \ at the end)
-------------------------------------------------------------------------------------
NOTE: If you receive errors regarding undefined indexes, your PHP configuration needs
to be changed.
-------------------------------------------------------------------------------------
Release Notes:
August 28,2003: First release

In the next release:
-Suggestions Needed-

---------------Edit this----------------*/
$dir = 'C:\\Example';
/*-------------Edit this----------------*/
if(!$_GET){
  $lines = file('trades.txt');
  foreach($lines as $b){
    $b = explode(':', $b);
    $moo = $moo . '<option value="'.$b[0].'">'.$b[1].' - '.$b[3].' Pts</option>';
  }
  echo '
  <form action='.$_SERVER['PHP_SELF'].'?submit method=post>
  <center><h2>Trade points for items</h2>
  Account:<input type=text name=acc>
  <br>
  Password:<input type=password name=pass>
  <br>
  Character:<input type=text name=char>
  <br>
  Item:
  <select NAME=item>
  '.$moo.'
  </select>
  <p>
  <input type=submit name=getitem Value=Trade>
  </form>
  <hr>
  <form action='.$_SERVER['PHP_SELF'].'?submit method=post><h2>Trade in items for points</h2>
  Account:<input type=text name=acc>
  <br>
  Password:<input type=password name=pass>
  <br>
  Character:<input type=text name=char>
  <br>
  <input type=submit name=point Value=Trade>
  </form>
  <hr>
  <form action='.$_SERVER['PHP_SELF'].'?submit method=post><h2>See how many points you have</h2>
  Account:<input type=text name=acc>
  <br>
  Password:<input type=password name=pass>
  <br>
  Character:<input type=text name=char>
  <br>
  <input type=submit name=tell Value=Submit>'
;
}
else{
  if($_POST['point']){
    $acc = $_POST['acc'];
    $pass = $_POST['pass'];
    $char = $_POST['char'];
    $fl = substr($acc, 0, 1);
    $ascii = ord($fl);
    $filename = $dir . '\\Account\\ASCII' . $ascii . '\\' . $acc . '.txt';
    $lines = file($filename);
    $a=0;
    foreach($lines as $a){
      $a = trim($a);
      if($a == 'account-password = '.$pass.''){ $passflag=TRUE; }
      elseif($a == 'account-character  = '.$char.''){ $charflag=TRUE; }
    }
    if(!$passflag){ echo 'Incorrect password'; }
    if(!$charflag){ echo 'Character does not seem to be on this account!'; }
    else{
      $fl = substr($acc, '0', '1');
      $casc = ord($char);
      $fchar = $dir . '\\Character\\ASCII' . $casc . '\\' . $char . '.txt';
      $lines = file($fchar);
      $a=0;
      $ilines = file('points.txt');
      foreach($lines as $b){
        foreach($ilines as $c){
          $c = explode(':', $c);
          if(substr_count($b, $c[0]) > 0){ $lines[$a] = NULL; $points = $points+$c[1];}
        }
        if(substr_count($b, '[EOF]') > 0){
          $eof = $a-1;
        }
        if(substr_count($b, 'character-EK-Count') > 0){
          $eks = str_replace('character-EK-Count = ', NULL, chop($b));
          $eks = chop($eks); $lines[$a] = 'character-EK-count = 0';
        }
        if(substr_count($b, 'trade-points') > 0){ $pointline = $a; }
        $a++;
        }
        if(!$pointline){ $lines[$eof] = 'trade-points = '.$points.''; }
        else{
          $cpoints = str_replace('trade-points =', NULL, $lines[$pointline]);
          $cpoints = $cpoints + $points;
          $lines[$pointline] = 'trade-points = '.$cpoints.'';
        }
        $lines = chop(implode('', $lines));
        $fo = fopen("$fchar", 'w+');
        fwrite($fo, $lines);
      }
    echo 'Transaction successful! You now have '.$cpoints.' points.';
  }
  elseif($_POST['getitem']){
    $acc = $_POST['acc'];
    $pass = $_POST['pass'];
    $char = $_POST['char'];
    $fl = substr($acc, 0, 1);
    $ascii = ord($fl);
    $filename = $dir . '\\Account\\ASCII' . $ascii . '\\' . $acc . '.txt';
    if(!is_readable($filename)){ echo 'Account does not exist.'; }
    else{
      $lines = file($filename);
      $a=0;
      foreach($lines as $a){
        $a = trim($a);
        if($a == 'account-password = '.$pass.''){ $passflag=TRUE; }
        elseif($a == 'account-character  = '.$char.''){ $charflag=TRUE; }
      }
      if(!$passflag){ echo 'Incorrect password'; }
      if(!$charflag){ echo 'Character does not seem to be on this account!'; }
      else{
        $fl = substr($acc, 0, 1);
        $casc = ord($char);
        $fchar = $dir . '\\Character\\ASCII' . $casc . '\\' . $char . '.txt';
        $lines = file($fchar);
        $a = '0';
        foreach($lines as $b){
          if(substr_count($b, 'trade-points') > 0){ $pointline = $a; }
          if(substr_count($b, 'character-item') >0){ $itemline = $a+1; }
          $a++;
        }
        $trades = file('trades.txt');
        foreach($trades as $b){
          if(substr_count($b, $_POST[item])){ $item = explode(':', $b); }
          $a++;
        }
        $points = str_replace('trade-points =', NULL, $lines[$pointline]);
        if($points >= $item[3]){
          $points = $points - $item[3];
          $lines[$itemline] = "$item[2]

";
          $lines[$pointline] = 'trade-points = '.$points.'';
          $lines = implode('', $lines);
          $fo = fopen($fchar, 'w+');
          fwrite($fo, $lines);
          echo 'Trade successful! You have '.$points.' points remaining.';
        }
        else{ echo 'You do not have enough points for that item. You have '.$points.' points, and you need '.$item[3].' points.'; }
      }
    }
  }
  elseif($_POST['tell']){
    $acc = $_POST['acc'];
    $pass = $_POST['pass'];
    $char = $_POST['char'];
    $fl = substr($acc, 0, 1);
    $ascii = ord($fl);
    $filename = $dir . '\\Account\\ASCII' . $ascii . '\\' . $acc . '.txt';
    $lines = file($filename);
    $a=0;
    foreach($lines as $a){
      $a = trim($a);
      if($a == 'account-password = '.$pass.''){ $passflag=TRUE; }
      elseif($a == 'account-character  = '.$char.''){ $charflag=TRUE; }
    }
    if(!$passflag){ echo 'Incorrect password'; }
    if(!$charflag){ echo 'Character does not seem to be on this account!'; }
    else{
      $fl = substr($acc, 0, 1);
      $casc = ord($char);
      $fchar = $dir . '\\Character\\ASCII' . $casc . '\\' . $char . '.txt';
      $lines = file($fchar);
      $a=0;
      foreach($lines as $b){
        if(substr_count($b, 'trade-points') > 0){ $pointline = $a; }
        $a++;
      }
      $points = str_replace('trade-points =', NULL, $lines[$pointline]);
      echo 'You have '.$points.' points.';
    }
  }
}
?>
of course i was change C:\\Example to my directory but this still writing "you fave points" but not show amount.
bobek
just visiting
Posts: 9
Joined: Tue Mar 09, 2004 3:50 pm

Post by bobek »

lol hb hacking forum and nobody knows that hahaha
No-1
Loyal fan
Posts: 291
Joined: Sun Sep 12, 2004 5:57 am
Location: tdy

Post by No-1 »

bobek wrote: lol hb hacking forum and nobody knows that hahaha
lamer not everyone here is a helper..some in deed need help
Support Outpost@HBTop50<br><a href='http://hbtop50.berserkvision.com/in.php?id=582' target='_blank'>Outpost@HBTop50</a><br>
Raptile
Member
Posts: 145
Joined: Fri May 07, 2004 4:31 pm

Post by Raptile »

---------------Edit this----------------*/
$dir = 'C:\\Example';
/*-------------Edit this----------------*/
you must edit this and i think ball trade dont work with 3.51 files or 3.2 files just with 2.20 and lower versions
bobek
just visiting
Posts: 9
Joined: Tue Mar 09, 2004 3:50 pm

Post by bobek »

No-1 wrote:
bobek wrote: lol hb hacking forum and nobody knows that hahaha
lamer not everyone here is a helper..some in deed need help
yea and so... ? forum if for helping and discussing you "lamer". And not all crackers must know php language.


Raptile>> Yes what i say i edited this but still is problem. I fear you have right with the serever version ;/
Raptile
Member
Posts: 145
Joined: Fri May 07, 2004 4:31 pm

Post by Raptile »

;) see

>>> owned+1
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

bobek wrote:
No-1 wrote:
bobek wrote: lol hb hacking forum and nobody knows that hahaha
lamer not everyone here is a helper..some in deed need help
yea and so... ? forum if for helping and discussing you "lamer". And not all crackers must know php language.


Raptile>> Yes what i say i edited this but still is problem. I fear you have right with the serever version ;/
so do you know ?
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
Post Reply