donger
10-15-2005, 08:10 PM
Hi,
I'm working on fixing the bisonbison converter so that it works with the new absolute hand history format. Right now, everything is working except you have to reorder the seat numbers numerically before pasting in the hand:
Seat 6 - DAWGNWNUTS69 ($196 in chips)
Seat 7 - JERKSTORE ($181.50 in chips)
Seat 9 - NEOND ($104 in chips)
Seat 5 - STANSFIELD ($49 in chips)
has to become:
Seat 5 - STANSFIELD ($49 in chips)
Seat 6 - DAWGNWNUTS69 ($196 in chips)
Seat 7 - JERKSTORE ($181.50 in chips)
Seat 9 - NEOND ($104 in chips)
in order for the converter to work.
I was wondering if someone could help me write the piece of code to sort this $Players object by the PlayerSeatNumber property?
Here's the relevant code where the object is filled:
<font class="small">Code:</font><hr /><pre>
while ($Message =~ s/Seat (\d+) - (.*?) \(((\$)?\d+(\.\d+)?) in chips\)//)
{
$Players{"$j"}->{"PlayerSeatNumber"} = $1;
$Players{"$j"}->{"PlayerName"} = $2;
$Players{"$j"}->{"PlayerStack"} = $3;
###SORT $Players here so the following code doesn't break
#name the seats, starting at the button
if ($Players{"$j"}->{"PlayerSeatNumber"} == $SeatButton)
{
$Players{"$j"}->{"PlayerTitle"} = "Button";
$Players{"$j"}->{"PlayerTitleDisplay"} = "Button";
}
elsif (($Players{"$j"}->{"PlayerSeatNumber"} > $SeatButton) && ($j <= $PlayerCount))
{
$Players{"$j"}->{"PlayerTitle"} = pop @SeatTitleList;
$Players{"$j"}->{"PlayerTitleDisplay"} = pop @SeatTitleDisplayList;
}
$j++;
}
</pre><hr />
THANKS!
donger
I'm working on fixing the bisonbison converter so that it works with the new absolute hand history format. Right now, everything is working except you have to reorder the seat numbers numerically before pasting in the hand:
Seat 6 - DAWGNWNUTS69 ($196 in chips)
Seat 7 - JERKSTORE ($181.50 in chips)
Seat 9 - NEOND ($104 in chips)
Seat 5 - STANSFIELD ($49 in chips)
has to become:
Seat 5 - STANSFIELD ($49 in chips)
Seat 6 - DAWGNWNUTS69 ($196 in chips)
Seat 7 - JERKSTORE ($181.50 in chips)
Seat 9 - NEOND ($104 in chips)
in order for the converter to work.
I was wondering if someone could help me write the piece of code to sort this $Players object by the PlayerSeatNumber property?
Here's the relevant code where the object is filled:
<font class="small">Code:</font><hr /><pre>
while ($Message =~ s/Seat (\d+) - (.*?) \(((\$)?\d+(\.\d+)?) in chips\)//)
{
$Players{"$j"}->{"PlayerSeatNumber"} = $1;
$Players{"$j"}->{"PlayerName"} = $2;
$Players{"$j"}->{"PlayerStack"} = $3;
###SORT $Players here so the following code doesn't break
#name the seats, starting at the button
if ($Players{"$j"}->{"PlayerSeatNumber"} == $SeatButton)
{
$Players{"$j"}->{"PlayerTitle"} = "Button";
$Players{"$j"}->{"PlayerTitleDisplay"} = "Button";
}
elsif (($Players{"$j"}->{"PlayerSeatNumber"} > $SeatButton) && ($j <= $PlayerCount))
{
$Players{"$j"}->{"PlayerTitle"} = pop @SeatTitleList;
$Players{"$j"}->{"PlayerTitleDisplay"} = pop @SeatTitleDisplayList;
}
$j++;
}
</pre><hr />
THANKS!
donger