Example #1
0
        public async void Execute(bool refreshData = true)
        {
            pictureBoxTeam.Image         = null;
            pictureBoxPlayerAvatar.Image = null;
            pictureBoxBuddyPokemon.Image = null;
            labelUserProperty1Value.Text = "";
            labelUserProperty2Value.Text = "";
            labelUserProperty3Value.Text = "";
            labelUserProperty4Value.Text = "";
            labelUserProperty5Value.Text = "";
            labelUserProperty6Value.Text = "";

            await check();

            var client = Logic.Logic.Client;

            if (client.readyToUse != false)
            {
                /*labelUserProperty1Title.Text = "Username:";  TODO: internationalize*/

                if (refreshData)
                {
                    profile = await client.Player.GetPlayer();

                    await Task.Delay(1000); // Pause to simulate human speed.

                    var playerStats = await client.Inventory.GetPlayerStats();

                    stats = playerStats.First();
                }
                updatePlayerImages();
                updatePlayerInfoLabels();
            }
        }
Example #2
0
 private void Execute()
 {
     try {
         var client = Logic.Logic.objClient;
         if (!skipReadyToUse)
         {
             // Wait to client is ready to use
             while (client == null || !client.ReadyToUse)
             {
                 Logger.Debug("Client not ready to use. Waiting 5 seconds to retry");
                 RandomHelper.RandomSleep(5000, 5100);
                 client = Logic.Logic.objClient;
             }
             profile = client.Player.GetPlayer();
             RandomHelper.RandomSleep(1000, 1100); // Pause to simulate human speed.
             Text = "User: "******"[PokemonList-Error] " + e.StackTrace);
         RandomHelper.RandomSleep(1000, 1100);  // Lets the API make a little pause, so we dont get blocked
     }
 }
Example #3
0
        private async void Execute()
        {
            await check();

            try
            {
                var client = Logic.Logic._client;
                if (client.readyToUse != false)
                {
                    profile = await client.Player.GetPlayer();

                    await Task.Delay(1000); // Pause to simulate human speed.

                    Text = "User: "******"[PokemonList-Error] " + e.StackTrace);
                await Task.Delay(1000); // Lets the API make a little pause, so we dont get blocked

                Execute();
            }
        }