diff --git a/include/sol/config.hpp b/include/sol/config.hpp index 5fb4f92..2b53041 100644 --- a/include/sol/config.hpp +++ b/include/sol/config.hpp @@ -48,6 +48,8 @@ the build system, or the command line options of your compiler. */ +#include + // end of sol/config.hpp #endif // SOL_SINGLE_CONFIG_HPP diff --git a/lua/boot.lua b/lua/boot.lua index bec2e0a..3a459e6 100644 --- a/lua/boot.lua +++ b/lua/boot.lua @@ -2,8 +2,8 @@ rootpath = "sdmc:/script/" --DO NOT EDIT THIS LINE logpath = rootpath .. "tas-script.log" --Edit this to change the log file's name and/or directory -package.path = rootpath .. "?.lua;" .. package.path --DO NOT EDIT THIS LINE - SetupLog(logpath) --DO NOT EDIT THIS LINE +package.path = rootpath .. "?.lua;" .. package.path --DO NOT EDIT THIS LINE + dofile(rootpath .. "main.lua") --Edit this to change which file is executed after bootup \ No newline at end of file diff --git a/source/lua_hiddbg.cpp b/source/lua_hiddbg.cpp index 7322c87..71814f9 100644 --- a/source/lua_hiddbg.cpp +++ b/source/lua_hiddbg.cpp @@ -24,7 +24,7 @@ Controller lua_hiddbg_AttachController(u32 bodyColor, u32 buttonsColor, u32 grip rc = hiddbgSetHdlsState(controller.handle, &controller.state); if(R_FAILED(rc)) { - throw string_format("Error setting controller state: %#x", rc);; + throw string_format("Error setting controller state: %#x", rc); } return controller; diff --git a/source/main.cpp b/source/main.cpp index 4103c9d..55c37ac 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -124,13 +124,13 @@ void __attribute__((weak)) __appExit(void) smExit(); } -std::string logpath = "sdmc:/test.log"; +std::string filepath = "sdmc:/test.log"; // Outputs to sdmc/test.log void logToSd(std::string message) { std::ofstream ofs; - ofs.open(logpath, std::ofstream::out | std::ofstream::app); + ofs.open(filepath, std::ofstream::out | std::ofstream::app); if(ofs.is_open()) { ofs << message << std::endl; @@ -144,6 +144,8 @@ void logToSd(std::string message) void lua_SetupLog(std::string logpath) { std::ofstream ofs; + + filepath = logpath; ofs.open(logpath, std::ofstream::out | std::ofstream::trunc); ofs.close(); @@ -168,7 +170,7 @@ void registerUtility(sol::state& lua) int main(int argc, char* argv[]) { sol::state lua; - lua.open_libraries(sol::lib::base); + lua.open_libraries(sol::lib::base, sol::lib::package, sol::lib::table); // Register Lua functions registerUtility(lua);