Search Functions
Functions related to searching the transfer market.clickBuscar()
Clicks the search button in the transfer market.No parameters required
None
XPath: /html/body/main/section/section/div[2]/div/div[2]/div/div[2]/button[2]
Usage:
clickEncontrado()
Clicks the first found element if it exists and initiates purchase.No parameters required
None
Behavior:
- Checks if elements exist in search results
- Extracts price from first element
- Calls
comprar()function automatically
/html/body/main/section/section/div[2]/div/div/section[1]/div/ul/li/div
buscarRango()
Automatically searches for optimal price range based on market availability.Uses global variables:
final, maximo, inicial, iEsperadaNone
Algorithm:
- Starts with current sale price (
final.get()) - Searches for items at that price
- If no items found, increases price incrementally:
- < 1000: +50 coins
- < 10000: +100 coins
- < 50000: +500 coins
- ≥ 50000: +500 coins
- If too many items (>4), decreases price
- When optimal range found (≤4 items), calculates:
- Buy price:
(salePrice * 0.95) - expectedProfit - Updates UI fields
- Sends WhatsApp notification
- Buy price:
revisarPrecio()
Reviews and updates price ranges based on current market conditions.Uses global variables:
final, maximo, inicial, iEsperadaNone
Difference from buscarRango():
- Uses expected profit (
iEsperada) for calculations - Does not send WhatsApp notifications
- Formula:
maxPrice = (salePrice * 0.95) - expectedProfit
Purchase Functions
Functions for buying and listing items.comprar()
Purchases an item and automatically lists it on the market.Uses global variables:
mWhats, iteraciones, inicial, finalNone
Process:
- Captures initial balance
- Clicks buy button
- Confirms purchase in popup
- Waits 5 seconds
- Verifies balance changed (confirms purchase)
- Sends WhatsApp notification with iteration count
- Calls
ponerMercado()anddefinirPrecio() - If balance unchanged, sends “NO SE COMPRO” message
ponerMercado()
Clicks the button to list a purchased item on the market.No parameters required
None
XPath: /html/body/main/section/section/div[2]/div/div/section[2]/div/div/div[2]/div[2]/div[1]/button
definirPrecio()
Sets the initial and final selling prices for a purchased item.Uses global variables:
inicial, finalNone
Process:
- Checks if price input fields exist
- Sets minimum price from
inicialfield - Sets maximum price from
finalfield - Clicks “List on Market” button
- If fields don’t exist, prints “FALSA ALARMA”
Navigation Functions
Functions for navigating the FIFA Web App.clickRegresar()
Returns to the transfer market search screen.No parameters required
None
XPath: /html/body/main/section/section/div[1]/button[1]
irMercadoTransferencias()
Navigates to the transfer market from any screen.No parameters required
None
Process:
- Clicks transfer menu button
- Waits 5 seconds
- Clicks market search option
Inventory Management Functions
Functions for managing sold items and inventory.limpiarvendidos()
Clears sold items from the transfer list and checks balance.No parameters required
None
Process:
- Opens transfer menu
- Navigates to items section
- If sold items exist:
- Sends screenshot via WhatsApp
- Clicks clear button
- Returns to market search
- Sends current balance via WhatsApp
limpiarvendidosBID()
Clears sold items when using bidding mode (no WhatsApp notification).No parameters required
None
Difference from limpiarvendidos():
- Does not send WhatsApp messages
- Does not check balance
- Designed for bidding workflow
WhatsApp Functions
Functions for sending notifications via WhatsApp Web.enviarWhatsapp(mensaje)
Sends a text message to WhatsApp.The message text to send
None
Requirements:
- WhatsApp Web must be open in Chrome on port 9222
eWcheckbox must be enabled (eW=1)- First chat must be the target contact
- Checks if WhatsApp is enabled (
eW.get() == 1) - Clicks first chat in sidebar
- Clicks message input field
- Types message
- Clicks send button
enviarScreenshot()
Captures a screenshot of FIFA Web App and sends it via WhatsApp.No parameters required
None
Requirements:
eSScheckbox must be enabled (eSS=1)- WhatsApp Web must be open
- Saves screenshot as
screenshot.png - Converts to BMP format
- Copies to Windows clipboard
- Calls
enviarImagenWhatsapp()
enviarImagenWhatsapp()
Pastes image from clipboard and sends it via WhatsApp.Requires image in clipboard
None
Process:
- Clicks first chat
- Clicks message input
- Pastes image (Ctrl+V)
- Waits 3 seconds
- Clicks send button
enviarSSControlRemoto()
Sends screenshot for remote control commands (always enabled).Does not check eSS flag
None
Usage: Called by Firebase remote control commands.
Bidding Functions
Functions for automated bidding on players.recorrerBid(objetivos)
Iterates through search results and bids on items below maximum price.Number of target items to bid on (typically 50 - current objectives)
None
Algorithm:
- Calculates bids needed:
50 - objetivos - Loops through 20 items per page
- For each item:
- Checks current bid price
- If price is ”---” (no bids) or <
maximo, bids - Handles “too many bids” error (sleeps 300s)
- Moves to next page
- Stops when target bids reached
clickPujar()
Clicks the bid button on the current item.No parameters required
None
XPath: /html/body/main/section/section/div[2]/div/div/section[2]/div/div/div[2]/div[2]/button[1]
clickSiguiente()
Clicks the next page button in search results.No parameters required
None
XPath: /html/body/main/section/section/div[2]/div/div/section[1]/div/div/button[2]
bidding()
Main bidding loop that automates the entire bidding process.Uses global variables:
nacionalidadEntry, inicial, finalNone
Process:
- Opens transfers menu
- Checks current objective count
- Navigates to market search
- Sets country filter (alternates between countries)
- Searches for items
- Calls
recorrerBid()to place bids - Calls
limpiarvendidosBID()to clear sold items - Calls
borrarcaducos()to remove expired bids - Calls
ponerenVentaBid()to list won items - Waits 300 seconds
- Repeats loop
ponerenVentaBid()
Lists all won bid items on the transfer market.Uses global variables:
inicial, finalNone
Process:
- Counts items in “Won Items” section
- For each item:
- Clicks item
- Clicks “List on Market”
- Sets initial price from
inicial - Sets final price from
final - Confirms listing
- Repeats until no items remain
borrarcaducos()
Removes expired (unsuccessful) bids from objectives.No parameters required
None
Process:
- Opens transfers menu
- Opens objectives section
- If expired bids exist, clicks clear button
- Prints “NO CADUCOS” if none found
Filter Functions
Functions for setting search filters.selecciones()
Applies all search filters from UI inputs.Uses global variables:
ligaClicked, clubEntry, calidadClicked, tipoClicked, posicionClicked, nacionalidadEntryNone
Filters Applied:
League Filter
League Filter
- Opens league dropdown
- Searches for league name (e.g., “Premier League (ING 1)”)
- If “Ninguno”, clears filter
Club Filter
Club Filter
- Opens club dropdown
- Types club name
- If empty string, clears filter
Quality Filter
Quality Filter
- Options: Oro, Plata, Bronce, Especial
- If “Ninguno”, clears filter
Type Filter
Type Filter
- Options: Comunes, Únicos, UCL cards, Icons, etc.
- If “Ninguno”, clears filter
Position Filter
Position Filter
- Options: POR, CAD, LD, DFC, LI, MC, etc.
- If “Ninguno”, clears filter
Nationality Filter
Nationality Filter
- Opens country dropdown
- Searches for country name
- If empty string, clears filter
cambiarPais()
Alternates country filter between Brasil and Argentina.Uses global variable:
nacionalidadEntryNone
Behavior:
- If current = “Brasil”, changes to “Argentina”
- If current = “Argentina”, changes to “Brasil”
- Used by bidding mode to diversify searches
Authentication Functions
Functions for handling login and session management.reLogin()
Automatically re-authenticates when session expires.Hardcoded password: “Warewolf10”
None
Process:
- Sends WhatsApp: “EMPEZARON RELOGIN”
- Clicks session expired button
- Waits 10 seconds
- Clicks login button
- Enters password (clears field first)
- Clicks accept
- Waits 15 seconds
- Navigates to transfer market
- Applies filters with
selecciones() - Reviews price with
revisarPrecio() - Sends screenshot
Price Manipulation Functions
Functions for adjusting search prices.precioMaximoBusqueda()
Sets the maximum search price from UI input.Uses global variable:
maximoNone
Process:
- Clicks max price input field
- Types value from
maximoentry
aumentaMinimoCompraYa()
Increases the minimum “Buy Now” price by one increment.No parameters required
None
XPath: /html/body/main/section/section/div[2]/div/div[2]/div/div[1]/div[2]/div[5]/div[2]/button[2]
disminuyeMinimoCompraYa()
Decreases the minimum “Buy Now” price by 3 increments.No parameters required
None
Behavior: Clicks decrease button 3 times in a loop.
Mas1ClickMaximo()
Increases maximum price by one increment (with delay in fast mode).Checks global variable:
rapidoNone
Delay: 2 seconds if rapido.get() == 1
Menos1ClickMaximo()
Decreases maximum price by one increment (with delay in fast mode).Checks global variable:
rapidoNone
Delay: 2 seconds if rapido.get() == 1
Control Functions
Functions for starting, stopping, and managing the bot.iniciar()
Starts the main bot loop.Uses global variables:
seguir, switch, iteraciones, cuantosNone
Process:
- Displays current balance
- Sets
switch = True - Calls
precioMaximoBusqueda() - Starts run loop in separate thread:
- Increments iteration counter
- Every N iterations (from
numeroRango):- Sends progress via WhatsApp
- Calls
revisarPrecio()
- Every
iteraiterations:- Calls
limpiarvendidos()or waits S seconds
- Calls
- Alternates
aumentaMinimoCompraYa()/disminuyeMinimoCompraYa() - Calls
clickBuscar(),clickEncontrado(),clickRegresar()
- On exception, attempts recovery:
- Calls
irMercadoTransferencias() - Restarts loop
- Calls
switchoff()
Stops the bot gracefully.Sets global variables:
switch, switchBidNone
Behavior:
- Sets
switch = False - Sets
switchBid = False - Bot loop checks these flags and exits
switchon()
Enables the bot switch (does not start bot).Sets global variable:
switchNone
Note: This only sets the flag. Call iniciar() to actually start the bot.
stop()
Stops the bot loop by settingseguir = False.
Sets global variable:
seguirNone
Remote Control Functions
Functions for Firebase-based remote control.stream_handler(message)
Handles Firebase real-time database commands.Firebase message containing command in
message['data']None
Supported Commands:
| Command | Action |
|---|---|
DETENER | Calls switchoff() |
INICIAR | Calls iniciar() |
SCREENSHOT | Calls enviarSSControlRemoto() |
RELOGIN | Calls reLogin() |
After executing each command, the bot resets the command to “OK” to prevent duplicate execution.
close_window()
Cleanup function called when closing the application.No parameters required
None
Process:
- Calls
switchoff()to stop bot - Closes Firebase stream (
my_stream.close()) - Destroys Tkinter window (
root.destroy())
Utility Functions
send_to_clipboard(clip_type, data)
Copies data to Windows clipboard.Clipboard format (e.g.,
win32clipboard.CF_DIB for images)Binary data to copy
None
Process:
- Opens clipboard
- Empties existing content
- Sets new data
- Closes clipboard
detener()
Pauses bot execution when specific WhatsApp message is detected.Monitors WhatsApp for pause message
None
Behavior:
- Checks for specific message in WhatsApp
- Sends “PROCESO DETENIDO” notification
- Enters wait loop (checks every 5 seconds)
- Resumes when message disappears
Global Variables Reference
User Interface Variables
| Variable | Type | Description |
|---|---|---|
maximo | Entry | Maximum buy price |
inicial | Entry | Minimum sell price |
final | Entry | Maximum sell price |
iEsperada | Entry | Expected profit |
iReal | Entry | Real profit |
itera | Entry | Iterations before action (default: 10) |
segundos | Entry | Wait seconds (default: 45) |
numeroRango | Entry | Iterations before price check (default: 31) |
Control Variables
| Variable | Type | Description |
|---|---|---|
seguir | bool | Main loop control |
switch | bool | Bot enabled flag |
switchBid | bool | Bidding mode flag |
iteraciones | int | Current iteration count |
cuantos | int | Counter for range checks |
Mode Variables
| Variable | Type | Description |
|---|---|---|
r | IntVar | Action mode (1=clear sold, 2=wait) |
rapido | IntVar | Speed mode (1=normal, 2=fast) |
eW | IntVar | Enable WhatsApp (1=on, 0=off) |
eSS | IntVar | Enable screenshots (1=on, 0=off) |
eR | IntVar | Enable range search (1=on, 0=off) |
Filter Variables
| Variable | Type | Description |
|---|---|---|
ligaClicked | StringVar | Selected league |
clubEntry | Entry | Club name |
calidadClicked | StringVar | Quality (Oro/Plata/Bronce) |
tipoClicked | StringVar | Card type |
posicionClicked | StringVar | Position |
nacionalidadEntry | Entry | Nationality |
Code Architecture
Threading Model
The bot uses Python’sthreading module to run operations concurrently:
Worker Thread: Bot automation loop
Firebase Thread: Real-time database listener
Error Handling Strategy
- Try-Except Blocks: Wrap critical operations
- Recovery Logic: Attempt to navigate back to transfer market
- WhatsApp Notifications: Alert user on errors with screenshots
- Graceful Degradation: Print error, send notification, continue
Selenium WebDriver Setup
FIFA Web App (Port 9250):Both Chrome instances must be started manually with remote debugging enabled before running the bot.
Best Practices
Setting Optimal Prices
Setting Optimal Prices
Formula:
- Buy Price:
salePrice / 1.07(accounts for 5% EA tax) - Min Sell:
salePrice - increment - Max Sell:
salePrice
- To sell at 10,000 coins
- Buy at: 10,000 / 1.07 = 9,345
- Min sell: 9,500
- Max sell: 10,000
- Profit: (10,000 × 0.95) - 9,345 = 155 coins
Choosing Iteration Counts
Choosing Iteration Counts
- Low iterations (5-10): Clears sold items quickly, good for high-volume trading
- High iterations (20-50): Reduces transfer list checks, better for slow markets
- Range checks (30-50): Monitors price changes without excessive searches
Speed Mode Selection
Speed Mode Selection
- Normal (rapido=1): Full delays, safer, less likely to trigger rate limits
- Fast (rapido=2): Minimal delays, higher throughput, higher ban risk
Filter Optimization
Filter Optimization
- Narrow filters: Reduce competition, higher profit margins
- Broad filters: More opportunities, faster turnover
- Popular items: High volume, low profit per item
- Niche items: Low volume, high profit margins