Giter Site home page Giter Site logo

fifa-ultimate-team-toolkit's Introduction

FIFA Ultimate Team Toolkit

NuGet package Build status Join the chat at https://gitter.im/trydis/FIFA-Ultimate-Team-Toolkit

Supported platforms

  • .NET 4.5
  • Windows 8.x
  • Windows Phone 8.1
  • Xamarin.Android
  • Xamarin.iOS
  • Xamarin.Mac
  • ASP.NET Core 1.0

Sample usage

Initialization
Login
Player search
Place bid
Trade status
Item data
Player image
Club image
Nation image
Credits
List auction
Get trade pile
Get watch list
Get Consumables
Add auction to watch list
Get Purchased items
Development search
Training search
Send to trade pile
Send to club
Quick sell
Remove from watch list
Remove from trade pile
Get pile sizes
Relist Tradepile
Get players from club
Get squads from club
Get squad details
Get definitions
Get daily gift
Remove sold items from trade pile
Open a pack

Initialization

var client = new FutClient();

Login

var loginDetails = new LoginDetails("e-mail", "password", "secret answer", Platform.Ps4 /* or any of the other platforms */, AppVersion.WebApp /* or AppVersion.CompanionApp */);
ITwoFactorCodeProvider provider = // initialize an implementation of this interface
var loginResponse = await client.LoginAsync(loginDetails, provider);

Example implementation of ITwoFactorCodeProvider interface

    ...
	ITwoFactorCodeProvider provider = new FutAuth();
    ...
	
    public class FutAuth : ITwoFactorCodeProvider
    {
        public TaskCompletionSource<string> taskResult = new TaskCompletionSource<string>();
        public Task<string> GetTwoFactorCodeAsync(AuthenticationType authType)
        {
            Console.WriteLine($"{ DateTime.Now } Enter OTP ({ authType }):");
            taskResult.SetResult(Console.ReadLine());
            return taskResult.Task;
        }
    }

Player search

All the search parameters are optional. If none are specified, you will get the 1st page of results with no filters applied.

var searchParameters = new PlayerSearchParameters
{
    Page = 1,
    Level = Level.Gold,
    ChemistryStyle = ChemistryStyle.Sniper,
    League = League.BarclaysPremierLeague,
    Nation = Nation.Norway,
    Position = Position.Striker,
    Team = Team.ManchesterUnited
};

var searchResponse = await client.SearchAsync(searchParameters);
foreach (var auctionInfo in searchResponse.AuctionInfo)
{
	// Handle auction data
}

Place bid

Passing the amount explicitly:

var auctionResponse = await client.PlaceBidAsync(auctionInfo, 150);

Place the next valid bid amount:

var auctionResponse = await client.PlaceBidAsync(auctionInfo);

Trade status

Retrieves the trade status of the auctions of interest.

var auctionResponse = await client.GetTradeStatusAsync(
    Auctions // Contains the auctions we're currently watching
    .Where(x => x.AuctionInfo.Expires != -1) // Not expired
    .Select(x => x.AuctionInfo.TradeId));

foreach (var auctionInfo in auctionResponse.AuctionInfo)
{
	// Handle the updated auction data
}

Item data

Contains info such as name, ratings etc.

var item = await client.GetItemAsync(auctionInfo);

Player image

  • Format: PNG
  • Dimensions: 100 x 100 pixels
var imageBytes = await client.GetPlayerImageAsync(auctionInfo);

Club image

  • Format: PNG
  • Dimensions: 256 x 256 pixels
var imageBytes = await client.GetClubImageAsync(auctionInfo);

Nation image

  • Format: PNG
  • Dimensions: 71 x 45 pixels
var imageBytes = await client.GetNationImageAsync(auctionInfo);

Credits

Amount of coins and unopened packs.

var creditsResponse = await client.GetCreditsAsync();

List auction

Lists an auction from a trade pile item.

// Duration = one hour, starting bid = 150 and no buy now price
var auctionDetails = new AuctionDetails(auctionInfo.ItemData.Id);
// Duration = three hours, starting bid = 200 and buy now price = 1000
var auctionDetails = new AuctionDetails(auctionInfo.ItemData.Id, AuctionDuration.ThreeHours, 200, 1000);
var listAuctionResponse = await client.ListAuctionAsync(auctionDetails);

Get trade pile

Gets the items in the trade pile.

var tradePileResponse = await client.GetTradePileAsync();

Get watch list

Retrieves the the watch list.

var watchlistResponse = await client.GetWatchlistAsync();

Get Consumables

Retrieves the consumables of your club

var consumablesResponse = await client.GetConsumablesAsync();

Add auction to watch list

var addAuctionToWatchlistResponse = await client.AddToWatchlistRequestAsync(auctionInfo);

Get purchased items

Items that have been bought or received in gift packs.

var purchasedItemsResponse = await client.GetPurchasedItemsAsync();

Development search

All the search parameters are optional. If none are specified, you will get the 1st page of results with no filters applied.

var searchParameters = new DevelopmentSearchParameters
{
    Page = 1,
    Level = Level.Gold,
    DevelopmentType = DevelopmentType.Healing,
};

var searchResponse = await client.SearchAsync(searchParameters);
foreach (var auctionInfo in searchResponse.AuctionInfo)
{
    // Handle auction data
}

Training search

All the search parameters are optional. If none are specified, you will get the 1st page of results with no filters applied.

 var searchParameters = new TrainingSearchParameters
{
    Page = 1,
    Level = Level.Gold,
    TrainingType = TrainingType.ChemistryStyles,
};

var searchResponse = await client.SearchAsync(searchParameters);
foreach (var auctionInfo in searchResponse.AuctionInfo)
{
    // Handle auction data
}

Send to trade pile

Sends an item to the trade pile (transfer market)

var sendToTradePileResponse = await client.SendItemToTradePileAsync(itemData);

Send to club

Sends an item to your club

var sendToClubResponse = await client.SendItemToClubAsync(itemData);

Quick sell

Quick sell an item at discard value.

var quickSellResponse = await client.QuickSellItemAsync(ItemData.Id);

Remove from watch list

Removes an auction from the watch list.

await client.RemoveFromWatchlistAsync(auctionInfo);

Remove from trade pile

Removes an auction from the trade pile.

await client.RemoveFromTradePileAsync(auctionInfo);

Get pile sizes

Gets the trade pile and watch list sizes.

var pileSizeResponse = await client.GetPileSizeAsync();

Relist Tradepile

Relists all tradepile items as listed before.

await client.ReListAsync();

Get players from club

Gets the players from your 'My Club' section. Note, this will be expanded to include staff and club items.

var clubItems = await client.GetClubItemsAsync();
foreach (var itemData in clubItems.ItemData)
{
    // deal with players
}

Get squads from club

Gets the squads in your club. Note - many of the fields, such as players etc are not populated here and are in the squad details below.

var squadListResponse = await client.GetSquadListAsync();
foreach (var squad in squadListResponse.squad)
{
	string name = squad.squadName;
	// etc.
}

Get squad details

var squadDetailsResponse = await client.GetSquadDetailsAsync(squad.id);
foreach (var squadPlayer in squadDetailsResponse.players)
{
	var itemData = squadPlayer.itemData;
	//read properties of players etc.  
	//Positions seem to be set by index number and depend on formation
}

Get definitions

Gets all player cards (Standard, IF, SIF, TOTW,...) based on their Asset ID

var playerDefinitions = await client.GetDefinitionsAsync(/* AssetId */);

foreach (ItemData itemData in playerDefinitions.ItemData)
{
	// Contains the Definition ID for i.e. a TOTW card, which you can use to search for this specific card
	var definitionId = itemData.ResourceId;
}

Get daily gift

Gets the daily gift from the WebApp if available - This feature is currently not implemented for the Companion App.

var giftsListResponse = await futClient.GetGiftsListAsync();
foreach (var activeMessages in giftsListResponse.ActiveMessage)
{
	await GetGiftAsync(/* GiftId */);
}

var purchasedItemsResponse = await client.GetPurchasedItemsAsync();
if (purchasedItemsResponse.ItemData.Count > 0)
{
	foreach (ItemData item in purchasedItemsResponse.ItemData)
	{
		await client.SendItemToClubAsync(item);
	}
}

Remove sold items from trade pile

Removes all sold items from the trade pile.

await client.RemoveSoldItemsFromTradePileAsync();

Open a pack

Get all available Packs

var storeResponse = await futClient.GetPackDetailsAsync();

Buy pack

// Identify the pack id
uint packId = 0;

foreach (var packDetail in storeResponse.Purchase)
{
    if (packDetail.Coins == 7500)
    {
        packId = packDetail.Id;
    }
}

// Buy Pack
var buyPackResponse = await futClient.BuyPackAsync(new PackDetails(packId));

fifa-ultimate-team-toolkit's People

Contributors

artielange avatar baddoggie avatar bogdangoie avatar carcabot avatar coverj avatar dinduks avatar gapspt avatar gitter-badger avatar gladtbx avatar hfielding avatar kuzuto avatar ldsgomes avatar lorenzh avatar lululuz avatar mortenbock avatar pradella avatar randomhandle avatar stefanoit avatar stevenmcd avatar tringler avatar trydis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fifa-ultimate-team-toolkit's Issues

Exception on login ...

When attempting to login using the code below I get an exception saying "Unable to login" quite often. The console chucks the following errors, any idea what could be causing this?

LOGIN CODE

    public async void Login()
    {
        try
        {
            var loginDetails = new LoginDetails(email.Text, password.Text, secret.Text, Platform.Xbox360);
            var loginResponse = await _client.LoginAsync(loginDetails);
        }
        catch (Exception ex)
        {
            this.errorBox4.Text = ex.Message;
        }
    }

ERRORS

A first chance exception of type 'System.Net.Http.HttpRequestException' occurred in System.Net.Http.dll
A first chance exception of type 'System.Net.Http.HttpRequestException' occurred in mscorlib.dll
A first chance exception of type 'UltimateTeam.Toolkit.Exceptions.FutException' occurred in UltimateTeam.Toolkit.dll
A first chance exception of type 'UltimateTeam.Toolkit.Exceptions.FutException' occurred in mscorlib.dll
A first chance exception of type 'UltimateTeam.Toolkit.Exceptions.FutException' occurred in mscorlib.dll

Sometimes I got this error: A first chance exception of type 'System.IndexOutOfRangeException' occurred in UltimateTeam.Toolkit.dll

I am a c# asp.net developer and just started to creating an auto buyer windows application. The login functionality is working. I try to do some search stuff and show the results in a datagridview. I do very much try and error. But sometimes I got this error:

A first chance exception of type 'System.IndexOutOfRangeException' occurred in UltimateTeam.Toolkit.dll

Additional information: Index was outside the bounds of the array.

I got this error on this piece of code:

var sessionId = Regex.Match(await authResponseMessage.Content.ReadAsStringAsync(), ""sid":"\S+"")
.Value
.Split(new[] { ':' })[1]
.Replace(""", string.Empty);

I have check the value of "authResponseMessage" and it was filled and not null or empty. Is this because I do very much logins because I do try and errors?

this is the value of "authResponseMessage.Content.ReadAsStringAsync()":

Id = 64, Status = RanToCompletion, Method = "{null}", Result = "{"debug":"","string":"Error","reason":"Error retrieving authCode.","code":"500"}"

Get a Players name

Hi guys,

firstly to trydis, thank you very much man. An epic effort to get all this together and to share it :)

now onto the question, how can I get a players name? I was getting their resourceID and using the api at
http://www.fut15players.com/ which doesn't work for me anymore and they are prompting me to buy the database. So I was wondering if there was a way to get it from the toolkit?

From the readme I seen var item = await client.GetItemAsync(auctionInfo); but I could not find a way to extract the name from item.

Thanks for any help :)

Ban hammer

Hi guys,

Just want to be sure that you are aware that EA will be implementing Origin-wide bans if you are caught botting. Even though I am sure most people have used this for convenience in the past, botting this year could have dire consequences ๐Ÿ˜Ÿ

Code: 480, String: Feature Disabled

When I call the "client.SearchAsync (searchParameters)" method, it returns this error:

"Unknown EA error, please report on GitHub - Code: 480, String: Feature Disabled"

It only happens to me?

little help with captsha

newer to the ball game but anyone have a suggest on how to try/catch the CaptchaTriggered. I think i am getting one but not sure.

PD

FrontEnd : Full player image

Hello,

Not really a toolkit issue, but i would like to know if someone know how to create a full player image like we have in the web app (Face, club, rating etc...)

Thanks

Session expired

Hello,

I'm getting "session expired" after a bunch of searches through a few players. Any ideas? Thanks!

Logout

Anybody knows how to logout? I have no luck with this :(

Occasional issues with login

HI, I wonder if you can help me, I am able to login to my account say 3/4 times out of 10 but most of the time I'm getting exception returned saying "Unable to login"

Console shows "A first chance exception of type 'UltimateTeam.Toolkit.Exceptions.FutException' occurred in mscorlib.dll"

Any idea what's causing this?

Thanks

VS 2013

Hey! First of all thanks for an awesome toolkit. I installed VS 2013 Ultimate and getting this message when trying to load the project.

"UltimateTeam.Toolkit (load failed)
The project requires user input."

And in ouput window:

"C:\Users\Nick\Desktop\FIFA-Ultimate-Team-2015-Toolkit-master\UltimateTeam.Toolkit\UltimateTeam.Toolkit.csproj : error : The project file 'UltimateTeam.Toolkit' cannot be opened.

The project is targeting frameworks that are either not installed or are included as part of future updates to Visual Studio. See http://go.microsoft.com/fwlink/?LinkID=287985 for more information."

What's not working?

Please report it here, only made the changes needed to make the login work + the URL's.

"Connected" status?

Hi All,

Isn't exactly an issue but ... Is there anyway to have a "Connected" status using the toolkit? I'm finding that my app is disconnecting and it would be useful to have a label that reflects the current state of my connection to the web client. At the moment I have an if statement around each call saying "if you can get creditresponse, change the label text to Connected / Disconnected" which isn't the best!

Thanks

Login Problems

Guys ,

Sometimes when I'm trying to login, I have one exception..

I thought that if I got this exception I could wait some time and recall my login method, but doing this, I see this:

erro

Do you have any suggestion to avoid this ?

Thanks.

Minimum Price

Guys,

Does anybody know, how to get the minimum buy now price of some item?

Thanks

Newtonsoft.Json.JsonSerializationException

Hi guys when requesting a search I keep getting this message. Any ideas? Thanks!!

Could not find member 'pile' on object of type 'ItemData'. Path 'auctionInfo[0].itemData.pile', line 1, position 541.

A first chance exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in Newtonsoft.Json.dll
A first chance exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in Newtonsoft.Json.dll
A first chance exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in UltimateTeam.Toolkit.dll
A first chance exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in Microsoft.Threading.Tasks.dll
A first chance exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in mscorlib.dll

Mobile login

Hey guys, I've been experimenting with a modified version of LoginRequest.cs in order to login mobile and I'm stuck on the very first step :( I can't get the loginResponseMessage.

image

image

Even though I "return loginResponseMessage" to the caller, it doesn't get assigned and I can't use it...
I know there's a code in ResponseMessage.RequestUri that needs to be passed back to the server and that's why I wanna get to loginResponseMessage

Sorry if this is super noob

Permission denied exception.

Guys,

When the code throw permission denied exception, it means that somebody have bid mine auction faster than me? I'm just asking because even I'm receiving this type of exceptions I'm able to place bids on webapp.

The project file 'UltimateTeam.Toolkit' cannot be opened

Iยดm trying to open the project in Visual Studio 2013 and getting this error:

E:\GitHub\FIFA-Ultimate-Team-2015-Toolkit\UltimateTeam.Toolkit\UltimateTeam.Toolkit.csproj : error : The project file 'UltimateTeam.Toolkit' cannot be opened.

The project is targeting frameworks that are either not installed or are included as part of future updates to Visual Studio. See http://go.microsoft.com/fwlink/?LinkID=287985 for more information.


My version:
Microsoft Visual Studio Ultimate 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Ultimate


Any idea about this?

FutException was caught , Unable to login

I am a c# .net developer and would like to try creating auto buyer windows application. I have a working account and playing fut 15 on ps4. I have used my username, password and secred answer. I still got the error below. What is my issue?

FutException was caught , Unable to login

Here is my code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UltimateTeam.Toolkit;
using UltimateTeam.Toolkit.Exceptions;
using UltimateTeam.Toolkit.Models;
using UltimateTeam.Toolkit.Parameters;

namespace FUT
{
public partial class Form1 : Form
{
FutClient client = new FutClient();
public Form1()
{
InitializeComponent();
}

    private async void button1_Click(object sender, EventArgs e)
    {
        try
        {
            var loginDetails = new LoginDetails(textBoxUsername.Text, textBoxPassword.Text, textBoxSecredAnswer.Text, Platform.Ps4);
            var loginResponse = await client.LoginAsync(loginDetails);
        }
        catch (FutException ex)
        {
            textBoxStatus.Text = ex.Message;
        }
    }



    private void button2_Click(object sender, EventArgs e)
    {
        searchPlayers();
    }

    private async void searchPlayers()
    {
        if (client != null)
        {
            var searchParameters = new PlayerSearchParameters
            {
                Page = 1,
                Level = Level.Gold,
                ChemistryStyle = ChemistryStyle.Sniper,
                League = League.BarclaysPremierLeague,
                Nation = Nation.Norway,
                Position = Position.Striker,
                Team = Team.ManchesterUnited
            };

            var searchResponse = await client.SearchAsync(searchParameters);
            foreach (var auctionInfo in searchResponse.AuctionInfo)
            {
                // Handle auction data
            }
        }
    }
}

}

Calculate previous/next bid

Hello,

I tried to use the calculate previous/next methods but encountered a Problem with the Values. Correct Values should be:

bid < 1000 --> +50
bid > 1000 --> +100
bid > 10.000 --> +250
bid > 50.000 --> +500
bid > 100.000 --> +1000

Hope this is not a duplicate
(I'm new to git)

Making bids after search item

Hi mates, I'm trying to make a bid if some conditions happen:

Gold contract from players
max bid 200

I use this code but i'm not bidding to the filtered data. It bids for items without filtering:

    var searchParameters = new DevelopmentSearchParameters
            {
                Page = page,
                Level = Level.Gold,
                DevelopmentType = DevelopmentType.Contract,     
            };

            var searchResponse = await client.SearchAsync(searchParameters);
            foreach (var auctionInfo in searchResponse.AuctionInfo)
            {
                if ((auctionInfo.ItemData.ResourceId == 1884049195) && (auctionInfo.CurrentBid <= 200)) ;
                {
                    var auctionResponse = await client.PlaceBidAsync(auctionInfo);
                    pujas++;
                    Console.WriteLine("Listo");
                }


            }

Can't use FutClient in new form

So I've been dabbling with this toolkit and am kinda hitting a brick wall. I've made a Login form which opens a new form after logging in. In the new form I can't make any requests, because I can't acces FutClient. Does anybody know how to work around this, or what I'm doing wrong? How would I acces futclient in the new form?

The login code is like this: http://pastebin.com/ai4NFUud

building a db of players

Is anyone willing to help me parse and save this json:

https://www.easports.com/uk/fifa/ultimate-team/api/fut/item?jsonParamObject={%22page%22:1}

into my database table?

Ive created a db, and made a connection too it on my project, as to what to do next im a little lost.

Is anyone willing to share how they do this? I am trying to add to my database firstname, lastname, nickname, resource id and asset id... idk if i'm missing anything else i need?

Thanks for any help!

Craig.

Listing an item from watchlist

Hey guys,,

I have been struggling with this issue, i want to list a player from my watchlist but cant seem to wrap my head around how its done, is there any steps need to be taken before listing from watchlist?

Regards

Help!

Can someone help me with making an autobuyer in visual studio 2013?

Removed the NuGet packages

Since NuGet packages have been removed i can not compile the solution... can someone help me?

PD: I Can compile 2014 toolkit without problem...

NucleusResponesMessage - Index was outside the bounds of the array.

Hello there! 1st please take this with a pinch of salt. Maybe I'm doing something wrong - the solution would not load directly from your DL for me (VS complaining) so I've reimported everything...

Trying to login... loginResponseMessage is fine set to {StatusCode:200, ReasonPhrase: 'OK' etc...

Gets to the GetNucleusIdAsync() method, seems to set this message fine... nucleusResponseMessage gets set to StatusCode 200 etc...

Then on this line (LoginRequest.cs > GetNucleusIdAsync()):

var nucleusId = Regex.Match(await nucleusResponseMessage.Content.ReadAsStringAsync(), "EASW_ID = '\\d+'")
                .Value
                .Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries)[1]
                .Replace("'", string.Empty);

I get the 'Index was outside the bounds of the array.' error. I assume it can't find EASW_ID in the nucleusResponeMessage?

Perhaps I'm just doing something fundamentally stupid. But I figure since its got all the affirmative responses previously StatusCode 200's, I'm doing it right?

Sorry if noob problem.

Best pratices: Managing RPM (Requests per minute)

Hi everyone

I'm trying to improve the accuracy of my AB, I read here that someone suggests to create a mechanism to control RPM. Also, I read that is recommended to keep at most 30 requests per minute to avoid captcha exceptions.

My doubt is: every command that I use with my FUTClient can be considered as a request?

For example, in this loop, everytime I use GetItemAsync count as a request?

var _tradePileResponse = await Globals.FUTClient.GetTradePileAsync(); // count as a request?
foreach (var auctionInfo in _tradePileResponse.AuctionInfo)
{
 var _item = await Globals.FUTClient.GetItemAsync(auctionInfo); // count as a request?
...

Servers down

Servers down or my account is my blocked/banned?

InternalServerException

Hey guys,

maybe it's just a lack of my C# knowledge, but when I got an internal server error I want to relogin, but I'm not able to logoff or dispose the object. Any hint for me?

Thanks a lot!

Get amount of players in a searchresponse

Hello,

I'm making a pricechecker and I want to get the price when 3 or more players are found in a searchresponse. Is there anyway to do this within the toolkit? Now when I get the price of the player, I don't know how many cards were found in the search response.

Getting error from GetWatchlistAsync

Hi guys im getting the error message below while trying to get my watchlist. I've included my code, prior to this is my login which is working as far as I can tell because I have been able to get my coin balance as well as get my pile sizes with GetPileSizeAsync().

Thanks for any help as I'm sure this is something stupid I am doing which I know is not particularly the purpose of this forum..

var watchList = await client.GetWatchlistAsync();
await Task.Delay(randomWaitTime);
foreach (var item in watchList.AuctionInfo)
{
      // more code here
}

image

AB - Ultimate Team Toolkit

Guys,

I know that most of you already have one AB. But I'm almost done with my AB. I'd like to know if I share mine here, if there is anybody interested to contribute and improve more and more.

Search more than 1 page result?

It's not really an issue but how can I can scan more than 1 page of search results?

Passing Page = 1 in my searchParameters, obviously only gives me the first page

I've tried different numbers and even not passing the page parameter but it only ever retrieves 13 results - unless I change PageSize, but I'm guessing this isn't a "natural" action of webapp to process this many results in a single page.

I've tried using a range to no avail .. ie Page =1-30

Any help would be great!

Thanks

Getting session null after successfully login in SetSharedRequestPropertie function

I just started to playing with the toolkit and you guys are doing amazing job (Y)

But i stuck upon some weird issue,

As per the Readme doc, I tried the following code

Get the Login with below code (which give me successfully response),

 var client = new FutClient();
 var loginDetails = new LoginDetails(DomainUserLogin.EmailAddress, DomainUserLogin.Password, DomainUserLogin.SecurityAnswer, DomainUserLogin.PlatformType == 1 ? Platform.Xbox360 : Platform.Ps3);
 var loginResponse = Task.Run(async () => await client.LoginAsync(loginDetails)).Result;

and right after calling the search player api using,

var searchParameters = new PlayerSearchParameters
                {
                    Page = 1,
                    Level = Level.Gold,
                    ChemistryStyle = ChemistryStyle.Sniper,
                    League = League.BarclaysPremierLeague,
                    Nation = Nation.Norway,
                    Position = Position.Striker,
                    Team = Team.ManchesterUnited
                };

                var client = new FutClient();
                var searchResponse = Task.Run(async () => await client.SearchAsync(searchParameters)).Result;

and i getting error in in SetSharedRequestProperties in FutRequestFactories class saying

request.SessionId = SessionId;
request.HttpClient = HttpClient;
request.Resources = _resources;

SessionId is null

so, what i should missed? am i doing wrong here?

Async

Guys,

Are you having problems with your async/await methods ?
I was. After some time executing AB, they were starting to execute at the same time.

Because of this I tried this solution:

public static class AsyncHelpers
{
    /// <summary>
    /// Execute's an async Task<T> method which has a void return value synchronously
    /// </summary>
    /// <param name="task">Task<T> method to execute</param>
    public static void RunSync(Func<Task> task)
    {
        var oldContext = SynchronizationContext.Current;
        var synch = new ExclusiveSynchronizationContext();
        SynchronizationContext.SetSynchronizationContext(synch);
        synch.Post(async _ =>
        {
            try
            {
                await task();
            }
            catch (Exception e)
            {
                synch.InnerException = e;
                throw;
            }
            finally
            {
                synch.EndMessageLoop();
            }
        }, null);
        synch.BeginMessageLoop();

        SynchronizationContext.SetSynchronizationContext(oldContext);
    }

    /// <summary>
    /// Execute's an async Task<T> method which has a T return type synchronously
    /// </summary>
    /// <typeparam name="T">Return Type</typeparam>
    /// <param name="task">Task<T> method to execute</param>
    /// <returns></returns>
    public static T RunSync<T>(Func<Task<T>> task)
    {
        var oldContext = SynchronizationContext.Current;
        var synch = new ExclusiveSynchronizationContext();
        SynchronizationContext.SetSynchronizationContext(synch);
        T ret = default(T);
        synch.Post(async _ =>
        {
            try
            {
                ret = await task();
            }
            catch (Exception e)
            {
                synch.InnerException = e;
                throw;
            }
            finally
            {
                synch.EndMessageLoop();
            }
        }, null);
        synch.BeginMessageLoop();
        SynchronizationContext.SetSynchronizationContext(oldContext);
        return ret;
    }

    private class ExclusiveSynchronizationContext : SynchronizationContext
    {
        private bool done;
        public Exception InnerException { get; set; }
        readonly AutoResetEvent workItemsWaiting = new AutoResetEvent(false);
        readonly Queue<Tuple<SendOrPostCallback, object>> items =
            new Queue<Tuple<SendOrPostCallback, object>>();

        public override void Send(SendOrPostCallback d, object state)
        {
            throw new NotSupportedException("We cannot send to our same thread");
        }

        public override void Post(SendOrPostCallback d, object state)
        {
            lock (items)
            {
                items.Enqueue(Tuple.Create(d, state));
            }
            workItemsWaiting.Set();
        }

        public void EndMessageLoop()
        {
            Post(_ => done = true, null);
        }

        public void BeginMessageLoop()
        {
            while (!done)
            {
                Tuple<SendOrPostCallback, object> task = null;
                lock (items)
                {
                    if (items.Count > 0)
                    {
                        task = items.Dequeue();
                    }
                }
                if (task != null)
                {
                    task.Item1(task.Item2);
                    if (InnerException != null) // the method threw an exeption
                    {
                        throw new AggregateException("AsyncHelpers.Run method threw an exception.", InnerException);
                    }
                }
                else
                {
                    workItemsWaiting.WaitOne();
                }
            }
        }

        public override SynchronizationContext CreateCopy()
        {
            return this;
        }
    }
}

And you call like this:

customerList = AsyncHelpers.RunSync<List<Customer>>(() => GetCustomers());

Any other suggestions ? ๐Ÿ‘

Lost bids.

This night I let my AB on the whole night and I've seen that I have won too few bids, I'm bidding on the cheapest bids at 59', using 3 accounts I've won 5/37 bids on a player, 1/94 bids on other player, and 4/33 bids on another player... Why I've got all this failed bids? I'm checking market every 2-3 seconds on each account and I'm using the code like this:
searchResponse = await client.SearchAsync(searchParameters);
auction = searchResponse.AuctionInfo.First();
await client.PlaceBidAsync(auction, auction.BuyNowPrice);
It usually throws an exception by bidding on auction which doesn't exist, but I've used it for winning some code speed over a foreach bucle, but I'm losing too many bids, and I've got 10ms ping to utas.fut.ea.com. Does anyone had the same issue? It's because of my code? Maybe someone with less ping than I've got? Can be something about the API? Help!

Trading tips?

After a week using the API I would like to ask if someone can give me any tips for trading using the API functions since I'm actually earning like 10k/day using a single account. I don't mean that I want to know which players do you use to trade, I mean something like trading with high priced Silver cards over usual gold cards such as Distin, or if it's better to trade with players with high prices, bronze players, contracts...I repeat that I don't asking for the players that you use to trade, since I know that everybody have their own business, I only want some orientation and tips. Thanks for advanced!:)

Support for Personas?

Can anyone suggest how to switch personas, and then query the tradepile, watchlist etc for the selected persona?

No BaseId for Watchlist items?

When using GetTradeStatusAsync I'm seeing an issue where the AuctionResponse.AuctionInfo objects return 0 for auctionInfo.CalculateBaseId().

I'm trying to use a unique identifier for players, but inconsistency in the context of checking trade status, makes this difficult. Is it recommended to use auctionInfo.ItemData.Id instead?

What is the recommended ID to use for a player that will work in any context?

Thanks

Unwanted cards suddenly selling (not a toolkit issue)

I buy low-value cards and quick sell them. I've noticed today that cards I'd win > 85% of the time in the past are suddenly selling at or above discard price. My win % on these cards has plummeted to below 25%.
Has anyone else noticed this?

Relisting and removing from tradepile

Hey guys,

If im going to relist exsired auctions, how do i edit:

await client.ReListAsync();

To get a new relist price before relisting?

And also, when i try to remove sold items from the tp, do i first have to call the tp list?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.