Lobby
This commit is contained in:
1 parent
73a2db8bb8
commit
44cf31ce6b
231 files changed
+3396887
-1109081
No files matched your search
@@ -0,0 +1,13 @@
|
||||
-- (Client) шаг обучения «Прочитай табличку»: у точки появления не срабатывает, у таблички — открывается вид на неё
|
||||
local P = game.Players.LocalPlayer
|
||||
local map = workspace.FishingMap
|
||||
local marker = map:FindFirstChild("GuideBoard")
|
||||
local view = P.PlayerGui:WaitForChild("BoardView", 5)
|
||||
local out = { "шаг обучения: " .. tostring(P:GetAttribute("Tutorial")) }
|
||||
P.Character:PivotTo(CFrame.new(0, 4, 57))
|
||||
task.wait(2)
|
||||
table.insert(out, "у точки появления вид на табличку: " .. tostring(view and view.Enabled))
|
||||
P.Character:PivotTo(CFrame.new(marker.Position + Vector3.new(0, 3, 0)))
|
||||
task.wait(2)
|
||||
table.insert(out, "у таблички вид на табличку: " .. tostring(view and view.Enabled))
|
||||
return table.concat(out, "\n")
|
||||
@@ -0,0 +1,29 @@
|
||||
-- (Client) нажать подсказку каждого портала лобби и посмотреть, куда перенесло (или что ответил сервер)
|
||||
local P = game.Players.LocalPlayer
|
||||
local map = workspace.FishingMap
|
||||
local out = {}
|
||||
for _, id in ipairs({ "World1", "World2", "World3", "World4" }) do
|
||||
local part = map:FindFirstChild("Portal_" .. id)
|
||||
local pp = part and part:FindFirstChildWhichIsA("ProximityPrompt", true)
|
||||
if not pp then
|
||||
table.insert(out, id .. ": нет подсказки")
|
||||
else
|
||||
P.Character:PivotTo(CFrame.new(0, 4, 40))
|
||||
task.wait(1)
|
||||
P.Character:PivotTo(CFrame.new(part.Position.X * 1.6, 4, part.Position.Z * 1.6))
|
||||
task.wait(1)
|
||||
pp:InputHoldBegin()
|
||||
task.wait(0.1)
|
||||
pp:InputHoldEnd()
|
||||
task.wait(4)
|
||||
local pos = P.Character.HumanoidRootPart.Position
|
||||
local toast = ""
|
||||
for _, g in ipairs(P.PlayerGui.FishingUI:GetDescendants()) do
|
||||
if g:IsA("TextLabel") and g.Visible and g.Text:find("🔒") then
|
||||
toast = g.Text
|
||||
end
|
||||
end
|
||||
table.insert(out, ("%s: теперь в (%.0f, %.0f) %s"):format(id, pos.X, pos.Z, toast))
|
||||
end
|
||||
end
|
||||
return table.concat(out, "\n")
|
||||
@@ -0,0 +1,25 @@
|
||||
-- (любой режим) что стоит прямо в FishingMap и Workspace в прямоугольнике X1..X2, Z1..Z2 (правьте числа)
|
||||
local X1, X2, Z1, Z2 = __BOX__
|
||||
local out = {}
|
||||
local function scan(root)
|
||||
for _, c in ipairs(root:GetChildren()) do
|
||||
local p, s
|
||||
if c:IsA("Model") then
|
||||
local cf
|
||||
cf, s = c:GetBoundingBox()
|
||||
p = cf.Position
|
||||
elseif c:IsA("BasePart") then
|
||||
p, s = c.Position, c.Size
|
||||
end
|
||||
if p and p.X >= X1 and p.X <= X2 and p.Z >= Z1 and p.Z <= Z2 and s.Magnitude < 80 then
|
||||
local tags = {}
|
||||
for k, v in pairs(c:GetAttributes()) do
|
||||
table.insert(tags, k .. "=" .. tostring(v):sub(1, 20))
|
||||
end
|
||||
table.insert(out, ("%s %s @(%.1f,%.1f,%.1f) size(%.1f,%.1f,%.1f) %s"):format(c.ClassName, c:GetFullName(), p.X, p.Y, p.Z, s.X, s.Y, s.Z, table.concat(tags, " ")))
|
||||
end
|
||||
end
|
||||
end
|
||||
scan(workspace.FishingMap)
|
||||
scan(workspace)
|
||||
return table.concat(out, "\n")
|
||||
@@ -0,0 +1,33 @@
|
||||
-- (Client) проверка лавки удочек: подсказка открывает магазин, Михалыч стоит за стойкой
|
||||
local P = game.Players.LocalPlayer
|
||||
local map = workspace.FishingMap
|
||||
local shop = map:FindFirstChild("LobbyShop_Rods")
|
||||
if not shop then
|
||||
return "нет LobbyShop_Rods"
|
||||
end
|
||||
local pp = shop:FindFirstChildWhichIsA("ProximityPrompt", true)
|
||||
local part = pp.Parent
|
||||
local toCenter = -Vector3.new(part.Position.X, 0, part.Position.Z).Unit
|
||||
P.Character:PivotTo(CFrame.new(part.Position + toCenter * 6 + Vector3.new(0, 3, 0)))
|
||||
task.wait(0.8)
|
||||
pp:InputHoldBegin()
|
||||
task.wait(0.1)
|
||||
pp:InputHoldEnd()
|
||||
task.wait(1.2)
|
||||
local opened
|
||||
for _, f in ipairs(P.PlayerGui.FishingUI:GetDescendants()) do
|
||||
if f:IsA("TextLabel") and f.Text:find("Магазин Михалыча", 1, true) then
|
||||
local w = f
|
||||
while w and not (w:IsA("Frame") and w.ZIndex == 20) do
|
||||
w = w.Parent
|
||||
end
|
||||
opened = w and w.Visible
|
||||
end
|
||||
end
|
||||
local rig = map:FindFirstChild("Продавец Михалыч")
|
||||
local base = shop:GetPivot()
|
||||
local l = rig and base:PointToObjectSpace(rig:GetPivot().Position)
|
||||
local look = rig and base:VectorToObjectSpace(rig:GetPivot().LookVector)
|
||||
local feet = rig and (rig.HumanoidRootPart.Position.Y - rig.Humanoid.HipHeight - rig.HumanoidRootPart.Size.Y / 2)
|
||||
return ("магазин открылся: %s; Михалыч в лавке (%.1f, %.1f, %.1f), смотрит (%.2f, %.2f), ноги Y=%.2f, пол лавки Y=%.2f"):format(
|
||||
tostring(opened), l.X, l.Y, l.Z, look.X, look.Z, feet, base.Position.Y)
|
||||
@@ -0,0 +1,10 @@
|
||||
// node tools/mcp/exec.js <file.lua> [Edit|Server|Client] — выполнить Luau-файл в Studio через MCP
|
||||
const fs = require('fs'), path = require('path'), os = require('os'), { execFileSync } = require('child_process');
|
||||
const code = fs.readFileSync(process.argv[2], 'utf8').replace(/^/, '');
|
||||
const tmp = path.join(os.tmpdir(), 'fishing-mcp-steps-' + process.pid + '.json');
|
||||
fs.writeFileSync(tmp, JSON.stringify([{ tool: 'execute_luau', args: { datamodel_type: process.argv[3] || 'Edit', code } }]));
|
||||
try {
|
||||
process.stdout.write(execFileSync('node', [path.join(__dirname, 'run.js'), tmp], { encoding: 'utf8', maxBuffer: 1 << 26 }));
|
||||
} finally {
|
||||
fs.unlinkSync(tmp);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Play → выполнить Luau-файл на клиенте (проверка) → вывод консоли → стоп.
|
||||
// node tools/mcp/play-check.js <client-check.lua>
|
||||
const fs = require('fs'), path = require('path'), os = require('os'), { execFileSync } = require('child_process');
|
||||
const code = fs.readFileSync(process.argv[2], 'utf8').replace(/^/, '');
|
||||
const steps = [
|
||||
{ tool: 'start_stop_play', args: { is_start: true }, waitAfter: 20000 },
|
||||
{ tool: 'execute_luau', args: { datamodel_type: 'Client', code } },
|
||||
{ tool: 'get_console_output' },
|
||||
{ tool: 'start_stop_play', args: { is_start: false } },
|
||||
];
|
||||
const tmp = path.join(os.tmpdir(), 'fishing-check-' + process.pid + '.json');
|
||||
fs.writeFileSync(tmp, JSON.stringify(steps));
|
||||
const res = execFileSync('node', [path.join(__dirname, 'run.js'), tmp], { encoding: 'utf8', maxBuffer: 1 << 26 });
|
||||
fs.unlinkSync(tmp);
|
||||
console.log(res.split('\n').filter(l => !/MaterialVariant|TexturePack|LowPolyFlat|not authorized|81504106|203785492/.test(l)).join('\n'));
|
||||
@@ -0,0 +1,34 @@
|
||||
// Предпросмотр модели из .bbmodel в Studio (режим редактирования): ставит копию высоко над картой
|
||||
// (Workspace._ModelPreview), снимает с 4 сторон и убирает. node tools/mcp/preview-model.js <name> <out-prefix>
|
||||
// <name> — файл assets/props/<name>.bbmodel (+ _palette.png). Снимки: <out-prefix>_front/side/back/top.jpg
|
||||
const fs = require('fs'), path = require('path'), os = require('os'), { execFileSync } = require('child_process');
|
||||
const ROOT = path.join(__dirname, '..', '..');
|
||||
const [name, prefix] = process.argv.slice(2);
|
||||
const lua = path.join(ROOT, 'tools', 'lobby-models', name + '.lua');
|
||||
execFileSync('node', [path.join(ROOT, 'tools', 'bbmodel-to-luau.js'), path.join(ROOT, 'assets', 'props', name + '.bbmodel'),
|
||||
path.join(ROOT, 'assets', 'props', name + '_palette.png'), lua, name], { stdio: 'inherit' });
|
||||
const build = `local old = workspace:FindFirstChild("_ModelPreview") if old then old:Destroy() end
|
||||
local build = (function()\n${fs.readFileSync(lua, 'utf8')}\nend)()
|
||||
local m = build(workspace)
|
||||
m.Name = "_ModelPreview"
|
||||
m:PivotTo(CFrame.new(0, 300, 0))
|
||||
local cf, size = m:GetBoundingBox()
|
||||
local unanchored = 0
|
||||
for _, p in ipairs(m:GetDescendants()) do if p:IsA("BasePart") and not p.Anchored then unanchored += 1 end end
|
||||
return ("size %.1f x %.1f x %.1f, деталей %d, незакреплённых %d"):format(size.X, size.Y, size.Z, #m:GetDescendants(), unanchored)`;
|
||||
const C = [0, 307, 0]; // центр модели примерно
|
||||
const at = (dx, dy, dz) => [C[0] + dx, C[1] + dy, C[2] + dz];
|
||||
const views = { front: at(6, 3, -22), side: at(-22, 3, -4), back: at(-5, 4, 22), top: at(0, 26, -10) };
|
||||
const steps = [{ tool: 'execute_luau', args: { datamodel_type: 'Edit', code: build } }];
|
||||
for (const [k, eye] of Object.entries(views)) {
|
||||
steps.push({ tool: 'screen_capture', args: { capture_id: 'Preview_' + k, camera_position: eye, look_at_position: C } });
|
||||
}
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Edit', code: 'workspace._ModelPreview:Destroy() return "removed"' } });
|
||||
const tmp = path.join(os.tmpdir(), 'fishing-preview-' + process.pid + '.json');
|
||||
fs.writeFileSync(tmp, JSON.stringify(steps));
|
||||
const res = execFileSync('node', [path.join(__dirname, 'run.js'), tmp], { encoding: 'utf8', maxBuffer: 1 << 26 });
|
||||
fs.unlinkSync(tmp);
|
||||
const keys = Object.keys(views);
|
||||
let i = 0;
|
||||
for (const m of res.matchAll(/IMAGE (.+\.jpe?g)/g)) fs.renameSync(m[1].trim(), `${prefix}_${keys[i++]}.jpg`);
|
||||
console.log(res.split('\n').filter(l => !l.startsWith('IMAGE')).join('\n'));
|
||||
@@ -0,0 +1,51 @@
|
||||
// Клиент Studio MCP без настройки сессии: node tools/mcp/run.js steps.json
|
||||
// steps: [{ tool, args, waitAfter }]; studio_id подставляется сам (первый подключённый Studio).
|
||||
// Снимки (screen_capture) сохраняются рядом со steps.json как img_<время>.jpeg.
|
||||
const { spawn } = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const stepsFile = process.argv[2];
|
||||
const steps = JSON.parse(fs.readFileSync(stepsFile, 'utf8').replace(/^/, ''));
|
||||
const outDir = path.dirname(path.resolve(stepsFile));
|
||||
const p = spawn('cmd.exe', ['/c', path.join(process.env.LOCALAPPDATA, 'Roblox', 'mcp.bat')], { stdio: ['pipe', 'pipe', 'pipe'] });
|
||||
let buf = '', id = 0;
|
||||
const pending = {};
|
||||
p.stdout.on('data', d => {
|
||||
buf += d.toString('utf8');
|
||||
let i;
|
||||
while ((i = buf.indexOf('\n')) >= 0) {
|
||||
const line = buf.slice(0, i).trim();
|
||||
buf = buf.slice(i + 1);
|
||||
if (!line) continue;
|
||||
try { const m = JSON.parse(line); if (m.id != null && pending[m.id]) { pending[m.id](m); delete pending[m.id]; } } catch (e) {}
|
||||
}
|
||||
});
|
||||
p.stderr.on('data', () => {});
|
||||
const rpc = (method, params) => { const myId = ++id; p.stdin.write(JSON.stringify({ jsonrpc: '2.0', id: myId, method, params }) + '\n'); return new Promise(r => (pending[myId] = r)); };
|
||||
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
||||
const done = code => { try { p.stdin.end(); } catch (e) {} p.kill(); process.exit(code); };
|
||||
(async () => {
|
||||
setTimeout(() => { console.log('TIMEOUT'); done(1); }, 290000);
|
||||
await rpc('initialize', { protocolVersion: '2024-11-05', capabilities: {}, clientInfo: { name: 'fishing-tools', version: '1' } });
|
||||
p.stdin.write(JSON.stringify({ jsonrpc: '2.0', method: 'notifications/initialized' }) + '\n');
|
||||
await sleep(8000);
|
||||
const ls = await rpc('tools/call', { name: 'list_roblox_studios', arguments: {} });
|
||||
let SID;
|
||||
try { SID = JSON.parse(ls.result.content[0].text).studios[0].id; } catch (e) {}
|
||||
if (!SID) { console.log('NO STUDIO CONNECTED: ' + JSON.stringify(ls.result || ls.error)); done(1); return; }
|
||||
for (const s of steps) {
|
||||
const r = await rpc('tools/call', { name: s.tool, arguments: Object.assign({ studio_id: SID }, s.args || {}) });
|
||||
const res = r.result || r.error;
|
||||
const text = res && res.content ? res.content.map(c => {
|
||||
if (c.type === 'image' && c.data) {
|
||||
const f = path.join(outDir, 'img_' + Date.now() + '.' + ((c.mimeType || 'image/jpeg').split('/')[1] || 'jpeg'));
|
||||
fs.writeFileSync(f, Buffer.from(c.data, 'base64'));
|
||||
return 'IMAGE ' + f;
|
||||
}
|
||||
return c.text || '[' + c.type + ']';
|
||||
}).join('\n') : JSON.stringify(res);
|
||||
console.log('=== ' + s.tool + (res && res.isError ? ' (ERROR)' : '') + '\n' + text);
|
||||
if (s.waitAfter) await sleep(s.waitAfter);
|
||||
}
|
||||
done(0);
|
||||
})();
|
||||
@@ -0,0 +1,34 @@
|
||||
// Play → снимки с заданных точек камеры → стоп. node tools/mcp/shots.js <out-prefix> "<eye>|<target>|<fov>" ...
|
||||
// Например: node tools/mcp/shots.js assets/reference/lobby_wide "0,140,0|0,0,1|70" "0,55,95|0,2,0|60"
|
||||
// Персонаж уносится далеко в сторону, чтобы не мешал кадру. Пишет <prefix>_1.jpg, <prefix>_2.jpg, …
|
||||
const fs = require('fs'), path = require('path'), os = require('os'), { execFileSync } = require('child_process');
|
||||
const [prefix, ...views] = process.argv.slice(2);
|
||||
const cam = (eye, target, fov) => `local RunService = game:GetService("RunService")
|
||||
local eye, target = Vector3.new(${eye}), Vector3.new(${target})
|
||||
pcall(function() RunService:UnbindFromRenderStep("ToolShot") end)
|
||||
RunService:BindToRenderStep("ToolShot", Enum.RenderPriority.Last.Value, function()
|
||||
workspace.CurrentCamera.CFrame = CFrame.lookAt(eye, target)
|
||||
workspace.CurrentCamera.FieldOfView = ${fov || 60}
|
||||
end)
|
||||
return "cam"`;
|
||||
const steps = [
|
||||
{ tool: 'start_stop_play', args: { is_start: true }, waitAfter: 20000 },
|
||||
{ tool: 'execute_luau', args: { datamodel_type: 'Server', code: 'local c = game.Players:GetPlayers()[1].Character c:PivotTo(CFrame.new(0, 3, 2000)) c.HumanoidRootPart.Anchored = true return 1' }, waitAfter: 1500 },
|
||||
];
|
||||
for (const v of views) {
|
||||
const [eye, target, fov] = v.split('|');
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Client', code: cam(eye, target, fov) }, waitAfter: 3000 });
|
||||
steps.push({ tool: 'screen_capture', args: { capture_id: 'Shot' } });
|
||||
}
|
||||
steps.push({ tool: 'get_console_output' }, { tool: 'start_stop_play', args: { is_start: false } });
|
||||
const tmp = path.join(os.tmpdir(), 'fishing-shots-' + process.pid + '.json');
|
||||
fs.writeFileSync(tmp, JSON.stringify(steps));
|
||||
const res = execFileSync('node', [path.join(__dirname, 'run.js'), tmp], { encoding: 'utf8', maxBuffer: 1 << 26 });
|
||||
fs.unlinkSync(tmp);
|
||||
let n = 0;
|
||||
for (const m of res.matchAll(/IMAGE (.+\.jpe?g)/g)) {
|
||||
n += 1;
|
||||
fs.renameSync(m[1].trim(), `${prefix}_${n}.jpg`);
|
||||
}
|
||||
console.log(res.split('\n').filter(l => !/^IMAGE|MaterialVariant|TexturePack|LowPolyFlat|not authorized|81504106|203785492/.test(l)).join('\n'));
|
||||
console.log(`saved ${n} shots as ${prefix}_N.jpg`);
|
||||
Reference in new issue
Block a user