Lua可以“超时"吗? [英] Can Lua 'Timeout"?

查看:255
本文介绍了Lua可以“超时"吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以说我正在运行脚本,并且游戏客户端在脚本完成更新之前会等待脚本完成. Lua可以做一些超时"吗?就像,我可以为更新设置优先级,以便它离开脚本来执行更新,然后说完话又可以回到脚本中的位置吗?

Lets say I am running a script and the game client waits for the script to be finished before it updates. Can Lua do somthing of a 'timeout'? Like, can i set a priority on the update so it leaves the script to do the update and then after words could it go back to where it was in the script?

推荐答案

您还可以设置一个带有合适计数的计数钩子,以使超时并在钩子中中止脚本的执行.

You can also set a count hook with a suitable count for timeout and abort execution of the script in the hook.

这篇关于Lua可以“超时"吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆