Switch default userscript order for inmods and outmods

This commit is contained in:
Gnome Ann 2021-12-11 16:27:16 -05:00
parent e289a0d360
commit 1111408cc2
1 changed files with 5 additions and 6 deletions

View File

@ -8,9 +8,10 @@ kobold, koboldcore = require("bridge")() -- This line is optional and is only f
local corescript = {} local corescript = {}
-- Run all the input modifiers from top to bottom -- Run all the input modifiers from bottom to top
function corescript.inmod() function corescript.inmod()
for i, userscript in ipairs(koboldcore.userscripts) do for i = #koboldcore.userscripts, 1, -1 do
local userscript = koboldcore.userscripts[i]
if userscript.inmod ~= nil then if userscript.inmod ~= nil then
userscript.inmod() userscript.inmod()
end end
@ -26,11 +27,9 @@ function corescript.genmod()
end end
end end
-- Run all the generation modifiers from bottom to top -- Run all the generation modifiers from top to bottom
function corescript.outmod() function corescript.outmod()
local userscript for i, userscript in ipairs(koboldcore.userscripts) do
for i = #koboldcore.userscripts, 1, -1 do
userscript = koboldcore.userscripts[i]
if userscript.outmod ~= nil then if userscript.outmod ~= nil then
userscript.outmod() userscript.outmod()
end end