GithubHelp home page GithubHelp logo

terkira / fifa-ultimate-team-toolkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trydis/fifa-ultimate-team-toolkit

0.0 1.0 0.0 7.46 MB

FIFA Ultimate Team Toolkit

License: MIT License

C# 100.00%

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

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 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 price ranges
Get daily gift
Get & Solve Captcha
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);

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 price ranges

Gets the EA price range - You can only use this method right after you get tradepile / watchlist items!

var priceRanges = await client.GetPriceRangesAsync(/* List of ItemIds */);

foreach (PriceRange priceRange in priceRanges)
{
    priceRange.MaxPrice = // Maximum BIN
    priceRange.MinPrice = // Minimum Starting BID
}

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);
	}
}

Get & Solve Captcha

Gets Captcha as Base64 encoded image

CaptchaResponse captchaImg = await futClient.GetCaptchaAsync();

Solve Captcha

var CaptchaValidate = await futClient.ValidateCaptchaAsync(/* answer */);

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

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

Watchers

 avatar

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.