It is currently October 6th, 2024, 10:30 am

How to install a module?

Discuss the use of Lua in Script measures.
zIa1yBX5
Posts: 5
Joined: January 2nd, 2024, 11:55 am

How to install a module?

Post by zIa1yBX5 »

I find a good module "https://github.com/starwing/luautf8" and I need to install it through the luarock.
But rainmeter only support loading external library in lua script and it is impossible to use the module.
How to solve it?
User avatar
KazukiGames82
Posts: 39
Joined: January 25th, 2023, 2:56 am

Re: How to install a module?

Post by KazukiGames82 »

zIa1yBX5 wrote: May 31st, 2024, 1:24 am I find a good module "https://github.com/starwing/luautf8" and I need to install it through the luarock.
May I know why exactly you need to use that?
User avatar
Yincognito
Rainmeter Sage
Posts: 8358
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to install a module?

Post by Yincognito »

KazukiGames82 wrote: May 31st, 2024, 3:47 am May I know why exactly you need to use that?
I suspect that the reason is related to Lua's issues with some file encodings:
https://forum.rainmeter.net/viewtopic.php?t=35292#p176632
Might be wrong though, as I don't know what the OP is actually aiming for. :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16632
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to install a module?

Post by balala »

zIa1yBX5 wrote: May 31st, 2024, 1:24 am I find a good module "https://github.com/starwing/luautf8" and I need to install it through the luarock.
But rainmeter only support loading external library in lua script and it is impossible to use the module.
How to solve it?
Unfortunately I'm not entirely sure, but I think you can't install or use it into Rainmeter. Once again, I'm not sure, a dev would definitely be needed here, but this is my guess at least.
Crest
Posts: 148
Joined: August 16th, 2013, 12:47 pm

Re: How to install a module?

Post by Crest »

zIa1yBX5 wrote: May 31st, 2024, 1:24 am I find a good module "https://github.com/starwing/luautf8" and I need to install it through the luarock.
But rainmeter only support loading external library in lua script and it is impossible to use the module.
How to solve it?
When I've used a (standalone) Lua module I just replaced the following syntax:

Code: Select all

someModule = require "someModule"
With the following within the opening `Initialize()` function of a script (where the `@` represents the root 'Resources' directory of the skin):

Code: Select all

someModule = dofile(SKIN:GetVariable('@')..'someDir\\someFile.lua')
(These are all just placeholder names but you hopefully get the idea)
Crest
Posts: 148
Joined: August 16th, 2013, 12:47 pm

Re: How to install a module?

Post by Crest »

Edit: as for UTF-8 string manipulation Faradey from the forums also made some similar functions (albeit fewer) for it here.

(Thought I clicked edit but apparently quoted myself initially)