我在我的树莓派上运行了一个基于 python 的网络服务器,它可以在 Roblox 上抓取交易货币汇率。如果你不知道我刚才说了什么,你只需要知道我正在收集在某个网页上发生变化的数字。我想将这些收集到的信息导入我的 Roblox 游戏,以便绘制它(我已经制作了绘图器)。
这是我为导入它所做的:
bux = game.HttpService:GetAsync("http://tcserver.raspctl.com:5000/AvailableRobux.txt")
bux = {bux}
tix = game.HttpService:GetAsync("http://tcserver.raspctl.com:5000/AvailableTickets.txt")
tix = {tix}
这给了我一个 404 响应。如果我从我的计算机(在同一网络上)访问 Web 服务器,它也会给我一个 404 响应。我知道我正确地进行了端口转发,因为以下 lua 行确实有效。
print(game.HttpService:GetAsync("http://tcserver.raspctl.com:5000/AvailableRobux.txt"))
我需要将 robux 和票价存储在表格中。转到带有速率数据的 URL 之一,您会看到它已经针对 Rbx.Lua 表进行了格式化,它只需要花括号。如何将我的数据转换为表格?