Class BlockParse
A block that parses data from a string.
Implements
Inherited Members
Namespace: RuriLib
Assembly: RuriLib.dll
Syntax
public class BlockParse : BlockBase, INotifyPropertyChanged
Constructors
| Improve this Doc View SourceBlockParse()
Creates a Parse block.
Declaration
public BlockParse()
Properties
| Improve this Doc View SourceAttributeName
The name of the attribute from which to parse the value.
Declaration
public string AttributeName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CssElementIndex
The index of the desired element when the selector matches multiple elements.
Declaration
public int CssElementIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
CssSelector
The CSS selector that addresses the desired element in the HTML page.
Declaration
public string CssSelector { get; set; }
Property Value
Type | Description |
---|---|
System.String |
IsCapture
Whether the output variable should be marked as Capture.
Declaration
public bool IsCapture { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
JsonField
The name of the json field for which we want to retrieve the value.
Declaration
public string JsonField { get; set; }
Property Value
Type | Description |
---|---|
System.String |
LeftString
The string to the immediate left of the text to parse. An empty string means the start of the input.
Declaration
public string LeftString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ParseTarget
The string to parse data from.
Declaration
public string ParseTarget { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Prefix
The string to add to the beginning of the parsed data.
Declaration
public string Prefix { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Recursive
Whether to parse multiple values that match the criteria or just the first one.
Declaration
public bool Recursive { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
RegexOutput
The way the content of the matched groups should be formatted. [0] will be replaced with the full match, [1] with the first group etc.
Declaration
public string RegexOutput { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RegexString
The regex pattern that matches parts of the text inside groups.
Declaration
public string RegexString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RightString
The string to the immediate right of the text to parse. An empty string means the end of the input.
Declaration
public string RightString { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Suffix
The string to add to the end of the parsed data.
Declaration
public string Suffix { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Type
The parsing algorithm being used.
Declaration
public ParseType Type { get; set; }
Property Value
Type | Description |
---|---|
ParseType |
UseRegexLR
Whether to use a regex pattern to match a text between two strings instead of the standard algorithm.
Declaration
public bool UseRegexLR { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
VariableName
The name of the output variable where the parsed text will be stored.
Declaration
public string VariableName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceFromLS(String)
Builds a block from a line of LoliScript code.
Declaration
public override BlockBase FromLS(string line)
Parameters
Type | Name | Description |
---|---|---|
System.String | line | The line of LoliScript code |
Returns
Type | Description |
---|---|
BlockBase | The parsed block object |
Overrides
| Improve this Doc View SourceProcess(BotData)
Executes the actual block logic.
Declaration
public override void Process(BotData data)
Parameters
Type | Name | Description |
---|---|---|
BotData | data | The BotData needed for variable replacement |
Overrides
| Improve this Doc View SourceToLS(Boolean)
Converts the block to LoliScript code.
Declaration
public override string ToLS(bool indent = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | indent |
Returns
Type | Description |
---|---|
System.String |