在 windows 的命令提示符下 lua 脚本为 运行 时接受输入

Taking inputs while a lua script is running on command prompt on windows

我有这个 IRC 机器人,它允许您在 运行 时为机器人输入命令。机器人在 lua,并使用套接字让机器人接受命令,这里是脚本:

if IRC_RUNNING then error("Can't load that from here") end
print("Line input to IRC bot! ./chan to change who gets message")
local socket = require"socket"
local s = socket.bind("localhost",1337)
s:settimeout(30)
local client = s:accept()
if not client then print("Timeout") return end
print("Connected!")
s:settimeout(0)
client:settimeout(0)
while true do
    local line = io.read("*l")
    if line then
        local r,e = client:send(line.."\n")
        if not r then break end
    end
end

问题出在 windows 的命令提示符中,您无法输入任何内容,而其中有 运行 内容。所以我想知道是否有任何方法仍然能够输入命令。

我让它工作了,结果我有其他代码阻止机器人连接,如果它是 运行 在 windows