01-13-2015, 02:59 PM
Further edit of the code:
Produces this error:
Warn [22:58:08] LUA: Plugins/JavaVM/main.lua:8: attempt to call global 'initiatejavavm' (a nil value)
Warn [22:58:08] Stack trace:
Warn [22:58:08] Plugins/JavaVM/main.lua(8): (no name)
Warn [22:58:08] Stack trace end
Warn [22:58:08] Error in plugin JavaVM calling function Initialize()
Warn [22:58:08] Error in plugin JavaVM: Cannot call the Initialize() function. Plugin is temporarily disabled.
Any ideas?
function Initialize(Plugin) Plugin:SetName("JavaVM") Plugin:SetVersion(1) -- Hooks cPluginManager.AddHook(cPluginManager.HOOK_WORLD_STARTED, initiatejavavm()) function initiatejavavm() javavm = require("javavm") javavm.create("-Djava.class.path=jnlua-0.9.6.jar") System = java.require("java.lang.System") System.out:println("Hello, world!") javavm.destroy() return true end PLUGIN = Plugin -- NOTE: only needed if you want OnDisable() to use GetName() or something like that -- Command Bindings LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion()) return true end function OnDisable() LOG(PLUGIN:GetName() .. " is shutting down...") end
Produces this error:
Warn [22:58:08] LUA: Plugins/JavaVM/main.lua:8: attempt to call global 'initiatejavavm' (a nil value)
Warn [22:58:08] Stack trace:
Warn [22:58:08] Plugins/JavaVM/main.lua(8): (no name)
Warn [22:58:08] Stack trace end
Warn [22:58:08] Error in plugin JavaVM calling function Initialize()
Warn [22:58:08] Error in plugin JavaVM: Cannot call the Initialize() function. Plugin is temporarily disabled.
Any ideas?