Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #144 // Contents of Lua Sandbox

Lua code

1  
assert(api)
2  
3  
print "Sandbox contents:\n"
4  
5  
names = {}
6  
for k, v in api() do
7  
  table.insert(names, k)
8  
end
9  
10  
table.sort(names)
11  
12  
for _, name in ipairs(names) do
13  
  print(name.." ("..type(api(name))..")")
14  
end

Author comment

Prints the global functions available in the sandbox.

(Minus table.*, os.* and so on, but you can iterate over those tables normally.)

Script is provided as both a test and a reference. Click "test run" to see the actual contents of the sandbox.

test run  test run with input  download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

4 comment(s) hidden. show

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 215 [visualize]

Snippet ID: #144
Snippet name: Contents of Lua Sandbox
Eternal ID of this version: #144/1
Text MD5: 6e213b7707e8fd5c169520913497c31e
Author: stefan
Category: system utilities
Type: Lua code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2014-02-01 15:11:13
Source code size: 215 bytes / 14 lines
Pitched / IR pitched: Yes / Yes
Views / Downloads: 1495 / 265
Referenced in: [show references]