futwebapp-tampermonkey icon indicating copy to clipboard operation
futwebapp-tampermonkey copied to clipboard

SBC features

Open jhuriez opened this issue 4 years ago • 20 comments

Hi, i've added SBC features module on this userscript

Basic :

  • "Enable SBC Features" in the configuration page

  • On all SBC page, you have now a link to see the challenge on Futbin : image

FUTBIN SBC feature :

On a SBC page, just click on the button "Use Futbin SBC" and paste the link of the sbc

image

This will pre-fill the team for the challenge. If you don't have the player in your club, it will add him as a concept player.

image

SBC Gold Upgrade Auto-fill

On the SBC Gold Upgrade page, just click on the button "Auto-fill"

This will allow you to fill your team by taking into account these conditions:

  • Exclude players from your team
  • Sort by ascending rating
  • First search for untradeable players at the precise position
  • If nothing, look for untradeable players at nearby positions (example for RB: RWB, CB, LB, LWB, RM)
  • If nothing, search for tradeable players at the precise position
  • If nothing, search for players tradeable at nearby positions

This feature needs to be improved:

  • Improvement of relevance
  • Check the futbin price of the player before adding it (futbin price max)
  • Have a maximum rating parameter of the player

jhuriez avatar Oct 09 '20 15:10 jhuriez

Very nice! Add me as a reviewer once you are ready with this PR.

Mardaneus86 avatar Oct 09 '20 18:10 Mardaneus86

I invited you on my repo, I don't know if what I did is good, I don't know much about the pull request system on github. ^^

jhuriez avatar Oct 09 '20 18:10 jhuriez

Inviting me isn't necessary, there should be a "request review" option at the top right of this PR.

Anyway, if this PR is ready for review I'll try to check it tomorrow and will try to add it to the next release if it looks good!

Mardaneus86 avatar Oct 09 '20 18:10 Mardaneus86

ok thanks!

I just need to make some improvements on the auto-fill on SBC Gold Upgrade feature, but otherwise everything is functional, the PR is ready. I tried to do my best to respect the "ESLINT", being a native PHP developer it wasn't very easy. ;-)

jhuriez avatar Oct 09 '20 19:10 jhuriez

I don't know why, but i can't add reviewer... image

jhuriez avatar Oct 09 '20 19:10 jhuriez

Need a little more time to review properly. Looks good so far!

Mardaneus86 avatar Oct 10 '20 15:10 Mardaneus86

i tried it and nice work @jhuriez !.

I noticed the following when compiling it in settings-entry.js:

  ✖   1:42  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖   2:51  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖   3:1   Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖   4:41  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖   5:1   Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖   6:49  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖   7:30  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖   8:18  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖   9:50  Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖  10:4   Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style
  ✖  11:2   Expected linebreaks to be 'CRLF' but found 'LF'  linebreak-style

✖ 11 errors (8:16:29 PM)

i think that if you rmeove the first two lines:

/* eslint-disable no-restricted-syntax */
/* eslint linebreak-style: ["error", "windows"] */

those errors will be gone

eimarfandino avatar Oct 10 '20 18:10 eimarfandino

i was wondering, all those requests to the EA server when solving a SBC, does it look suspicious? can they cause a banning?

eimarfandino avatar Oct 10 '20 18:10 eimarfandino

I also noticed the following, when you resolve vi this method, and refresh the browser, the solution does not persist

eimarfandino avatar Oct 10 '20 18:10 eimarfandino

ah,that is the trick, after applying the solution, it is missing a call to the squad endpoint of EA, something like .... game/fifa21/sbs/challenge/52/squad. You can do manually that call by swapping players of position and put them back to the original solution

eimarfandino avatar Oct 10 '20 18:10 eimarfandino

Yes, for the error "Expected linebreaks to be 'CRLF' but found 'LF'", i think it's because i'm on a Windows environment.


Oops you're right, I forgot to specify this problem with SBC that doesn't save, you just have to change the position of a player of the team for it to save.

I hadn't yet found a solution to that.


I don't think it's risky when it's requests to our club, as opposed to requests to the transfer market. Then we can eventually increase the time between each request.

jhuriez avatar Oct 11 '20 15:10 jhuriez

@jhuriez if you do a call to the /squad endpoint, will save the squad

eimarfandino avatar Oct 11 '20 21:10 eimarfandino

How can i add this feature? I do not understand much about these things :(

cnbrkc avatar Oct 17 '20 20:10 cnbrkc

I have added auto save challenge, thanks @eimarfandino

--

I have also removed eslint rules for windows on settings-entry.js I'm on Windows development, i must add this line in .eslintrc (but i don't commit/push) :
"linebreak-style": ["error", "windows"]

jhuriez avatar Oct 19 '20 08:10 jhuriez

this feature seems to be nice

@eimarfandino : when do you think it will be merged to main project ?

seifamou avatar Nov 20 '20 11:11 seifamou

When I'm sure the necessary support can be given. I can't support the current plugin on my own as it is already. So hoping to get someone to volunteer on helping out on bugfixing.

Also I don't have access to the web app anymore since I didn't buy the game (not playing it anymore because of time constraints). Donations don't even come close for buying the game.

Mardaneus86 avatar Nov 20 '20 12:11 Mardaneus86

You don't need the game to login as such, just need someone with the game to log in once 👍

Bendecks avatar Nov 20 '20 12:11 Bendecks

how can i compile the project into one single js file to test it with tempermonkey ?

i can do testing and come beck with feedbak

edit: i have generated the one file using "npm run build" but all javascript code was inside eval() function

seifamou avatar Nov 20 '20 12:11 seifamou

send me your account and unlock (PS4). How decript compile.js ?

totti240282 avatar Nov 20 '20 14:11 totti240282

I guess you don't intend to add such nice features? Isn't there someone who will understand these works and publish them himself? I wish I could understand ... @Mardaneus86

cnbrkc avatar Feb 21 '21 11:02 cnbrkc