public async Task Bet() { Client = new PrimediceClient(Access); bool last = true; double amount = 1; decimal total = 0; while (true) { if (!last) { amount *= 2; } else { amount = 1; } var bet = await Client.Bets.Create(amount, BetCondition.GreaterThan, 50.49f); if (bet.IsWon) { total++; } last = bet.IsWon; Log("Last is " + last + "; amount: " + amount + "; total: " + total + "; Roll: " + bet.Roll + "; target: " + bet.Target); Thread.Sleep(1800); } }
public async Task CreateAndVerifySimulated() { // Initialize a new, unauthorized client instance for bet simulation var client = new PrimediceClient(); // Change the client seed and the next server seed await client.Bets.ChangeClientSeed("5S7u5PSIEQsimc6XmhK7cMx7U0wWpT"); client.Bets.ChangeSimulatedServerSeed(new ServerSeed("be1961f028ff456db6b2ccdebef5265bc16b21bbc5fbba993abd2ff6767a39ad")); // Apply the change of the next server seed immediately client.Bets.ChangeSimulatedServerSeed(); // Create a new bet, and then verify its most important details var betAmount = 42; var bet = await client.Bets.Create(betAmount, BetCondition.LowerThan, 11); Assert.AreEqual(45.03, bet.Roll, 0.001); Assert.AreEqual(true, bet.IsSimulated); Assert.AreEqual(false, bet.IsWon); Assert.AreEqual(betAmount, bet.Amount); }