2021-12-11 01:45:57 +01:00
|
|
|
-- Default core script
|
|
|
|
-- Runs all input modifiers and generation modifiers in forward order, and
|
|
|
|
-- runs all output modifiers in reverse order
|
|
|
|
|
|
|
|
kobold, koboldcore = require("bridge")() -- This line is optional and is only for EmmyLua type annotations
|
|
|
|
|
|
|
|
---@class KoboldCoreScript
|
|
|
|
local corescript = {}
|
|
|
|
|
|
|
|
|
2021-12-11 22:27:16 +01:00
|
|
|
-- Run all the input modifiers from bottom to top
|
2021-12-11 01:45:57 +01:00
|
|
|
function corescript.inmod()
|
2021-12-11 22:27:16 +01:00
|
|
|
for i = #koboldcore.userscripts, 1, -1 do
|
|
|
|
local userscript = koboldcore.userscripts[i]
|
2021-12-13 17:50:10 +01:00
|
|
|
userscript.inmod()
|
2021-12-11 01:45:57 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- Run all the generation modifiers from top to bottom
|
|
|
|
function corescript.genmod()
|
|
|
|
for i, userscript in ipairs(koboldcore.userscripts) do
|
2021-12-13 17:50:10 +01:00
|
|
|
userscript.genmod()
|
2021-12-11 01:45:57 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-12-11 22:27:16 +01:00
|
|
|
-- Run all the generation modifiers from top to bottom
|
2021-12-11 01:45:57 +01:00
|
|
|
function corescript.outmod()
|
2021-12-11 22:27:16 +01:00
|
|
|
for i, userscript in ipairs(koboldcore.userscripts) do
|
2021-12-13 17:50:10 +01:00
|
|
|
userscript.outmod()
|
2021-12-11 01:45:57 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return corescript
|