Coder Social home page Coder Social logo

fifa14client's Introduction

Fifa14Client

Fifa14Client is a python library that allows you to interact with the Fifa 14 Ultimate Web App programmatically.

Features

  • Logging in
  • Getting Coin Amount
  • Searching
  • Buying
  • Listing for auction
  • Quick Selling
  • Getting Tradepile,Unassigned pile, and Watchlist
  • Moving bewteen piles
  • Removing from watchlist
  • Removing from tradepile
  • Getting Squads
  • Getting items in the club

Prerequisites

Example Usage

You can find an example of usage in the main.py, but anyways:

from Fifa14Client import LoginManager
from Fifa14Client import WebAppFunctioner
import ConfigParser
from extra import EAHash


def do_main():
    Config = ConfigParser.ConfigParser()
    Config.read("accounts_example.ini")
    for section in Config.sections():
        email = Config.get(section, 'Email')
        password = Config.get(section, 'Password')
        secret_answer = Config.get(section, 'Secret')
        security_hash = EAHash.EAHashingAlgorithm().EAHash(secret_answer)
        platform = Config.get(section, 'Platform')

        login = LoginManager.LoginManager(email,password,security_hash,platform)
        login.login()
        func = WebAppFunctioner.WebAppFunctioner(login)
        print(func.get_coin_amount())



if __name__ == "__main__":
    do_main()

License

The MIT License (MIT)

Copyright (c) 2013 T.J.Corley

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

fifa14client's People

Contributors

fire30 avatar krkaiser avatar

Stargazers

 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

fifa14client's Issues

Have automatically updating variables

I think it would be a good idea to have items such as the tradepile,coins,etc to automatically update instead of having to call methods that send requests to ea servers which are honestly not needed.

Best way to check player prices?

I was wondering what would be the most efficient method of finding the price to buy and sell a player automatically. I thought of going through every page and then getting the buy now price lowest price and multiplying that by some buy and sell percentages but I was curious to know how you or anyone else does it.

I would greatly appreciate if you could provide any snippets of code to help, thanks!

Python 3 Support

People seem to try this with Python 3 despite it not supporting Python 3. I guess the easiest step is to support Python 3.

AttributeError

Sorry, I am very new to python and I am currently teaching myself and trying to make a Fifa 14 auto-buyer so naturally I am using your client library killing two birds with one stone, so thank you.

So this is the code I run in main.py, nothing special
I am trying to place a bid on a player that I search for in the market, the search parameter I use I put in the WebAppFunctioner.py file

I get the tradeID '6641625584' by looking in the terminal after print(func.search()) is run

        print(func.get_coin_amount())
        print(func.search())
        func.bid(6641625584, 800)

I get the error

File "/Users/ConnorGrunwald/Desktop/Fifa14Client-master/Fifa14Client/WebAppFunctioner.py", line 97, in bid
the_url = self.BID_URL % (self.platform_string, card.tradeId)
AttributeError: 'int' object has no attribute 'tradeId'

Sorry, I don't really understand attributes at all and google hasn't been much help

FUTErrorCodeException: Could not get complete search.reason: expired session message: None code: 401

After searching for a minute or two I get this:

Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 763, in run
self.__target(_self.__args, *_self.__kwargs)
File "C:\Python27\Fifa14Client-master\thread.py", line 35, in login_thread
search()
File "C:\Python27\Fifa14Client-master\thread.py", line 12, in search
card = func.search(type="player", maxb="1800", definitionId=165239, start=0)
File "C:\Python27\Fifa14Client-master\Fifa14Client\WebAppFunctioner.py", line 94, in search
raise FUTErrorCodeException("Could not get complete search.",json)
FUTErrorCodeException: Could not get complete search.reason: expired session
message: None
code: 401

Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 763, in run
self.__target(_self.__args, *_self.__kwargs)
File "C:\Python27\Fifa14Client-master\thread.py", line 35, in login_thread
search()
File "C:\Python27\Fifa14Client-master\thread.py", line 12, in search
card = func.search(type="player", maxb="1800", definitionId=165239, start=0)
File "C:\Python27\Fifa14Client-master\Fifa14Client\WebAppFunctioner.py", line 94, in search
raise FUTErrorCodeException("Could not get complete search.",json)
FUTErrorCodeException: Could not get complete search.reason: expired session
message: None
code: 401

At first I thought it was the RPS limit but when I search I use time.sleep(0.5) and it still comes up, not really sure what the problem is

Another thing I'd like to ask is when searching for multiple players in a list, should it be like this?

card = func.search(type="player", maxb=xxxx", definitionId=_, start=0)
card = func.search(type="player", maxb=xxxx", definitionId=_
_, start=0)
card = func.search(type="player", maxb=xxxx", definitionId=
__, start=0)
card = func.search(type="player", maxb=xxxx", definitionId=
_**, start=0)
for item in card:
print ('Found player for %s' % card[0].buyNowPrice)
print(func.bid(card[0], card[0].buyNowPrice))

Include more types of requests

There are many more requests that you can make such as getting your current squad and club that I have not included. I might as well include these as someone might have a use for them.

Card should have specified fields.

I am debating whether I should keep the Card object the way it is or change it.

Right now it takes a dict as a parameter and just assigns every key as an instance variable with the corresponding value in the dict.

After thinking about it and taking into consideration pythons mantra of explicit is better than implicit I could also make it assign them from the file.

Cross console support

As of right now the code only works for the Xbox I believe. I need to make it work for both ps3 and pc as well.

Add a utility file

I think that it would make sense to have a utility file that does items that the webapp generally doesn't. This would include things such as like getting a player in the 59th minute. Converting baseId to resourceId, etc..

Add Tests? And What to do for next time.

I haven't really ran a software project before and I have always heard that testing is important, so I might want to implement it. I think this would be good preparation as I will inevitably make this for Fifa15 as well and would want to make it a better maintained project than before.

I think having different branches would be nice as well.

Adding it to pip, and making my library and pip install away also would make it easier to use.

How it work ?

Hi, i search to run this script but i don't know how use a bid function.
Can you help me please? An example?

Thanks

Cannot login - KeyError: "name='sid', domain=None, path=None"

Here's the traceback:

Traceback (most recent call last):
File "file.py", line 62, in
do_main()
File "file.py", line 25, in do_main
login.login()
File "/path/Fifa14Client/LoginManager.py", line 77, in login
tokens = self.get_sid_second_time(next_loc)
File "/path/Fifa14Client/LoginManager.py", line 197, in get_sid_second_time
'sid':r.cookies['sid'],
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/cookies.py", line 276, in getitem
return self._find_no_duplicates(name)
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/cookies.py", line 331, in _find_no_duplicates
raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='sid', domain=None, path=None"

Exceptiions

There are many places, especially in the WebAppFunctioner.py file, where I return true or false. I feel that many of these situation could be handled better with Exceptions.

searching with multiple accounts?

Logging in to more than one account does work, however only the last account that logs in seems to search or bid for a player. If its not too much trouble can you explain how I would use more than one account to search for players?

One more thing I'd like to ask is how I can make a list of players to search from
currently i'm using this to search for one player:

while True:
card = func.search(type="player", maxb="3000", definitionId=165239, start=0)
for item in card:
print(card[0].buyNowPrice)
print(func.bid(card[0], card[0].buyNowPrice))

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.