Merge pull request #45 from VE-FORBRYDERNE/scripting

Fix behaviour of `kobold.outputs` with read-only and no prompt gen
This commit is contained in:
henk717 2021-12-17 19:45:31 +01:00 committed by GitHub
commit 4bb5e59d82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 2 deletions

View File

@ -1908,6 +1908,8 @@ def actionsubmit(data, actionmode=0, force_submit=False):
else:
# Save this first action as the prompt
vars.prompt = data
for i in range(vars.numseqs):
vars.lua_koboldbridge.outputs[i+1] = ""
execute_outmod()
if(vars.lua_koboldbridge.regeneration_required):
vars.lua_koboldbridge.regeneration_required = False
@ -1943,6 +1945,8 @@ def actionsubmit(data, actionmode=0, force_submit=False):
calcsubmit(data)
emit('from_server', {'cmd': 'scrolldown', 'data': ''}, broadcast=True)
else:
for i in range(vars.numseqs):
vars.lua_koboldbridge.outputs[i+1] = ""
execute_outmod()
set_aibusy(0)
if(vars.lua_koboldbridge.regeneration_required):

View File

@ -1671,6 +1671,7 @@ return function(_python, _bridged)
setmetatable(koboldbridge.outputs, nil)
for k, v in old_next, koboldbridge.outputs, nil do
if type(v) ~= "string" then
error("`kobold.outputs` must be a 1D list of strings, but found a non-string element at index " .. k)
return r
end
if v ~= _outputs[k] then

View File

@ -1619,7 +1619,7 @@ $(document).ready(function(){
seqselcontents = $("#seqselcontents");
// Connect to SocketIO server
socket = io.connect(window.document.origin, {transports: ['websocket', 'polling']});
socket = io.connect(window.document.origin, {transports: ['polling', 'websocket']});
socket.on('from_server', function(msg) {
if(msg.cmd == "connected") {

View File

@ -7,7 +7,7 @@
<script src="static/jquery-3.6.0.min.js"></script>
<script src="static/jquery-ui.sortable.min.js"></script>
<script src="static/socket.io.min.js"></script>
<script src="static/application.js?ver=1.16.4g"></script>
<script src="static/application.js?ver=1.16.4h"></script>
<script src="static/bootstrap.min.js"></script>
<script src="static/bootstrap-toggle.min.js"></script>
<script src="static/rangy-core.min.js"></script>