I should have looked there first..

Posted by Shadowfyr on Thu 13 Jul 2006 06:06 PM — 4 posts, 22,017 views.

USA #0
Then again, I am VB centric, so was trying to find a "universal" solution. But since Lua "is" the default now, in section 3.3.3 of the LuaCOM reference:

-- Creates the COM object
--
calendar = luacom.CreateObject("MSCAL.Calendar")
if calendar == nil then
os.exit(1)
end
-- Creates implementation table
--
calendar_events = {}
function calendar_events:AfterUpdate()
print("Calendar updated!")
end
-- Connects object and table
--
res, cookie = luacom.Connect(calendar, calendar_events)
if res == nil then
exit(1)
end
-- This should trigger the AfterUpdate event
--
calendar:NextMonth()
USA #1
Nick posted about this a while ago:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6022
Searching the forum for "LuaCOM" gives some more results that might be interesting.

And I'm not sure how a VB solution would be any more "universal" (normal, not emphasis, quotation marks) than a Lua solution. :-)
Australia Forum Administrator #2
Does that mean you got the connection points to work?

I agree with Ksilyan that anything that uses Lua and MUSHclient should be as universal as you can get.
USA #3
I wasn't talking about a VB solution, but a solution that would work for "all" of the script systems, most of which don't have direct support for that part of COM. And no, I haven't tried the connection point yet. I haven't dove into Lua at all for my own use yet.

Oh, and more too the point. The prior post by Nick on the subject provided how to "create" objects and use them the same way all the rest of the script systems do. The default assumption when 90% of the engines do not provide '.connect' would normally be, "none of them do". Its a reasonable assumption, given that the main implimentation doesn't support it and most that do, limit it to the "type" of environment its running in. This was a real surprise.