Porting Java-based mods to Lua
#4
function Initialize(Plugin)
    Plugin:SetName("JavaVM")
    Plugin:SetVersion(1)
     
    -- Hooks
  cPluginManager.AddHook(cPluginManager.HOOK_WORLD_STARTED, function(World)
      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
Reply
Thanks given by: Atro


Messages In This Thread
Porting Java-based mods to Lua - by Atro - 01-13-2015, 01:22 PM
RE: Porting Java-based mods to Lua - by Atro - 01-13-2015, 02:46 PM
RE: Porting Java-based mods to Lua - by Atro - 01-13-2015, 02:59 PM
RE: Porting Java-based mods to Lua - by Howaner - 01-13-2015, 04:14 PM
RE: Porting Java-based mods to Lua - by xoft - 01-13-2015, 05:05 PM
RE: Porting Java-based mods to Lua - by Atro - 01-13-2015, 05:13 PM
RE: Porting Java-based mods to Lua - by xoft - 01-13-2015, 06:14 PM
RE: Porting Java-based mods to Lua - by Defkil - 02-20-2015, 03:03 AM
RE: Porting Java-based mods to Lua - by LO1ZB - 02-20-2015, 03:10 AM
RE: Porting Java-based mods to Lua - by worktycho - 02-20-2015, 03:57 AM



Users browsing this thread: 5 Guest(s)