Class LoliScript
Represents a LoliScript script that can be run line by line.
Inheritance
Inherited Members
Namespace: RuriLib.LS
Assembly: RuriLib.dll
Syntax
public class LoliScript
Constructors
| Improve this Doc View SourceLoliScript()
Constructs a LoliScript object with an empty script.
Declaration
public LoliScript()
LoliScript(String)
Constructs a LoliScript object with a given script.
Declaration
public LoliScript(string script)
Parameters
Type | Name | Description |
---|---|---|
System.String | script | The LoliScript script |
Properties
| Improve this Doc View SourceCanProceed
Whether the script can proceed the execution or not.
Declaration
public bool CanProceed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CurrentBlock
The current block being processed.
Declaration
public string CurrentBlock { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CurrentLine
The current line being processed.
Declaration
public string CurrentLine { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Script
The actual script as a string containing linebreaks.
Declaration
public string Script { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceFromBlocks(List<BlockBase>)
Sets the script from a list of blocks.
Declaration
public void FromBlocks(List<BlockBase> blocks)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<BlockBase> | blocks | The list of blocks which inherit from the BlockBase type |
ParseCheckCondition(ref String, BotData)
Parses a condition made of left-hand term, condition type and right-hand term and verifies if it's true.
Declaration
public static bool ParseCheckCondition(ref string cfLine, BotData data)
Parameters
Type | Name | Description |
---|---|---|
System.String | cfLine | The reference to the line to parse |
BotData | data | The BotData needed for variable replacement |
Returns
Type | Description |
---|---|
System.Boolean |
Reset()
Resets the line counter so the script can be run again.
Declaration
public void Reset()
ScanFor(String[], Int32, Boolean, String[])
Scans for a given set of identifiers in the script and returns the line index value of the first found.
Declaration
public static int ScanFor(string[] lines, int current, bool downwards, string[] options)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | lines | The lines of the script |
System.Int32 | current | The index of the current line |
System.Boolean | downwards | Whether to scan downwards or upwards |
System.String[] | options | The target identifiers |
Returns
Type | Description |
---|---|
System.Int32 |
TakeStep(BotData)
Executes a line of the script.
Declaration
public void TakeStep(BotData data)
Parameters
Type | Name | Description |
---|---|---|
BotData | data | The BotData needed for variable replacement |
ToBlocks()
Transforms the script into a list of blocks. The blocks that cannot be converted will be created as BlockLSCode blocks.
Declaration
public List<BlockBase> ToBlocks()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<BlockBase> |