You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minerkid08 edited this page Aug 20, 2025
·
1 revision
Definition File
By default your editor will not be able to auto complete functions that you have defined.
Open def.lua from the quick start.
In it you should see something like this.
---@classOpmode---@fieldnamestring---@fieldinitfunction?---@fieldstartfunction?---@fieldupdatefunction?---@paramopmodeOpmodefunctionaddOpmode(opmode) end
In here you can define your own functions.
-- define a function with no argumentsfunctionfuncName() end-- define a function that returns a bool ---@returnbooleanfunctionfuncName() end-- define a function that takes a string as a parameter---@paramargstring functionfuncName(arg) end
If you placed your functions inside of a table you can define it like this.
localtable= {};
functiontable.funcName() end
If your function is part of a class you can define it in a similar way
---@classClasslocalClass= {};
functionClass:funcName() end