Yet Another Lua Bot

lua-users home
wiki

Yalb is a (yet another) bot that runs Lua code in a sandbox. It resides in #lua and its prefix character is %

Unlike other bots, it can execute more than one version of Lua: everything from 3.2 to 5.3 and even LuaJit.

Interface

Sandbox

The sandbox prints whatever has been returned from the code, but unlike BatBot, it doesn't insert a return automatically.

There is a function called pp which is used for pretty-printing. It doesn't perform a deep inspection of tables, but displays identical tables/functions/userdata accordingly.

The sandbox doesn't remove any functions, but a lot of them are rendered useless, e. g. os.execute returns -1 no matter what, because creating a new process is prohibited.

Execution time is capped at 3 seconds, memory is limited to roughly 45 megabytes.

You are allowed to read files in a few specific locations like /dev/ or /usr/include/. Other filesystem access, including any kind of write access is forbidden.

Yes, it does take PMs.

Source: The backend is some ptrace mess, [but here it is, anyway]. The front-end is a 80-line Lua script which was hacked together in 15 minutes.

Author: mniip


RecentChanges · preferences
edit · history
Last edited May 5, 2014 5:50 pm GMT (diff)