It is currently March 29th, 2024, 6:07 am

Wake up Neo...

Get help with creating, editing & fixing problems with skins
WhosWho?
Posts: 2
Joined: November 26th, 2017, 11:41 pm

Wake up Neo...

Post by WhosWho? »

I'm trying to make a skin that can automatically type a phrase and set it on a loop. Can anyone help? I have this so far currently. If you've seen the movie The Matrix you'll understand exactly what i'm trying to do. Thanks!


[Rainmeter]
Update=500

[MeterTitle]
Meter=String
SolidColor=0,0,0,255
fontsize=16
FontColor=0,176,0
FontFace=Courier new
StringStyle=bold
StringAlign=Left
AntiAlias=1
Text=Wake up, Neo...
DynamicVariables=1
LeftMouseDownAction= ["WWW.Google.com"]


[MeasureBlink]
Measure=Calc
Formula=MeasureBlink = 0 ? 255 : 0

[MeterString]
X=199
Y=-1
Meter=String
FontSize=15
FontColor=0,176,0,[MeasureBlink]
SolidColor=0,0,0,255
FontFace=Courier new
StringStyle=bold
AntiAlias=1
Text=|
DynamicVariables=1
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Wake up Neo...

Post by jsmorley »

I'm guessing that what you mean is something like this:
GIF.gif
I'm not sure that can be done in vanilla Rainmeter, and personally I wouldn't tackle it. Whatever tricks you want to play with Substitute, the rub is that you can't measure a string in "characters" in Rainmeter. I would do it in Lua, where it is pretty trivial.

Skin:

Code: Select all

[Rainmeter]
Update=150
DynamicWindowSize=1
AccurateText=1

[Lua]
Measure=Script
ScriptFile=#CURRENTPATH#Test.lua
TextToType=>Wake up, Neo...

[MeterNeo]
Meter=String
FontSize=30
FontWeight=400
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
Text=>
LeftMouseUpAction=["https://www.google.com"]
Test.lua:

Code: Select all

function Initialize()

	inc = 1
	
end

function Update()

	allText = SELF:GetOption('TextToType')
	
	newText = string.sub(allText, 1, inc)
	SKIN:Bang('!SetOption', 'MeterNeo', 'Text', newText)
	
	inc = inc + 1
	if inc == string.len(allText) + 1 then inc = 1 end
	
end
You do not have the required permissions to view the files attached to this post.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Wake up Neo...

Post by ikarus1969 »

Although i personally would also do it with LUA, it's possible in pure Rainmeter:

Code: Select all

[Rainmeter]
Update=150
DynamicWindowSize=1
AccurateText=1

[Variables]
character_index=0
TextToType=>Wake up, Neo...

[Measure_StrLen_Helper]
Measure=STRING
String=#TextToType#
RegExpSubstitute=1
Substitute=".":"1+","\+$":""
DynamicVariables=1
UpdateDivider=-1

[Measure_StrLen]
Measure=CALC
Formula=[Measure_StrLen_Helper]
DynamicVariables=1
UpdateDivider=-1

[Measure_i]
Measure=CALC
Formula=#character_index#
IfConditionMode=1
IfCondition=#CURRENTSECTION# = Measure_StrLen
IfTrueAction=[!SetVariable "character_index" "1"]
IfFalseAction=[!SetVariable "character_index" "(#character_index# + 1)"]
DynamicVariables=1

[Measure_StringToType]
Measure=STRING
String=#TextToType#
RegExpSubstitute=1
Substitute="^(.{#character_index#,#character_index#}).*$":"\1"
DynamicVariables=1

[MeterNeo]
Meter=String
MeasureName=Measure_StringToType
FontSize=30
FontWeight=400
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
LeftMouseUpAction=["https://www.google.com"]
WhosWho?
Posts: 2
Joined: November 26th, 2017, 11:41 pm

Re: Wake up Neo...

Post by WhosWho? »

What is LUA and where can I learn this?
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Wake up Neo...

Post by ikarus1969 »

WhosWho? wrote:What is LUA and where can I learn this?
as a starting point, please read the documentation: https://docs.rainmeter.net/manual-beta/lua-scripting/

and in general: let me google that for you