Toribash
Original Post
[REQ] Improving Lua
I have been thinking about this for a while, and I think it would be great to have the ability to:
  • Read from /toribash/
    • Allowing Lua to io.open from anywhere in the toribash directory, but only for reading files would lead to great advances in scripts.
    • Perhaps even the ability to save in the /data/ directory, generate mods and shaders and such.
  • List Files ( list_directory(dir) )
    • Allowing you to list all the files in a given directory (limited to /toribash or /data) would help achieve some of the ideas in my mind
  • Measure Strings ( measure_string(text,font )
    • A function that returned the height and width of a string would allow for things such as custom chat boxes with emotes and such.
    • Also would allow for proper input boxes
  • Server Side Script ( /runscript x.lua )
    • A command which would make the server run a script would make for great new gameplay elements.
  • Kick, Ban and Say.
    • Unblock kick, ban and say from the run_cmd command.
    • Make certain scripts much better
    • Servers should have anti spam measures anyway (people can easily telnet and spam)...
I'll think of more later :P
:D
I don't think listing the files in a directory is even part of the Lua language spec. Last I checked it was only possible via hacky tricks.
Radioactive torso's description should be, "You have cancer like wow."
Dafe, it's not part of the spec the same way disk IO isn't an absolutely required part of the C runtime. While not included in toribash or the bare lua, there's a pretty typical luamodule, LuaFilesystem that accomplishes this. As normally implemented though, including it may not be such a good idea.
Last edited by kainstake; Jan 7, 2009 at 03:44 AM. Reason: clarify
[isuck] -- have a multiplayer self-dm open? Then you're in! PM me and I'll make a list.