fire30 / fifa14client Goto Github PK
View Code? Open in Web Editor NEWLibrary that allows you to interact with the Fifa14 Ultimate team webapp programmatically.
Library that allows you to interact with the Fifa14 Ultimate team webapp programmatically.
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.
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
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..
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.
People seem to try this with Python 3 despite it not supporting Python 3. I guess the easiest step is to support Python 3.
When a card is listed in ultimate team the request that is sent has a response of the tradeId of the card that was just listed. It makes sense to return this id in the list_card function.
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.
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))
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
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.
File "C:\Users..\Fifa14Client-master\Fifa14Client\WebAppFunctioner.py", line 64, in search
auction_info = r.json()['auctionInfo']
KeyError: 'auctionInfo'
https://github.com/Fire30/Fifa14Client/blob/master/Fifa14Client/WebAppFunctioner.py#L60
Response code is 200 but response content is invalid.
get number of coins - {"debug":"","string":"Not Fund","reason":"","code":"404"}
search for a player - {"debug":"","string":"Bad Request","reason":"","code":"460"}
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!
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.
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
Item does not get cleared from watchlist. Will come out with fix shortly.
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.
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"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.