Originally Posted by
laboblox
can i have a list of all the lua/toribash objects and events?
You can find a list of all hook names in startup.lua:
local events = {
"new_game",
"new_mp_game", --Called when you join a new server
"enter_frame",
"end_game",
"leave_game",
"enter_freeze",
"exit_freeze",
"match_begin",
"key_up",
"key_down",
"mouse_button_up",
"mouse_button_down",
"mouse_move",
"player_select",
"joint_select",
"body_select",
"draw2d",
"draw3d",
"play", --Part of torishop.
"camera",
"console",
"bout_mouse_down",
"bout_mouse_up",
"bout_mouse_over",
"bout_mouse_outside",
"spec_mouse_down",
"spec_mouse_up",
"spec_mouse_over",
"spec_mouse_outside",
"command", --Called when an unused /command is entered.
"unload",
}
You can look into /data/script/sdk/ for little examples of most of the functions.
You can also create a list yourself. Every global variable is stored in a table called _G that maps the variables name to its value. To generate a ordered list from that you can use this little script:
local names = {}
local types = {}
local function find(tab, val)
for k, v in pairs(tab) do
if v == val then
return k
end
end
return -1
end
for k, v in pairs(_G) do
names[type(v)] = names[type(v)] or {}
table.insert(names[type(v)], k)
if(find(types, type(v)) == -1) then
table.insert(types, type(v))
end
end
table.sort(types)
local out = assert(io.open("_G.txt", "w"))
for _, t in pairs(types) do
out:write(t .. "s:\n")
table.sort(names[t])
for __, n in pairs(names[t]) do
out:write(n .. "\n")
end
out:write("\n")
end
out:close()
echo("done")
It writes the result to a file called "_G.txt".
This of course only gives you a name without any documentation but with a bit of searching in the sdk folder, a bit of googling or some experimenting you will find out what most of them do.
Also, some functions are deprecated and don't do anything.