💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
开启进度条: ``` unit Q2; interface uses Classes, SysUtils; procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); implementation procedure Main(Npc: TNormNpc; Player: TPlayObject; Args: TArgs); begin Player.ShowProgress('开启中...'{进度条上显示的信息}, 30{进度条时长30秒}, 1000{进度条标记}, True{移动、攻击或被被攻击的时候取消进度条事件}); //开启进度条 //如果当前存在进度条则返回False //进度条计时结束后调用QFunctionNpc单元中的ProgressEvent函数,其中可根据EventID进行事件处理 end; end. ``` 处理进度条事件: ``` unit QFunctionNpc; interface uses Classes, SysUtils; //用户执行进度条事件触发,只有脚本调用ShowProgress函数且最终执行其事件才会触发本函数 procedure ProgressEvent(Npc: TNormNpc; Player: TPlayObject; EventID: Integer); //用户角度条执行失败触发 procedure ProgressFaild(Npc: TNormNpc; Player: TPlayObject; EventID: Integer); implementation procedure ProgressEvent(Npc: TNormNpc; Player: TPlayObject; EventID: Integer); begin case EventID of 1000: Player.Messagebox('执行进度条事件,事件ID:' + IntToStr(EventID)); end; end; procedure ProgressFaild(Npc: TNormNpc; Player: TPlayObject; EventID: Integer); begin case EventID of 1000: Player.Messagebox('执行进度条事件失败,事件ID:' + IntToStr(EventID)); end; end; end. ```