MCPcopy Create free account
hub / github.com/The-Powder-Toy/The-Powder-Toy / Autorun

Method Autorun

src/lua/LuaScriptInterface.cpp:216–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216int LuaScriptInterface::Autorun()
217{
218 if (!Platform::FileExists("autorun.lua"))
219 {
220 lua_pushliteral(L, "autorun.lua not found");
221 return 1;
222 }
223 if (luaL_loadfile(L, "autorun.lua") || tpt_lua_pcall(L, 0, 0, 0, eventTraitInterface))
224 {
225 Log(CommandInterface::LogError, LuaGetError());
226 return 1;
227 }
228 Log(CommandInterface::LogWarning, "Loaded autorun.lua");
229 return 0;
230}
231
232void CommandInterface::SetToolIndex(ByteString identifier, std::optional<int> index)
233{

Callers 2

InitMethod · 0.80
TickMethod · 0.80

Calls 3

tpt_lua_pcallFunction · 0.85
LuaGetErrorFunction · 0.85
FileExistsFunction · 0.50

Tested by

no test coverage detected