0

I'm new to Lua and only picked it up after I found out you can use Lua to add scripts to the game Zoo Tycoon 2. However, Zoo Tycoon 2 uses Lua version 5.0.2 and I haven't managed to get LuaRocks to work with Lua 5.0.

I tried it with LuaSocket for Lua 5.1, but it didn't work and I don't know what went wrong, as I don't know when my script throws exceptions because the game doesn't give me feedback other than what my script was supposed to do not happening. I've tried logging to a console window or a file, but that didn't work either, but that might be something for another question.

I've looked at How to HTTP POST in Lua without using Lua Socket but I couldn't find documentation on the tcpConnect(), tcpSend() and tcpClose() functions used there and I don't know where those come from or if they are compatible with Lua 5.0.

I think it's probably the best for me to have as little dependencies as possible. So, I was wondering, how do you send a HTTP POST request in Lua 5.0?

Apodemus
  • 579
  • 2
  • 19
  • Can you run `os.execute("curl")`? – lhf May 05 '21 at 14:48
  • I'll give it a try later. I have come with bad tidings though, it appears that the Zoo Tycoon 2 devs have removed some methods from standard Lua libraries (explaining why I couldn't write to a file), I expect the restrictions on scripts for this game to be heavy. – Apodemus May 05 '21 at 22:59

0 Answers0