01 / DIRECT ANSWER
Run the file once; let the event call it later
FC 26 Live Editor Lua events have two documented families: initialization and Career Mode. A Career callback must take `events_manager`, `event_id` and `event`; `pre__` runs before the original game function and `post__` after it. Use `AddEventHandler` once, identify the new handler through `GetEventHandlers`, prove one tagged `LOGGER:LogInfo` line, then remove that exact ID. A v26.3.6 hotkey is different: it executes the assigned Lua file directly.
It creates a callback and attaches it to one named event.
Day, load, prematch or another Career action supplies the event ID.
Target one handler; do not clear other scripts.
02 / TWO CLOCKS
Execution time is not event time
The registration file and its callback run at different moments. Confusing them causes silent tests, duplicate handlers and hotkeys that only add more listeners.
Imports load and registration code runs once.
AddEventHandler stores a function reference.
The relevant original game function is reached.
The tag, event and phase become evidence.
03 / ORIGINAL REPRODUCIBILITY TOOL
Generate the listener and its exit together
This browser-only desk creates observation scripts from documented API calls. The idempotency wrapper is our derived safeguard: it discovers the handler added by this run, stores its ID in the current Lua global state and removes its own previous ID on re-execution.
EVENT SCRIPT WORKBENCH
Build a tagged observer, keep its exact removal script and prove one football action in the log.
01 / CHOOSE ONE JOB
02 / LOCK THE CONTRACT
- EVENT
- pre__CareerModeEvent
- SIGNATURE
- 3 args
- TRIGGER
- Every CareerModeEvent
- PROOF
- A numbered event and resolved name in the Live Editor log.
High log volume: reproduce one short action, then remove the handler.
-- FC 26 Live Editor event probe
-- Generated locally by fc26liveeditor.com; observation only
require 'imports/career_mode/helpers'
local EVENT_NAME = "pre__CareerModeEvent"
local STATE_KEY = "__FCLG_EVENT_TEST_PROBE_HANDLER_ID"
-- Re-running this file removes its previous handler first.
local previous_id = rawget(_G, STATE_KEY)
if previous_id then
RemoveEventHandler(EVENT_NAME, previous_id)
rawset(_G, STATE_KEY, nil)
end
local known_ids = {}
for _, handler in ipairs(GetEventHandlers(EVENT_NAME)) do
known_ids[handler.id] = true
end
local function on_career_event(events_manager, event_id, event)
LOGGER:LogInfo(string.format(
"[FCLG_EVENT_TEST] Career event %d (%s)",
event_id, GetCMEventNameByID(event_id)
))
end
AddEventHandler(EVENT_NAME, on_career_event)
-- Discover and retain only the ID added by this run.
local attached_id = nil
for _, handler in ipairs(GetEventHandlers(EVENT_NAME)) do
if not known_ids[handler.id] then
attached_id = handler.id
rawset(_G, STATE_KEY, handler.id)
break
end
end
LOGGER:LogInfo(string.format(
"[FCLG_EVENT_TEST] attached %s as handler %s",
EVENT_NAME, tostring(attached_id)
))03 / BUILD THE RUN RECEIPT
SCOPE: the generated probes log only. They do not dereference the event pointer, write the database, touch memory, call HTTP or modify a save.
04 / DOCUMENTED EVENT FAMILIES
Two hooks, different lifecycle ownership
post__LEInitDoneEventLive Editor boundaryRuns after initialization, just before the UI appears. Manual UI execution happens after this moment; public autoload timing is not documented.
pre__CareerModeEventFrequent Career busMany Career actions pass through it. Filter by `ENUM_CM_EVENT_MSG_*` instead of treating every event as the desired trigger.
Callback precedes the original game function.
Callback follows the original game function.
05 / CALLBACK CONTRACT
Match the original parameter count exactly
The creator makes this a hard rule. Career event data is heterogeneous, so a correct signature still does not authorize guessing what the opaque `event` pointer contains.
events_managerPointer to the FC EventsManager instance.
event_idThe enum value used for a safe equality filter.
eventEvent-specific data; no complete typed layout is published.
function on_career_event(events_manager, event_id, event)
if event_id == ENUM_CM_EVENT_MSG_DAY_PASSED then
LOGGER:LogInfo("[FCLG] DAY_PASSED")
end
end
AddEventHandler("pre__CareerModeEvent", on_career_event)STOP: the Wiki-linked raw `enums.lua` currently returns 404. Current first-party scripts prove several constant names, but no complete browsable enum inventory should be promised from that broken URL.
06 / HANDLER MANAGEMENT
Registration returns nothing; the ID is the receipt
Because `AddEventHandler` has no return value, reproducible cleanup starts by comparing handler IDs before and after registration.
AddEventHandlerevent_name, functionRegisters a callback; returns nothing
GetEventHandlersevent_nameReturns Event[] with name and unique id
RemoveEventHandlerevent_name, event_idRemoves one exact handler ID
ClearEventHandlersForEventevent_nameRemoves every handler on that event—too broad for routine rollback
`ClearEventHandlersForEvent` is documented, but it can erase listeners owned by other scripts.
07 / CURRENT FIRST-PARTY CODE
The repository shows four event policies
These files establish real trigger vocabulary and callback shape. Only the tracker is observation-only; the other three write state and are evidence patterns, not generic starter scripts.
Every Career event
Log ID + GetCMEventNameByID(event_id)track_cm_events.luaDay · prematch · post-load
Reapply user-team valuesauto_max_user_team_form_morale_sharpness.luaDay · prematch · post-load
Resolve PAP ID; set fitness 99auto_max_vpro_fitness.luaSix reset boundaries
Resolve PAP ID; reapply maskspap_all_playstyles.lua08 / VERSION-GATED DIRECT EXECUTION
A hotkey runs a file; it is not a Career event
The v26.3.6 changelog confirms an option to assign a Lua script to a hotkey. It does not publish the exact settings path, key-conflict behavior or persistence file, so the first defensible test is a direct one-line logger—not a listener registration.
Current manifest tier with the documented addition.
Do not expect the v26.3.6 hotkey option here.
Manifest maps both current editor versions to this executable.
INFERENCE BOUNDARY: assigning the Workbench hotkey smoke-test file is supported by the changelog claim. The exact UI clicks must be verified in the installed v26.3.6 build because the creator has not published them.
09 / CONTROLLED RUN
One trigger, one tag, one log window
- 01PAIRRecord FC build and LE_VERSION
Hotkeys require v26.3.6; every script still depends on a compatible game pair.
- 02BASELINEPreserve the log start time
Close unrelated experiments and note existing handler counts.
- 03REGISTERExecute the listener once
Keep its generated receipt hash and removal file.
- 04TRIGGERPerform one named football action
Advance one day, load once or enter one prematch.
- 05PROVEFind the exact receipt tag
Record timestamp, event name/ID and callback phase.
- 06REMOVERun the matching removal script
Repeat the trigger once; the tagged line must not return.
10 / THREE DIFFERENT EXITS
Removal, restart and save recovery solve different problems
Stops one callback in the current Lua state.
Use when the stored ID is lost; verify handler counts after restart.
Removing code cannot undo values already written.
ClearEventHandlersForEvent("post__CareerModeEvent")It has no ownership filter and can remove unrelated listeners.
11 / FAILURE MAP
Silence and noise point to different lifecycle faults
Check syntax, import availability and the exact event name.
Confirm the Career context and cross the named event once.
Remove stored IDs or restart; do not keep re-executing blindly.
Confirm v26.3.6 and test a direct logger without event registration.
Log ID/name only; do not dereference an undocumented structure.
Listener removal stops future work; use a recovery save for prior writes.
12 / VIDEO & INTENT AUDIT
Video teaches “execute”; source code teaches lifecycle
Five searches returned 75 slots and 45 unique videos. The relevant results concentrate on loading face/realism scripts; none established current handler IDs, targeted removal or the v26.3.6 hotkey settings contract.
2026 RUSSIAN GUIDE relevant title; captions throttled with HTTP 429.
FC26 REALFACES description confirms F9/open/execute only.
FC25 GUIDE no caption track; cannot control current API claims.
FIFA 21 TRANSCRIPT uses Cheat Engine and was rejected.
Creator API docs and current repository scripts control the technical answer.
13 / FAQ
Lua event questions answered by lifecycle
01What Lua version does FC 26 Live Editor use?+
The current Lua API v2 Wiki identifies Lua 5.4.6 as the embedded scripting language.
02How do I run a Lua file manually?+
The official Lua v2 page says to open Features → Lua Engine and execute the code. Current third-party videos show the same F9/open/execute mental model, but official documentation controls the route.
03What is the difference between pre and post events?+
A pre__ handler runs before the original game function; a post__ handler runs after it. For observation-only logging, choose one phase and record it in the receipt.
04How many arguments must CareerModeEvent callbacks take?+
Three: events_manager, event_id and event. The creator explicitly says callback parameter count must match the original function.
05Does LEInitDoneEvent use the same three arguments?+
No. Its documented original declaration has zero parameters, so the callback shown on this page also takes zero.
06Why does my listener fire twice?+
The API allows multiple handlers. Re-executing a registration file can therefore add another callback; the Workbench stores the newly discovered handler ID and removes its own previous ID before registering again. This idempotency wrapper is this site’s derived safeguard, not creator code.
07Can I remove only my own handler?+
Yes, if you retained its unique ID. Use RemoveEventHandler(event_name, id). Avoid ClearEventHandlersForEvent for ordinary cleanup because it deletes every handler registered to that event.
08Where are Lua logs written?+
The LOGGER Wiki says output appears in the Live Editor console and in the logs folder beside Live Editor. LogDebug also depends on DEBUG log level; the Workbench uses LogInfo for a visible smoke test.
09Can I assign a Lua script to a hotkey?+
Yes in v26.3.6: the official changelog confirms the option. The current public manifest still lists v26.3.5, and the public docs do not publish the exact settings path, so this guide does not invent one.
10Should a hotkey script register an event handler?+
Not for the first smoke test. A hotkey executes the assigned script directly; registering another handler on every key press would create unnecessary listener state. Use the direct LogInfo recipe first.
11Can I use the event pointer without knowing its structure?+
Do not guess. The Wiki says event data differs by event_id and gives only examples, not a complete typed layout. The safe discovery script logs event ID/name without dereferencing the pointer.
12Does removing a listener reverse edits already made by its callback?+
No. Removal stops future callbacks; it does not undo earlier database, resource or memory changes. Restore the before value or load the untouched recovery slot.
14 / EVIDENCE LEDGER
Sources, roles and explicit limits
Creator docs define API behavior; current repository code proves real patterns; the manifest and changelog gate versions. Videos contribute workflow vocabulary only.
Primary contract for the two event families, callback signatures and four handler-management functions.
Primary definition of Event.name and the unique Event.id used for targeted removal.
Lua 5.4.6, Features → Lua Engine execution and global LE_VERSION.
Console/log-folder output and the published log-level methods.
Current minimal pre-event recorder using helpers and GetCMEventNameByID.
Current three-event post-handler and immediate-in-Career pattern.
Current day/prematch/post-load event constants and active PAP identity pattern.
Current six-boundary post-event policy.
v26.3.6 hotkey settings and Lua-script assignment claim.
v26.3.6 member version, v26.3.5 public version and current compatible game pair.
Current HTTP 404 audit: do not promise a browsable complete enum list at this URL.
Current 2026 demand signal; captions returned HTTP 429, so metadata supports no event claim.
Description documents F9 → Features → Lua Engine → open → execute; feature-specific and not event authority.
Relevant title but no caption track; retained as a visual-workflow candidate only.
Normalized transcript targets FIFA 21 Cheat Engine, not FC 26 Live Editor; excluded from procedure.