function fireMonoMethod(className, methodName, args) if type(args) ~= "table" then error("Args is not a table, use {}") end local classId = mono_findClass("", className) if not classId or classId == 0 then error("No class found") end local methodId = mono_class_findMethod(classId, methodName) if not methodId or methodId == 0 then error("No method found") end local instance = mono_class_findInstancesOfClassListOnly(nil, classId)[1] if not instance or instance == 0 then error("No instance found") end local params = mono_method_get_parameters(methodId).parameters if #args ~= #params then error("Found " .. #args .. " args, need " .. #params .. " args") end local newArgs = {} for i, v in pairs(params) do newArgs[i] = { type = monoTypeToVartypeLookup[v.type], value = args[i] } end return mono_invoke_method(nil, methodId, instance, newArgs) end