diff --git a/plugin_loader.py b/plugin_loader.py index fb3281f..27a020b 100644 --- a/plugin_loader.py +++ b/plugin_loader.py @@ -100,6 +100,8 @@ class PluginLoader(Window): sandbox.print = self.log #self.lua_runtime.globals().print sandbox.math = self.lua_runtime.globals().math sandbox.string = self.lua_runtime.globals().string + sandbox.tostring = self.lua_runtime.globals().tostring + sandbox.tonumber = self.lua_runtime.globals().tonumber sandbox.berry = lua_runtime_stuff setfenv(0, sandbox) diff --git a/plugins/test-plugin/lua/main.lua b/plugins/test-plugin/lua/main.lua index 379d35a..a3696c0 100644 --- a/plugins/test-plugin/lua/main.lua +++ b/plugins/test-plugin/lua/main.lua @@ -1,8 +1,7 @@ local plugin = {} function plugin.init() - berry.ui.notify(tostring(math.random(10))) + berry.ui.notify(tostring(math.random(1,10))) end -return plugin -123 \ No newline at end of file +return plugin \ No newline at end of file