Skip to content

Commit

Permalink
bug fixes for magialdice
Browse files Browse the repository at this point in the history
  • Loading branch information
Seuntjie900 committed Sep 22, 2015
1 parent f24e0cb commit d9a12b9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 25 deletions.
42 changes: 26 additions & 16 deletions DiceBot/MagicalDice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ void PlaceBetThread(object Bool)
try
{
High = (bool)Bool;
double tmpchance = High ? 99.99 - chance : chance;
//double tmpchance = High ? 99.99 - chance : chance;
List<KeyValuePair<string, string>> pairs = new List<KeyValuePair<string, string>>();
pairs.Add(new KeyValuePair<string, string>("a", "place_bet"));
pairs.Add(new KeyValuePair<string, string>("amount", (amount).ToString(System.Globalization.NumberFormatInfo.InvariantInfo)));
pairs.Add(new KeyValuePair<string, string>("win_chance", tmpchance.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)));
pairs.Add(new KeyValuePair<string, string>("win_chance", chance.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)));
pairs.Add(new KeyValuePair<string, string>("direction", High ? "over" : "under"));
pairs.Add(new KeyValuePair<string, string>("auth_key", authkey));
pairs.Add(new KeyValuePair<string, string>("origin", "manual"));
Expand All @@ -74,19 +74,26 @@ void PlaceBetThread(object Bool)
{

MDBet tmp = json.JsonDeserialize<MDBet>(sEmitResponse);
Bet tmp2 = tmp.ToBet();

balance += (double)tmp2.Profit;
bets++;
if (tmp.bet_win)
wins++;
if (tmp.error == 0)
{
Bet tmp2 = tmp.ToBet();

balance += (double)tmp2.Profit;
bets++;
if (tmp.bet_win)
wins++;
else
losses++;

wagered += (double)(tmp2.Amount);
profit += (double)(tmp2.Profit);
FinishedBet(tmp2);
retrycount = 0;
}
else
losses++;

wagered += (double)(tmp2.Amount);
profit += (double)(tmp2.Profit);
FinishedBet(tmp2);
retrycount = 0;
{
Parent.updateStatus(tmp.msg);
}
}
catch
{
Expand Down Expand Up @@ -562,7 +569,8 @@ public class MDBet
public string bet_chat_display { get; set; }
public bool bet_win { get; set; }
public string bet_id { get; set; }

public int error { get; set; }
public string msg { get; set; }
public Bet ToBet()
{

Expand All @@ -572,11 +580,13 @@ public Bet ToBet()
Id = long.Parse(bet_id),
Profit = (decimal)(bet_profit/100000000.0),
Roll = bet_roll,
Chance = decimal.Parse(bet_game_value, System.Globalization.NumberFormatInfo.InvariantInfo),

high = bet_game_type=="over",
nonce = long.Parse(bet_nonce, System.Globalization.NumberFormatInfo.InvariantInfo),
serverhash = bet_seed_id,
clientseed = bet_key_id};
decimal tchance = decimal.Parse(bet_game_value, System.Globalization.NumberFormatInfo.InvariantInfo);
tmp.Chance = (tmp.high ? 99.99m - tchance : tchance);
return tmp;
}
}
Expand Down
29 changes: 20 additions & 9 deletions DiceBot/cDiceBot.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions DiceBot/cDiceBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5812,5 +5812,10 @@ private void btnDepositAlt_Click(object sender, EventArgs e)
SimpleSwap tmp = new SimpleSwap(ExchangeType.deposit, CurrentSite.Currency, txtApiAddress.Text);
tmp.Show();
}

private void lbVariables_SelectedIndexChanged(object sender, EventArgs e)
{

}
}
}

0 comments on commit d9a12b9

Please sign in to comment.