-
-
Notifications
You must be signed in to change notification settings - Fork 2
fix: Ability to force the game to start for a benchmark. #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import { createPortal, createRoot } from "@rbxts/react-roblox"; | |
| import { RunService } from "@rbxts/services"; | ||
| import { PluginProvider } from "components"; | ||
| import App from "app"; | ||
| import { VERSION_NUMBER } from "configurations"; | ||
| import { VERSION_NUMBER, PLAYTIME } from "configurations"; | ||
| import { Settings } from "settings"; | ||
|
|
||
| const toolbar = plugin.CreateToolbar(`Scriptbench v${VERSION_NUMBER}`); | ||
|
|
@@ -16,6 +16,19 @@ const toggle = toolbar.CreateButton( | |
| function main() { | ||
| if (RunService.IsRunMode()) return; | ||
|
|
||
| if (PLAYTIME) { | ||
| const suppressed = plugin.GetSetting("Scriptbench_SuppressPlayPrompt", false); | ||
| if (!suppressed) { | ||
| const [accepted, checked] = plugin.PromptGlobalConfirm( | ||
| "Auto-Start Game", | ||
| "Would you like to automatically start the game simulation for benchmarks?", | ||
| "Do not show again" | ||
| ); | ||
|
Comment on lines
+22
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Find project-local declarations or implementations.
rg -n '\bPromptGlobalConfirm\b' . || true
# Inspect installed roblox-ts declarations when dependencies are present.
if [ -d node_modules/@rbxts/types ]; then
rg -n '\bPromptGlobalConfirm\b|\binterface Plugin\b' \
node_modules/@rbxts/types || true
fiRepository: AsynchronousAI/scriptbench Length of output: 252 🏁 Script executed: set -euo pipefail
printf '%s\n' '--- tracked files ---'
git ls-files | sed -n '1,120p'
printf '%s\n' '--- project metadata ---'
for f in package.json tsconfig.json src/index.server.tsx; do
if [ -f "$f" ]; then
printf '\n--- %s ---\n' "$f"
cat -n "$f"
fi
done
printf '%s\n' '--- Plugin API references ---'
rg -n '\bPlugin\b|PromptGlobalConfirm|PLAYTIME|plugin\.' src package.json tsconfig.json 2>/dev/null || trueRepository: AsynchronousAI/scriptbench Length of output: 22539 🏁 Script executed: set -euo pipefail
printf '%s\n' '--- local type declarations ---'
fd -a -t f . | rg '(^|/)(types|.*\.d\.ts)(/|$)' | sed -n '1,160p'
rg -n '\bPromptGlobalConfirm\b|\binterface Plugin\b|\bdeclare (global|const) plugin\b' \
--glob '!bun.lock' --glob '!Scriptbench.rbxm' . || true
printf '%s\n' '--- locked Roblox types version ---'
rg -n -C 3 'node_modules/@rbxts/types|`@rbxts/types`@' bun.lock || true
printf '%s\n' '--- PLAYTIME definition and references ---'
cat -n src/configurations.ts | sed -n '1,70p'
rg -n -C 3 '\bPLAYTIME\b' srcRepository: AsynchronousAI/scriptbench Length of output: 5615 🌐 Web query:
💡 Result: The method Plugin:PromptGlobalConfirm does not exist in the official Roblox Plugin class API [1][2]. There is no built-in, native API provided by the Plugin class for creating generic confirmation dialogs [1][2]. Developers requiring such functionality typically implement custom dialog systems by creating a GUI using a PluginGui (such as a DockWidgetPluginGui) and managing the input events manually [3][4]. While developers often seek native solutions, common practice involves building modular UI components or using community-created libraries to handle confirmation flows, as no standardized, engine-level confirmation-dialog method is exposed for plugins [5][6]. Additionally, PluginGui:BindToClose can be used to intercept the closing of a plugin window, where a custom confirm button can be injected to require user interaction before the window closes [3][4]. Citations:
🏁 Script executed: set -euo pipefail
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSL \
'https://registry.npmjs.org/@rbxts%2ftypes/1.0.880' \
-o "$tmpdir/metadata.json"
tarball="$(jq -r '.dist.tarball' "$tmpdir/metadata.json")"
curl -fsSL "$tarball" -o "$tmpdir/types.tgz"
if tar -tzf "$tmpdir/types.tgz" | grep -qE '(^|/)PromptGlobalConfirm|(^|/)Plugin\.d\.ts'; then
tar -xzf "$tmpdir/types.tgz" -C "$tmpdir"
rg -n '\bPromptGlobalConfirm\b|\binterface Plugin\b' "$tmpdir/package" || true
else
printf '%s\n' 'No matching Plugin declaration file or PromptGlobalConfirm symbol in the package archive.'
fiRepository: AsynchronousAI/scriptbench Length of output: 254 🏁 Script executed: set -euo pipefail
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
curl -fsSL \
'https://registry.npmjs.org/@rbxts%2ftypes/1.0.880' \
-o "$tmpdir/metadata.json"
tarball="$(jq -r '.dist.tarball' "$tmpdir/metadata.json")"
curl -fsSL "$tarball" -o "$tmpdir/types.tgz"
tar -xzf "$tmpdir/types.tgz" -C "$tmpdir"
printf '%s\n' '--- matching declarations ---'
rg -n '\bPromptGlobalConfirm\b|\binterface Plugin\b|\bclass Plugin\b' \
"$tmpdir/package" || true
printf '%s\n' '--- declaration files containing Plugin ---'
find "$tmpdir/package" -type f \( -name '*.d.ts' -o -name '*.d.luau' \) \
-print0 | xargs -0 rg -l '\bPlugin\b' | sed -n '1,80p'Repository: AsynchronousAI/scriptbench Length of output: 985 Replace the unsupported 🤖 Prompt for AI AgentsSource: MCP tools |
||
| if (checked) plugin.SetSetting("Scriptbench_SuppressPlayPrompt", true); | ||
| if (accepted) task.defer(() => RunService.Run()); | ||
|
Comment on lines
+27
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 8 \
'Scriptbench_SuppressPlayPrompt|accepted|checked|RunService\.Run' .Repository: AsynchronousAI/scriptbench Length of output: 6694 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- tracked candidates ---'
git ls-files | rg '(^|/)(src/index\.server\.tsx|.*(test|spec).*\.(ts|tsx|lua|luau)|package\.json|tsconfig.*|README.*)$' | head -200
printf '%s\n' '--- index.server.tsx ---'
cat -n src/index.server.tsx
printf '%s\n' '--- PromptGlobalConfirm and setting API references ---'
rg -n -C 6 'PromptGlobalConfirm|GetSetting|SetSetting|Scriptbench_SuppressPlayPrompt|RunService\.Run' src package.json README.md 2>/dev/null || true
printf '%s\n' '--- package scripts ---'
if [ -f package.json ]; then
node -e 'const p=require("./package.json"); console.log(JSON.stringify(p.scripts||{}, null, 2))'
fiRepository: AsynchronousAI/scriptbench Length of output: 14240 🌐 Web query:
💡 Result: There is no native method named PromptGlobalConfirm in the Roblox Plugin API. It is likely you are either referring to a custom-implemented UI module or are encountering a misunderstanding regarding available Studio plugin dialogs [1][2][3]. Because there is no native "PromptGlobalConfirm" method, there is no built-in "do not show again" return value functionality associated with it. If you are using a third-party plugin or custom module that provides a message box or confirmation dialog, you must handle "do not show again" logic manually using standard plugin data storage methods [4][5]. To implement a "do not show again" feature in your own plugin, follow these steps: 1. Use plugin settings to store the user's preference. Roblox plugins provide the:SetSetting and:GetSetting methods specifically for persisting small bits of data, such as user preferences, across sessions [5]. 2. Before displaying your custom dialog or confirmation GUI, check the stored setting using:GetSetting. 3. If the setting indicates the user has chosen not to see the prompt again, skip the display logic. 4. If the user checks a "do not show again" box in your custom UI, save that choice using:SetSetting so it persists for future sessions [4][5]. If you were looking for standard ways to prompt users in Studio, the Plugin object provides methods like PromptForExistingAssetId, but these do not include "do not show again" persistence out of the box [6][3]. For custom interfaces, developers typically create a custom PluginGui (via Plugin:CreateDockWidgetPluginGui) and manage the UI state manually [2][7][8]. Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
def current_startup(suppressed, accepted=None, checked=None):
runs = False
writes = []
if not suppressed:
if checked:
writes.append(("Scriptbench_SuppressPlayPrompt", True))
if accepted:
runs = True
return runs, writes
cases = [
("accepted-and-checked", False, True, True),
("declined-and-checked", False, False, True),
]
for name, suppressed, accepted, checked in cases:
first = current_startup(suppressed, accepted, checked)
second = current_startup(True)
print(name)
print(" first_load:", first)
print(" next_load:", second)
PY
printf '%s\n' '--- test infrastructure and prompt API declarations ---'
git ls-files | rg '(^|/)(.*\.(test|spec)\.(ts|tsx|lua|luau)|.*\.d\.ts$|package\.json)$' | head -200
rg -n 'PromptGlobalConfirm|interface Plugin|declare.*Plugin|GetSetting\(' . --glob '!src/index.server.tsx' --glob '!src/settings.ts' 2>/dev/null || trueRepository: AsynchronousAI/scriptbench Length of output: 3264 Persist and apply the auto-start decision. When 🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
|
|
||
| const widgetInfo = new DockWidgetPluginGuiInfo( | ||
| Enum.InitialDockState.Float, | ||
| false, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: AsynchronousAI/scriptbench
Length of output: 1827
🌐 Web query:
Roblox Plugin GetSetting API signature optional second argument💡 Result:
The Roblox Plugin:GetSetting API does not have an optional second argument [1][2][3]. The official method signature is defined as Plugin:GetSetting(key: string): Variant [1][2]. It accepts only a single string argument representing the key of the setting to retrieve [1][4]. If you need to provide a default value when a setting does not exist, you should handle the nil return value in your Lua code [1][5]. A common pattern is to use the or operator: local value = plugin:GetSetting("MyKey") or defaultValue [5]
Citations:
🏁 Script executed:
Repository: AsynchronousAI/scriptbench
Length of output: 13625
🏁 Script executed:
Repository: AsynchronousAI/scriptbench
Length of output: 313
Call
Plugin:GetSettingwith one argument.Plugin:GetSettingaccepts only the setting key. Use a strict boolean check for the unsetVariantresult.🤖 Prompt for AI Agents
Source: MCP tools