Lua 3rd-Party Libraries Not Loading

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
synthsin75
Posts: 10153
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Lua 3rd-Party Libraries Not Loading

Post by synthsin75 »

Defims wrote: Fri Nov 25, 2022 4:42 am WOW, Moho 11 is nice! I wonder how to pass the color value back to Moho in your color picker dll, Is it some code like:

Code: Select all

lua_pushstring(L, "#000");
Is it possible to call other function? like:

Code: Select all

lua_getglobal(L, "CHANNEL_BONE_3");
It was so long ago, I no longer remember.
I think I lost the source files, but I'll look around.
User avatar
synthsin75
Posts: 10153
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Lua 3rd-Party Libraries Not Loading

Post by synthsin75 »

Defims wrote: Fri Nov 25, 2022 4:42 am WOW, Moho 11 is nice! I wonder how to pass the color value back to Moho in your color picker dll, Is it some code like:

Code: Select all

lua_pushstring(L, "#000");
Is it possible to call other function? like:

Code: Select all

lua_getglobal(L, "CHANNEL_BONE_3");
It used:

Code: Select all

require('pickcolor')
to access the pickcolor.dll, and called:

Code: Select all

s = pickcolor.text()
to get the string the dll copied to the clipboard.

Then it tested if that string contained color info and converted the hex string to a Moho color object.
Defims
Posts: 19
Joined: Sun May 30, 2010 11:34 am
Contact:

Re: Lua 3rd-Party Libraries Not Loading

Post by Defims »

synthsin75 wrote: Sat Nov 26, 2022 7:08 pm
Defims wrote: Fri Nov 25, 2022 4:42 am WOW, Moho 11 is nice! I wonder how to pass the color value back to Moho in your color picker dll, Is it some code like:

Code: Select all

lua_pushstring(L, "#000");
Is it possible to call other function? like:

Code: Select all

lua_getglobal(L, "CHANNEL_BONE_3");
It used:

Code: Select all

require('pickcolor')
to access the pickcolor.dll, and called:

Code: Select all

s = pickcolor.text()
to get the string the dll copied to the clipboard.

Then it tested if that string contained color info and converted the hex string to a Moho color object.
WoW! thanks for taking the time of testing and posting the code.
As SimplSam posted in Moho Plugin API (proof-of-concept) , newer Moho version still support string in/out. So pickcolor can work.
Still hope Moho to fixed the problem in Moho.
Post Reply