It is currently September 29th, 2024, 7:20 pm

Mars clock

General topics related to Rainmeter.
super8
Posts: 2
Joined: May 21st, 2013, 2:35 pm

Mars clock

Post by super8 »

I want to make a clock skin that shows what time it is on mars. I have a working javascript that does that. I suspect I could copy the clock skin and modify its output but I can't even find the lua code for the clock to edit.

Where is the clock code in my computer so I can modify it?
User avatar
jsmorley
Developer
Posts: 22793
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Mars clock

Post by jsmorley »

There really is no "clock code" as such in Rainmeter. Rainmeter is a tool that at it's most basic allows you to write "skins" that use the built-in Measures (measure stuff) and Meters (display stuff). There is a "clock" skin that comes with and is installed with Rainmeter, (illustro) but it is very simple and just measures the time on your system with a Time measure, and displays it with a String meter.

There is no general Lua underpinning in Rainmeter. Lua scripting is a feature of the tool, and skins can be written that make us of it, but you are not going to find any Lua "code" in a default installation of Rainmeter and the default illustro skins.

If you want a skin that uses some Lua code (converted from your Javascript code) to convert local time to "Mars" time, you are going to have to write it. The basics are going to be a Time Measure to get the system time, and a Script measure that converts the time using your code and returns some value to Rainmeter. It can do that by having the actual "return" value of the script set some value you use in a meter, or by using "bangs" to control the value of some variables (with !SetVariable) or directly set some measure or meter options (with !SetOption).

I have touched on several bits of functionality in Rainmeter, so the best place I can point you to is: http://docs.rainmeter.net/manual
super8
Posts: 2
Joined: May 21st, 2013, 2:35 pm

Re: Mars clock

Post by super8 »

So what isn't clear is where to insert the lua code. Is it within the ini file?
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Mars clock

Post by fonpaolo »

Yes, you need to put in the .ini file this:

Code: Select all

Measure=Script
ScriptFile=#@#YOURScript.lua