16 lines
1023 B
JavaScript
16 lines
1023 B
JavaScript
// 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'));
|