HOWTO: Inter-plugin communication
#26
I just realized that you can parse a function as a string and then use the loadstring() function to execute it. for example:
------------------------------------------------
--Plugin 1
local Callback = [[
	return type(500)
]]
Plugin:Call("Example", Callback)


------------------------------------------------
--Plugin 2
function Example(Callback)
	local Function = loadstring(Callback)
	if Function then --If the string is loaded correctly then execute it. Otherwise it\'s a nil value.
		Test = Function()
	end
	print(Test)
end
now Test should be equal to 'number'.

Hmm wait now i'm suddenly unsure if it works..
Reply
Thanks given by:


Messages In This Thread
HOWTO: Inter-plugin communication - by FakeTruth - 10-11-2012, 08:07 AM
RE: HOWTO: Inter-plugin communication - by ThuGie - 10-11-2012, 08:11 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-11-2012, 09:08 PM
RE: HOWTO: Inter-plugin communication - by xoft - 10-11-2012, 11:05 PM
RE: HOWTO: Inter-plugin communication - by ThuGie - 10-12-2012, 12:36 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-12-2012, 04:57 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-23-2013, 05:43 AM
RE: HOWTO: Inter-plugin communication - by xoft - 10-23-2013, 06:33 AM
RE: HOWTO: Inter-plugin communication - by xoft - 11-25-2013, 01:33 AM
RE: HOWTO: Inter-plugin communication - by NiLSPACE - 12-07-2013, 06:42 AM
RE: HOWTO: Inter-plugin communication - by xoft - 12-07-2013, 06:51 AM



Users browsing this thread: 1 Guest(s)