It is currently April 26th, 2024, 4:34 pm

how to input some text for getting different information?

Get help with creating, editing & fixing problems with skins
blackjack550
Posts: 12
Joined: August 4th, 2021, 1:45 am

how to input some text for getting different information?

Post by blackjack550 »

i want to do a tools for stock of china. i can input some text from mesureinput ,and show it. but i want to run webparser when i input this text.
thx for your help

Code: Select all

[Rainmeter]
Author=blackjack550
AppVersion=2.0
Update=1000

[Metadata]
Description=The stock for kechuang.
License=
Version=1.0.0

[Variables]
fontName=Tahoma
textSize=9
; SecondVar=!SetVariable
SecondVar="399006"
; fontName=Trebuchet MS
; textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
colordown=0,255,0,205
colorup=255,0,0,205
update.Spd=15
Quote=http://hq.sinajs.cn/list=s_sz#SecondVar#

;输入框
[measureInput]
; The InputText.dll plugin has special powers: it allows user input.
; However, it's not the easiest way to start learning Rainmeter. Get a
; hold of the basics, and then check out the manual entry for InputText.
Measure=Plugin
Plugin=InputText.dll
SolidColor=0,64,128,180
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
X=10
Y=38
W=120
H=17
FocusDismiss=1
DefaultValue=""
; Command1=["http://hq.sinajs.cn/list=s_sz$UserInput$"]
Command1=[!SetVariable SecondVar "$UserInput$"]
; Command2=!Refresh #SecondVar#
UpdateDivider=5

[InfoStock1]
Measure=Plugin
Plugin=Plugins\WebParser.dll

URL=#Quote#
RegExp="(?siU)var hq_str_(.*)="(.*),(.*),(.*),(.*),(.*),(.*)";"
CodePage=936
StringIndex=7
UpdateRate=#update.Spd#





[StockName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=2

[PriceNow]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=3

[Change]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=4

[ChangeNet]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=5

[StockColorinfo]
Measure=Calc
Formula=Change
IfAboveValue=0
IfAboveAction=!Execute [!SetOption "LabelLastSale" "FontColor" "#colorup#"][!SetOption "LabelChange" "FontColor" "#colorup#"][!SetOption "LabelChangeNet" "FontColor" "#colorup#"][!SetOption "StockBar" "BarColor" "#colorup#"][!SetOption "StockBar" "Flip" "0"][!SetOption "LabelUpSymbols" "FontColor" "#colorup#"][!SetOption "LabelUpSymbols" "Text" "Ç"]

; ----------------------------------

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=Left
; Meters using styleLeftText will be left-aligned.
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleSeperator]
SolidColor=255,255,255,15

[StyleStockName]
StringAlign=LEFT
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,205
FontColor=#colorText#
FontFace=微软雅黑
FontSize=12
AntiAlias=1
ClipString=1

[StyleChange]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
;FontColor=#ColorStock#
FontEffectColor=0,0,0,205
FontFace=Swis721 Blk BT
FontSize=10
AntiAlias=1
ClipString=1

[styleBar]
BarOrientation=VERTICAL
SolidColor=255,255,255,5

[StyleDate]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,205
FontColor=255,255,255,205
FontFace=#fontName#
FontSize=7
AntiAlias=1
ClipString=1

[StyleSymbols]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,255
FontColor=195,195,195,205
FontFace=Wingdings 3
FontSize=14
AntiAlias=1
ClipString=1

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterBackground]
Meter=IMAGE
X=0
Y=0
W=140
H=170
SolidColor=0,128,255,180
SolidColor2=0,64,128,150

; [Symbols]
; Meter=STRING
; MeterStyle=StyleSymbols
; text="P"
; X=5
; Y=125
; W=50
; H=30
;LeftMouseDownAction=!ActivateConfig "STOCK_CN" "stock_sh.ini"

[LabelStockName]
Meter=STRING
MeterStyle=StyleStockName
MeasureName=StockName
X=10
Y=80
W=80
H=50

[LabelLastSale]
Meter=STRING
MeterStyle=StyleStockName
MeasureName=PriceNow
X=40
Y=130
W=100
H=38
FontSize=15
FontColor=#colordown#
FontFace=Swis721 Blk BT
NumOfDecimals=2

[LabelChange]
Meter=STRING
MeterStyle=StyleChange
MeasureName=Change
X=20
Y=100
W=120
H=20
FontColor=#colordown#
NumOfDecimals=2
Text=振幅:%1%

[LabelChangeNet]
Meter=STRING
MeterStyle=StyleChange
MeasureName=ChangeNet
X=20
Y=115
W=100
H=20
FontColor=#colordown#
NumOfDecimals=2
Text="涨跌幅:%1%"

[StockBar]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureChange
X=55
Y=135
W=5
H=40
BarColor=#colordown#
Flip=1

[LabelUpSymbols]
Meter=STRING
MeterStyle=StyleSymbols
X=20
Y=135
W=60
H=75
Text="È"
FontSize=14
FontColor=#colordown#

;------------------------------------------------------------
[meterTitle]
Meter=String
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=70
Y=12
W=100
H=18
Text=创业板股票

[meterSearch]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=100
H=14
Text=股票编码...
LeftMouseUpAction=[!CommandMeasure measureInput "ExecuteBatch 1-2"]

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=60
H=1

[MeterSetVariable]
Meter=String
X=5
Y=60
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Text=股票代码:#SecondVar#
You do not have the required permissions to view the files attached to this post.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: how to input some text for getting different information?

Post by death.crafter »

blackjack550 wrote: August 4th, 2021, 6:00 am i want to do a tools for stock of china. i can input some text from mesureinput ,and show it. but i want to run webparser when i input this text.
thx for your help

Code: Select all

;输入框
[measureInput]
Measure=Plugin
Plugin=InputText
SolidColor=0,64,128,180
StringAlign=Left
StringStyle=Bold
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
X=10
Y=38
W=120
H=17
FocusDismiss=1
DefaultValue=""
Command1=[!SetVariable SecondVar "$UserInput$"][!CommandMeasure InfoStock1 Update]
UpdateDivider=-1


[InfoStock1]
Measure=WebParser
URL=http://hq.sinajs.cn/list=s_sz#SecondVar#
RegExp=(?siU)var hq_str_(.*)="(.*),(.*),(.*),(.*),(.*),(.*)";
CodePage=936
DynamicVariables=1
UpdateRate=15
You need something like this.
from the Realm of Death
User avatar
balala
Rainmeter Sage
Posts: 16173
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to input some text for getting different information?

Post by balala »

death.crafter wrote: August 4th, 2021, 9:46 am You need something like this.
I doubt this will work so simple.
blackjack550 wrote: August 4th, 2021, 6:00 am i want to do a tools for stock of china. i can input some text from mesureinput ,and show it. but i want to run webparser when i input this text.
thx for your help
There is a problem with the URL option of the [InfoStock1] measure. Add the URL needed to be used directly in the measure, not through the Quote variable, so replace the URL=#Quote# option with URL=http://hq.sinajs.cn/list=s_sz#SecondVar#. Beside this follow death.crafter's advice about adding:
  • The [!CommandMeasure InfoStock1 Update] bang to the Command1 option of the [measureInput] measure (getting the option to look this way: Command1=[!SetVariable SecondVar "$UserInput$"][!CommandMeasure InfoStock1 Update]).
  • The DynamicVariables=1 option to the [InfoStock1] measure.
(Both changes described by death.crafter above).
Beside this, note that there is a mistake into the LeftMouseUpAction option of the [meterSearch] meter (LeftMouseUpAction=[!CommandMeasure measureInput "ExecuteBatch 1-2"]). The [measureInput] measure doesn't have two CommandX options, so ExecuteBatch 1-2 should be actually only ExecuteBatch 1 (even if initially there has been two CommandX options, but one has been commented out in meantime).
blackjack550
Posts: 12
Joined: August 4th, 2021, 1:45 am

Re: how to input some text for getting different information?

Post by blackjack550 »

balala wrote: August 4th, 2021, 9:00 pm I doubt this will work so simple.

There is a problem with the URL option of the [InfoStock1] measure. Add the URL needed to be used directly in the measure, not through the Quote variable, so replace the URL=#Quote# option with URL=http://hq.sinajs.cn/list=s_sz#SecondVar#. Beside this follow death.crafter's advice about adding:
  • The [!CommandMeasure InfoStock1 Update] bang to the Command1 option of the [measureInput] measure (getting the option to look this way: Command1=[!SetVariable SecondVar "$UserInput$"][!CommandMeasure InfoStock1 Update]).
  • The DynamicVariables=1 option to the [InfoStock1] measure.
(Both changes described by death.crafter above).
Beside this, note that there is a mistake into the LeftMouseUpAction option of the [meterSearch] meter (LeftMouseUpAction=[!CommandMeasure measureInput "ExecuteBatch 1-2"]). The [measureInput] measure doesn't have two CommandX options, so ExecuteBatch 1-2 should be actually only ExecuteBatch 1 (even if initially there has been two CommandX options, but one has been commented out in meantime).
thx for your reply,i have a mistake in "CommandX",the Command2 Commented out code,i forgot change it。
you are right ,according death.crafter's suggestion,i can refresh [InfoStock], but #SecondVar# variables has not changed.
User avatar
balala
Rainmeter Sage
Posts: 16173
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to input some text for getting different information?

Post by balala »

blackjack550 wrote: August 5th, 2021, 6:25 am thx for your reply,i have a mistake in "CommandX",the Command2 Commented out code,i forgot change it。
you are right ,according death.crafter's suggestion,i can refresh [InfoStock], but #SecondVar# variables has not changed.
Post the updated code please, to can check.
blackjack550
Posts: 12
Joined: August 4th, 2021, 1:45 am

Re: how to input some text for getting different information?

Post by blackjack550 »

balala wrote: August 5th, 2021, 6:30 am Post the updated code please, to can check.

Code: Select all

[Rainmeter]
Author=blackjack550
AppVersion=2.0
Update=1000

[Metadata]
Description=The stock for kechuang.
License=
Version=1.0.0

[Variables]
fontName=Tahoma
textSize=9
; SecondVar=!SetVariable
SecondVar="399006"
; fontName=Trebuchet MS
; textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
colordown=0,255,0,205
colorup=255,0,0,205
update.Spd=15
Quote=http://hq.sinajs.cn/list=s_sz#SecondVar#

;输入框
[measureInput]
; The InputText.dll plugin has special powers: it allows user input.
; However, it's not the easiest way to start learning Rainmeter. Get a
; hold of the basics, and then check out the manual entry for InputText.
Measure=Plugin
Plugin=InputText.dll
SolidColor=0,64,128,180
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
X=10
Y=38
W=120
H=17
FocusDismiss=1
DefaultValue=""
; Command1=["http://hq.sinajs.cn/list=s_sz$UserInput$"]
Command1=[!SetVariable SecondVar "$UserInput$"][!CommandMeasure InfoStock1 Update]
; Command2=!Refresh #SecondVar#
UpdateDivider=5

[InfoStock1]
Measure=Plugin
Plugin=Plugins\WebParser.dll

URL=#Quote#
RegExp="(?siU)var hq_str_(.*)="(.*),(.*),(.*),(.*),(.*),(.*)";"
CodePage=936
StringIndex=7
UpdateRate=#update.Spd#





[StockName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=2

[PriceNow]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=3

[Change]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=4

[ChangeNet]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=5

[StockColorinfo]
Measure=Calc
Formula=Change
IfAboveValue=0
IfAboveAction=!Execute [!SetOption "LabelLastSale" "FontColor" "#colorup#"][!SetOption "LabelChange" "FontColor" "#colorup#"][!SetOption "LabelChangeNet" "FontColor" "#colorup#"][!SetOption "StockBar" "BarColor" "#colorup#"][!SetOption "StockBar" "Flip" "0"][!SetOption "LabelUpSymbols" "FontColor" "#colorup#"][!SetOption "LabelUpSymbols" "Text" "Ç"]

; ----------------------------------

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=Left
; Meters using styleLeftText will be left-aligned.
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleSeperator]
SolidColor=255,255,255,15

[StyleStockName]
StringAlign=LEFT
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,205
FontColor=#colorText#
FontFace=微软雅黑
FontSize=12
AntiAlias=1
ClipString=1

[StyleChange]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
;FontColor=#ColorStock#
FontEffectColor=0,0,0,205
FontFace=Swis721 Blk BT
FontSize=10
AntiAlias=1
ClipString=1

[styleBar]
BarOrientation=VERTICAL
SolidColor=255,255,255,5

[StyleDate]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,205
FontColor=255,255,255,205
FontFace=#fontName#
FontSize=7
AntiAlias=1
ClipString=1

[StyleSymbols]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,255
FontColor=195,195,195,205
FontFace=Wingdings 3
FontSize=14
AntiAlias=1
ClipString=1

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterBackground]
Meter=IMAGE
X=0
Y=0
W=140
H=170
SolidColor=0,128,255,180
SolidColor2=0,64,128,150

; [Symbols]
; Meter=STRING
; MeterStyle=StyleSymbols
; text="P"
; X=5
; Y=125
; W=50
; H=30
;LeftMouseDownAction=!ActivateConfig "STOCK_CN" "stock_sh.ini"

[LabelStockName]
Meter=STRING
MeterStyle=StyleStockName
MeasureName=StockName
X=10
Y=80
W=80
H=50

[LabelLastSale]
Meter=STRING
MeterStyle=StyleStockName
MeasureName=PriceNow
X=40
Y=130
W=100
H=38
FontSize=15
FontColor=#colordown#
FontFace=Swis721 Blk BT
NumOfDecimals=2

[LabelChange]
Meter=STRING
MeterStyle=StyleChange
MeasureName=Change
X=20
Y=100
W=120
H=20
FontColor=#colordown#
NumOfDecimals=2
Text=振幅:%1%

[LabelChangeNet]
Meter=STRING
MeterStyle=StyleChange
MeasureName=ChangeNet
X=20
Y=115
W=100
H=20
FontColor=#colordown#
NumOfDecimals=2
Text="涨跌幅:%1%"

[StockBar]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureChange
X=55
Y=135
W=5
H=40
BarColor=#colordown#
Flip=1

[LabelUpSymbols]
Meter=STRING
MeterStyle=StyleSymbols
X=20
Y=135
W=60
H=75
Text="È"
FontSize=14
FontColor=#colordown#

;------------------------------------------------------------
[meterTitle]
Meter=String
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=70
Y=12
W=100
H=18
Text=创业板股票

[meterSearch]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=100
H=14
Text=股票编码...
LeftMouseUpAction=[!CommandMeasure measureInput "ExecuteBatch 1"]

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=60
H=1

[MeterSetVariable]
Meter=String
X=5
Y=60
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Text=股票代码:#SecondVar#
User avatar
balala
Rainmeter Sage
Posts: 16173
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to input some text for getting different information?

Post by balala »

blackjack550 wrote: August 5th, 2021, 7:04 am

Code: Select all

[Rainmeter]
Author=blackjack550
AppVersion=2.0
Update=1000

[Metadata]
Description=The stock for kechuang.
License=
Version=1.0.0

[Variables]
fontName=Tahoma
textSize=9
; SecondVar=!SetVariable
SecondVar="399006"
; fontName=Trebuchet MS
; textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
colordown=0,255,0,205
colorup=255,0,0,205
update.Spd=15
Quote=http://hq.sinajs.cn/list=s_sz#SecondVar#

;输入框
[measureInput]
; The InputText.dll plugin has special powers: it allows user input.
; However, it's not the easiest way to start learning Rainmeter. Get a
; hold of the basics, and then check out the manual entry for InputText.
Measure=Plugin
Plugin=InputText.dll
SolidColor=0,64,128,180
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
X=10
Y=38
W=120
H=17
FocusDismiss=1
DefaultValue=""
; Command1=["http://hq.sinajs.cn/list=s_sz$UserInput$"]
Command1=[!SetVariable SecondVar "$UserInput$"][!CommandMeasure InfoStock1 Update]
; Command2=!Refresh #SecondVar#
UpdateDivider=5

[InfoStock1]
Measure=Plugin
Plugin=Plugins\WebParser.dll

URL=#Quote#
RegExp="(?siU)var hq_str_(.*)="(.*),(.*),(.*),(.*),(.*),(.*)";"
CodePage=936
StringIndex=7
UpdateRate=#update.Spd#





[StockName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=2

[PriceNow]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=3

[Change]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=4

[ChangeNet]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=5

[StockColorinfo]
Measure=Calc
Formula=Change
IfAboveValue=0
IfAboveAction=!Execute [!SetOption "LabelLastSale" "FontColor" "#colorup#"][!SetOption "LabelChange" "FontColor" "#colorup#"][!SetOption "LabelChangeNet" "FontColor" "#colorup#"][!SetOption "StockBar" "BarColor" "#colorup#"][!SetOption "StockBar" "Flip" "0"][!SetOption "LabelUpSymbols" "FontColor" "#colorup#"][!SetOption "LabelUpSymbols" "Text" "Ç"]

; ----------------------------------

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=Left
; Meters using styleLeftText will be left-aligned.
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleSeperator]
SolidColor=255,255,255,15

[StyleStockName]
StringAlign=LEFT
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,205
FontColor=#colorText#
FontFace=微软雅黑
FontSize=12
AntiAlias=1
ClipString=1

[StyleChange]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
;FontColor=#ColorStock#
FontEffectColor=0,0,0,205
FontFace=Swis721 Blk BT
FontSize=10
AntiAlias=1
ClipString=1

[styleBar]
BarOrientation=VERTICAL
SolidColor=255,255,255,5

[StyleDate]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,205
FontColor=255,255,255,205
FontFace=#fontName#
FontSize=7
AntiAlias=1
ClipString=1

[StyleSymbols]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,255
FontColor=195,195,195,205
FontFace=Wingdings 3
FontSize=14
AntiAlias=1
ClipString=1

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterBackground]
Meter=IMAGE
X=0
Y=0
W=140
H=170
SolidColor=0,128,255,180
SolidColor2=0,64,128,150

; [Symbols]
; Meter=STRING
; MeterStyle=StyleSymbols
; text="P"
; X=5
; Y=125
; W=50
; H=30
;LeftMouseDownAction=!ActivateConfig "STOCK_CN" "stock_sh.ini"

[LabelStockName]
Meter=STRING
MeterStyle=StyleStockName
MeasureName=StockName
X=10
Y=80
W=80
H=50

[LabelLastSale]
Meter=STRING
MeterStyle=StyleStockName
MeasureName=PriceNow
X=40
Y=130
W=100
H=38
FontSize=15
FontColor=#colordown#
FontFace=Swis721 Blk BT
NumOfDecimals=2

[LabelChange]
Meter=STRING
MeterStyle=StyleChange
MeasureName=Change
X=20
Y=100
W=120
H=20
FontColor=#colordown#
NumOfDecimals=2
Text=振幅:%1%

[LabelChangeNet]
Meter=STRING
MeterStyle=StyleChange
MeasureName=ChangeNet
X=20
Y=115
W=100
H=20
FontColor=#colordown#
NumOfDecimals=2
Text="涨跌幅:%1%"

[StockBar]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureChange
X=55
Y=135
W=5
H=40
BarColor=#colordown#
Flip=1

[LabelUpSymbols]
Meter=STRING
MeterStyle=StyleSymbols
X=20
Y=135
W=60
H=75
Text="È"
FontSize=14
FontColor=#colordown#

;------------------------------------------------------------
[meterTitle]
Meter=String
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=70
Y=12
W=100
H=18
Text=创业板股票

[meterSearch]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=100
H=14
Text=股票编码...
LeftMouseUpAction=[!CommandMeasure measureInput "ExecuteBatch 1"]

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=60
H=1

[MeterSetVariable]
Meter=String
X=5
Y=60
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Text=股票代码:#SecondVar#
Make the following updates: Both the above two updates have been suggested previously by death.crafter and me.
blackjack550
Posts: 12
Joined: August 4th, 2021, 1:45 am

Re: how to input some text for getting different information?

Post by blackjack550 »

balala wrote: August 5th, 2021, 8:01 am Make the following updates: Both the above two updates have been suggested previously by death.crafter and me.
Thanks a lot! it is worked. the [Variables] #Quote# cant used when Update [InfoStock1]
but i have a question why must add DynamicVariables=1 ,do you update #URL# when [InfoStock1] running?

Thanks for everything ,balala and death.crafter.
blackjack550
Posts: 12
Joined: August 4th, 2021, 1:45 am

Re: how to input some text for getting different information?

Post by blackjack550 »

i paste my code.

Code: Select all

[Rainmeter]
Author=blackjack550
AppVersion=2.0
Update=1000

[Metadata]
Description=The stock for kechuang.
License=
Version=1.0.0

[Variables]
fontName=Tahoma
textSize=9
; SecondVar=!SetVariable
SecondVar="399006"
; fontName=Trebuchet MS
; textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
colordown=0,255,0,205
colorup=255,0,0,205
update.Spd=15
Quote=http://hq.sinajs.cn/list=s_sz#SecondVar#

;输入框
[measureInput]
; The InputText.dll plugin has special powers: it allows user input.
; However, it's not the easiest way to start learning Rainmeter. Get a
; hold of the basics, and then check out the manual entry for InputText.
Measure=Plugin
Plugin=InputText.dll
SolidColor=0,64,128,180
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
X=10
Y=38
W=120
H=17
FocusDismiss=1
DefaultValue=""
; Command1=["http://hq.sinajs.cn/list=s_sz$UserInput$"]
Command1=[!SetVariable SecondVar "$UserInput$"][!CommandMeasure InfoStock1 Update]
; Command2=!Refresh #SecondVar#
UpdateDivider=5

[InfoStock1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
DynamicVariables=1
URL=http://hq.sinajs.cn/list=s_sz#SecondVar#
RegExp="(?siU)var hq_str_(.*)="(.*),(.*),(.*),(.*),(.*),(.*)";"
CodePage=936
StringIndex=7
UpdateRate=#update.Spd#





[StockName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=2

[PriceNow]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=3

[Change]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=4

[ChangeNet]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[InfoStock1]
StringIndex=5

[StockColorinfo]
Measure=Calc
Formula=Change
IfAboveValue=0
IfAboveAction=!Execute [!SetOption "LabelLastSale" "FontColor" "#colorup#"][!SetOption "LabelChange" "FontColor" "#colorup#"][!SetOption "LabelChangeNet" "FontColor" "#colorup#"][!SetOption "StockBar" "BarColor" "#colorup#"][!SetOption "StockBar" "Flip" "0"][!SetOption "LabelUpSymbols" "FontColor" "#colorup#"][!SetOption "LabelUpSymbols" "Text" "Ç"]

; ----------------------------------

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=Left
; Meters using styleLeftText will be left-aligned.
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleSeperator]
SolidColor=255,255,255,15

[StyleStockName]
StringAlign=LEFT
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,205
FontColor=#colorText#
FontFace=微软雅黑
FontSize=12
AntiAlias=1
ClipString=1

[StyleChange]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
;FontColor=#ColorStock#
FontEffectColor=0,0,0,205
FontFace=Swis721 Blk BT
FontSize=10
AntiAlias=1
ClipString=1

[styleBar]
BarOrientation=VERTICAL
SolidColor=255,255,255,5

[StyleDate]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,205
FontColor=255,255,255,205
FontFace=#fontName#
FontSize=7
AntiAlias=1
ClipString=1

[StyleSymbols]
StringAlign=LEFT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,255
FontColor=195,195,195,205
FontFace=Wingdings 3
FontSize=14
AntiAlias=1
ClipString=1

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterBackground]
Meter=IMAGE
X=0
Y=0
W=140
H=170
SolidColor=0,128,255,180
SolidColor2=0,64,128,150

; [Symbols]
; Meter=STRING
; MeterStyle=StyleSymbols
; text="P"
; X=5
; Y=125
; W=50
; H=30
;LeftMouseDownAction=!ActivateConfig "STOCK_CN" "stock_sh.ini"

[LabelStockName]
Meter=STRING
MeterStyle=StyleStockName
MeasureName=StockName
X=10
Y=80
W=80
H=50

[LabelLastSale]
Meter=STRING
MeterStyle=StyleStockName
MeasureName=PriceNow
X=40
Y=130
W=100
H=38
FontSize=15
FontColor=#colordown#
FontFace=Swis721 Blk BT
NumOfDecimals=2

[LabelChange]
Meter=STRING
MeterStyle=StyleChange
MeasureName=Change
X=20
Y=100
W=120
H=20
FontColor=#colordown#
NumOfDecimals=2
Text=振幅:%1%

[LabelChangeNet]
Meter=STRING
MeterStyle=StyleChange
MeasureName=ChangeNet
X=20
Y=115
W=100
H=20
FontColor=#colordown#
NumOfDecimals=2
Text="涨跌幅:%1%"

[StockBar]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureChange
X=55
Y=135
W=5
H=40
BarColor=#colordown#
Flip=1

[LabelUpSymbols]
Meter=STRING
MeterStyle=StyleSymbols
X=20
Y=135
W=60
H=75
Text="È"
FontSize=14
FontColor=#colordown#

;------------------------------------------------------------
[meterTitle]
Meter=String
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=70
Y=12
W=100
H=18
Text=创业板股票

[meterSearch]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=100
H=14
Text=股票编码...
LeftMouseUpAction=[!CommandMeasure measureInput "ExecuteBatch 1"]

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=60
H=1

[MeterSetVariable]
Meter=String
X=5
Y=60
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
DynamicVariables=1
Text=股票代码:#SecondVar#
User avatar
balala
Rainmeter Sage
Posts: 16173
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to input some text for getting different information?

Post by balala »

blackjack550 wrote: August 5th, 2021, 10:58 am i paste my code.
Does it work this time as expected?
Sorry, read your previous reply only after posting mine.
I'm glad if you got it working.