babalae / bettergi-scripts-list

BetterGI 的脚本仓库,内含BetterGI 的JS脚本、路径追踪、战斗策略、七圣召唤策略。
https://bgi.sh
14 stars 24 forks source link

伐木脚本出错:Reference settings is not defined #61

Closed stiffme closed 12 hours ago

stiffme commented 15 hours ago

[19:49:26.406] [INF] BetterGenshinImpact.Service.ScriptService 配置组 "默认" 加载完成,共1个脚本,开始执行

[19:49:26.407] [INF] BetterGenshinImpact.GameTask.TaskRunner → "任务启动!"

[19:49:26.701] [INF] BetterGenshinImpact.Service.ScriptService

[19:49:26.701] [INF] BetterGenshinImpact.Service.ScriptService → 开始执行JS脚本: "自动伐木-全树种收集计划"

[19:49:26.704] [DBG] BetterGenshinImpact.Service.ScriptService 执行脚本时发生异常 Microsoft.ClearScript.ScriptEngineException: ReferenceError: settings is not defined ---> Microsoft.ClearScript.ScriptEngineException: ReferenceError: settings is not defined at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyNative.ThrowScheduledException() at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyNative.Invoke[T](Func2 func) at Microsoft.ClearScript.V8.SplitProxy.V8ObjectImpl.InvokeMethod(String name, Object[] args) at Microsoft.ClearScript.V8.V8ScriptItem.<>c__DisplayClass10_0.<InvokeMethod>b__0() at Microsoft.ClearScript.ScriptEngine.ScriptInvokeInternal[T](Func1 func) at Microsoft.ClearScript.V8.V8ScriptEngine.<>cDisplayClass137_01.<ScriptInvoke>b__0() at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyManaged.InvokeHostAction(IntPtr pAction) --- Script error details follow --- ReferenceError: settings is not defined at Script [temp]:8:28 -> Object.defineProperty(this,'EngineInternal',{value:(t=>{let e=t=>t.bind();function r(){return new this(...arguments)}let o=t.isHostObjectKey;delete t.isHostObjectKey;let n=t=>!!t&&!0===t[o],c=Promise,i=JSON,a=Symbol(),s=t.toJson;return delete t.toJson,Object.freeze({commandHolder:{},getCommandResult:e(t=>null==t?t:'function'!=typeof t.hasOwnProperty?'Module'===t[Symbol.toStringTag]?'[module]':'[external]':!0===t[o]?t:'function'!=typeof t.toString?'['+typeof t+']':t.toString()),strictEquals:e((t,e)=>t===e),invokeConstructor:e((t,e)=>{if('function'!=typeof t)throw Error('Function expected');return r.apply(t,Array.from(e))}),invokeMethod:e((t,e,r)=>{if('function'!=typeof e)throw Error('Function expected');return e.apply(t,Array.from(r))}),createPromise:e(function(){return new c(...arguments)}),isPromise:e(t=>t instanceof c),isHostObject:e(n),completePromiseWithResult:e((t,e,r)=>{try{e(t())}catch(o){r(o)}}),completePromise:e((t,e,r)=>{try{t(),e()}catch(o){r(o)}}),throwValue:e(t=>{throw t}),getStackTrace:e(()=>{try{throw Error('[stack trace]')}catch(t){return t.stack}}),toIterator:e(function*(t){try{for(;t.ScriptableMoveNext();)yield t.ScriptableCurrent}finally{t.ScriptableDispose()}}),toAsyncIterator:e(async function*(t){try{for(;await t.ScriptableMoveNextAsync();)yield t.ScriptableCurrent}finally{await t.ScriptableDisposeAsync()}}),getIterator:e(t=>t?.[Symbol.iterator]?.()),getAsyncIterator:e(t=>t?.[Symbol.asyncIterator]?.()),checkpoint:e(()=>{let e=t[a];if(e)throw e}),toJson:e((t,e)=>s?i.parse(s(t,e)):e),parseJson:e(t=>i.parse(t)),asyncGenerator:async function*(){}().constructor})})(this)}); at Script [temp]:132:3 --- End of inner exception stack trace --- at Microsoft.ClearScript.V8.SplitProxy.V8SplitProxyNative.Invoke(Action1 action) at Microsoft.ClearScript.V8.SplitProxy.V8ContextProxyImpl.InvokeWithLock(Action action) at Microsoft.ClearScript.V8.V8ScriptEngine.ScriptInvoke[T](Func`1 func) at Microsoft.ClearScript.V8.V8ScriptItem.InvokeMethod(Boolean marshalResult, String name, Object[] args) at Microsoft.ClearScript.V8.V8ScriptItem.InvokeMethod(String name, Object[] args) at Microsoft.ClearScript.V8.V8ScriptEngine.<>c__DisplayClass147_0.b5(Object error) --- End of stack trace from previous location --- at BetterGenshinImpact.Core.Script.Project.ScriptProject.ExecuteAsync(Object context) in D:\HuiPrograming\Projects\CSharp\MiHoYo\BetterGenshinImpact\BetterGenshinImpact\Core\Script\Project\ScriptProject.cs:line 77 at BetterGenshinImpact.Core.Script.Group.ScriptGroupProject.Run() in D:\HuiPrograming\Projects\CSharp\MiHoYo\BetterGenshinImpact\BetterGenshinImpact\Core\Script\Group\ScriptGroupProject.cs:line 133 at BetterGenshinImpact.Service.ScriptService.ExecuteProject(ScriptGroupProject project) in D:\HuiPrograming\Projects\CSharp\MiHoYo\BetterGenshinImpact\BetterGenshinImpact\Service\ScriptService.cs:line 167 at BetterGenshinImpact.Service.ScriptService.<>c__DisplayClass3_0.<b__0>d.MoveNext() in D:\HuiPrograming\Projects\CSharp\MiHoYo\BetterGenshinImpact\BetterGenshinImpact\Service\ScriptService.cs:line 82 --- Script error details follow --- ReferenceError: settings is not defined at Script [temp]:8:28 -> Object.defineProperty(this,'EngineInternal',{value:(t=>{let e=t=>t.bind();function r(){return new this(...arguments)}let o=t.isHostObjectKey;delete t.isHostObjectKey;let n=t=>!!t&&!0===t[o],c=Promise,i=JSON,a=Symbol(),s=t.toJson;return delete t.toJson,Object.freeze({commandHolder:{},getCommandResult:e(t=>null==t?t:'function'!=typeof t.hasOwnProperty?'Module'===t[Symbol.toStringTag]?'[module]':'[external]':!0===t[o]?t:'function'!=typeof t.toString?'['+typeof t+']':t.toString()),strictEquals:e((t,e)=>t===e),invokeConstructor:e((t,e)=>{if('function'!=typeof t)throw Error('Function expected');return r.apply(t,Array.from(e))}),invokeMethod:e((t,e,r)=>{if('function'!=typeof e)throw Error('Function expected');return e.apply(t,Array.from(r))}),createPromise:e(function(){return new c(...arguments)}),isPromise:e(t=>t instanceof c),isHostObject:e(n),completePromiseWithResult:e((t,e,r)=>{try{e(t())}catch(o){r(o)}}),completePromise:e((t,e,r)=>{try{t(),e()}catch(o){r(o)}}),throwValue:e(t=>{throw t}),getStackTrace:e(()=>{try{throw Error('[stack trace]')}catch(t){return t.stack}}),toIterator:e(function(t){try{for(;t.ScriptableMoveNext();)yield t.ScriptableCurrent}finally{t.ScriptableDispose()}}),toAsyncIterator:e(async function(t){try{for(;await t.ScriptableMoveNextAsync();)yield t.ScriptableCurrent}finally{await t.ScriptableDisposeAsync()}}),getIterator:e(t=>t?.[Symbol.iterator]?.()),getAsyncIterator:e(t=>t?.[Symbol.asyncIterator]?.()),checkpoint:e(()=>{let e=t[a];if(e)throw e}),toJson:e((t,e)=>s?i.parse(s(t,e)):e),parseJson:e(t=>i.parse(t)),asyncGenerator:async function*(){}().constructor})})(this)}); at Script [temp]:132:3

[19:49:26.704] [ERR] BetterGenshinImpact.Service.ScriptService 执行脚本时发生异常: "ReferenceError: settings is not defined"

[19:49:26.704] [INF] BetterGenshinImpact.Service.ScriptService → 脚本执行结束: "自动伐木-全树种收集计划", 耗时: 3 毫秒

[19:49:26.704] [INF] BetterGenshinImpact.Service.ScriptService

[19:49:28.709] [INF] BetterGenshinImpact.GameTask.TaskRunner → "任务结束"

[19:49:28.710] [INF] BetterGenshinImpact.Service.ScriptService 配置组 "默认" 执行结束

stiffme commented 14 hours ago

BetterGI 是0.36.1

huiyadanli commented 13 hours ago

你需要把脚本放入调度器,然后右键设置脚本参数后执行

stiffme commented 12 hours ago

好的谢谢啦,果然这样就好了