From 4a01f345de93474a612fec0907d4071d0a91362e Mon Sep 17 00:00:00 2001 From: Llama <34464159+pi6am@users.noreply.github.com> Date: Wed, 12 Oct 2022 23:18:19 -0700 Subject: [PATCH] Add include_anote kwarg to lua_compute_context. Add an optional keyword argument to lua_compute_context to control whether the author's note should be included in the context. The default value is true, so if the include_anote kwarg is not specified then the author's note will be included, which was the default behavior prior to this change. Also update the Lua API documentation to describe this kwarg. --- aiserver.py | 2 ++ userscripts/api_documentation.html | 3 +++ userscripts/api_documentation.md | 3 +++ 3 files changed, 8 insertions(+) diff --git a/aiserver.py b/aiserver.py index 771f1430..4091c61a 100644 --- a/aiserver.py +++ b/aiserver.py @@ -3046,6 +3046,8 @@ def lua_compute_context(submission, entries, folders, kwargs): force_use_txt=True, scan_story=kwargs["scan_story"] if kwargs["scan_story"] != None else True, ) + if kwargs["include_anote"] is not None and not kwargs["include_anote"]: + anotetxt = "" txt, _, _ = calcsubmitbudget( len(actions), winfo, diff --git a/userscripts/api_documentation.html b/userscripts/api_documentation.html index b581eb5f..462216c8 100644 --- a/userscripts/api_documentation.html +++ b/userscripts/api_documentation.html @@ -500,6 +500,7 @@
table<string, any>
): Table of optional keyword arguments from the following list. Defaults to {}
.
boolean
): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to false
, only the submission
is scanned for world info keys. Defaults to true
.boolean
): Whether to include the author's note in the story. Defaults to true
, pass false
to suppress including the author's note.table<string, any>
): Table of optional keyword arguments from the following list. Defaults to {}
.
boolean
): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to false
, only the submission
is scanned for world info keys. Defaults to true
.boolean
): Whether to include the author's note in the story. Defaults to true
, pass false
to suppress including the author's note.table<string, any>
): Table of optional keyword arguments from the following list. Defaults to {}
.
boolean
): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to false
, only the submission
is scanned for world info keys. Defaults to true
.boolean
): Whether to include the author's note in the story. Defaults to true
, pass false
to suppress including the author's note.