Show / Hide Table of Contents

Class BlockFunction

A block that can execute a specific function on one or multiple inputs.

Inheritance
System.Object
ViewModelBase
BlockBase
BlockFunction
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
BlockBase.Label
BlockBase.Disabled
BlockBase.IsSelenium
BlockBase.IsCaptcha
BlockBase.FromLS(List<String>)
BlockBase.ReplaceValuesRecursive(String, BotData)
BlockBase.ReplaceValues(String, BotData)
BlockBase.ParseArguments(String, Char, Char)
BlockBase.UpdateSeleniumData(BotData)
BlockBase.InsertVariables(BotData, Boolean, Boolean, List<String>, String, String, String)
BlockBase.SaveScreenshot(Screenshot, BotData)
BlockBase.SaveScreenshot(Bitmap, BotData)
BlockBase.GetFirstAvailableFileName(String, String, String)
BlockBase.MakeValidFileName(String, Boolean)
BlockBase.TruncatePretty(String, Int32)
ViewModelBase.PropertyChanged
ViewModelBase.OnPropertyChanged(String)
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: RuriLib
Assembly: RuriLib.dll
Syntax
public class BlockFunction : BlockBase, INotifyPropertyChanged

Constructors

| Improve this Doc View Source

BlockFunction()

Creates a Function block.

Declaration
public BlockFunction()

Properties

| Improve this Doc View Source

AesKey

The keys used for AES encryption and decryption.

Declaration
public string AesKey { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

CharIndex

The index of the wanted character.

Declaration
public string CharIndex { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

DateFormat

The format of the date (y = year, M = month, d = day, H = hour, m = minute, s = second).

Declaration
public string DateFormat { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

FunctionType

The function to execute.

Declaration
public BlockFunction.Function FunctionType { get; set; }
Property Value
Type Description
BlockFunction.Function
| Improve this Doc View Source

HashType

The hashing function to use.

Declaration
public BlockFunction.Hash HashType { get; set; }
Property Value
Type Description
BlockFunction.Hash
| Improve this Doc View Source

HmacBase64

Whether to output the message as a base64-encoded string instead of a hex-encoded string.

Declaration
public bool HmacBase64 { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

HmacKey

The key used to authenticate the message.

Declaration
public string HmacKey { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

InputString

The input string on which the function will be executed (not always needed).

Declaration
public string InputString { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

IsCapture

Whether the output variable should be marked for Capture.

Declaration
public bool IsCapture { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

RandomMax

The maximum random number that can be generated.

Declaration
public int RandomMax { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

RandomMin

The minimum random number that can be generated.

Declaration
public int RandomMin { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

RegexMatch

The regex pattern to match.

Declaration
public string RegexMatch { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

ReplaceWhat

The text to replace.

Declaration
public string ReplaceWhat { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

ReplaceWith

The replacement text.

Declaration
public string ReplaceWith { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

RSAExp

The exponent of the RSA key.

Declaration
public string RSAExp { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

RSAMod

The modulus of the RSA key.

Declaration
public string RSAMod { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

StopAfterFirstMatch

Whether to stop translating after the first match.

Declaration
public bool StopAfterFirstMatch { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

StringToFind

The string to count the occurrences of.

Declaration
public string StringToFind { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

SubstringIndex

The starting index for the substring.

Declaration
public string SubstringIndex { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

SubstringLength

The length of the wanted substring.

Declaration
public string SubstringLength { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

TranslationDictionary

The dictionary containing the words and their translation.

Declaration
public Dictionary<string, string> TranslationDictionary { get; set; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.String, System.String>
| Improve this Doc View Source

UseRegex

Whether to use regex for replacing.

Declaration
public bool UseRegex { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

VariableName

The name of the output variable.

Declaration
public string VariableName { get; set; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

AESDecrypt(String, String)

Decrypts an AES-encrypted string.

Declaration
public static string AESDecrypt(string key, string data)
Parameters
Type Name Description
System.String key

The decryption key

System.String data

The AES-encrypted data

Returns
Type Description
System.String

The plaintext string

| Improve this Doc View Source

AESEncrypt(String, String)

Encrypts a string with AES.

Declaration
public static string AESEncrypt(string key, string data)
Parameters
Type Name Description
System.String key

The encryption key

System.String data

The data to encrypt

Returns
Type Description
System.String

The AES-encrypted string

| Improve this Doc View Source

Base64Decode(String)

Decodes a base64-encoded string.

Declaration
public static string Base64Decode(string base64EncodedData)
Parameters
Type Name Description
System.String base64EncodedData

The base64-encoded string

Returns
Type Description
System.String

The decoded string

| Improve this Doc View Source

Base64Encode(String)

Encodes a string to base64.

Declaration
public static string Base64Encode(string plainText)
Parameters
Type Name Description
System.String plainText

The string to encode

Returns
Type Description
System.String

The base64-encoded string

| Improve this Doc View Source

CountStringOccurrences(String, String)

Counts how many times a string occurs inside another string.

Declaration
public static int CountStringOccurrences(string input, string text)
Parameters
Type Name Description
System.String input

The long string

System.String text

The text to search

Returns
Type Description
System.Int32

How many times the text appears in the long string

| Improve this Doc View Source

FromLS(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
BlockBase.FromLS(String)
| Improve this Doc View Source

GetDictionary()

Builds a string containing translation keys.

Declaration
public string GetDictionary()
Returns
Type Description
System.String

One translation key per line, with name and value separated by a colon

| Improve this Doc View Source

GetHash(String, BlockFunction.Hash)

Hashes a string using the specified hashing function.

Declaration
public static string GetHash(string baseString, BlockFunction.Hash type)
Parameters
Type Name Description
System.String baseString

The string to hash

BlockFunction.Hash type

The hashing function

Returns
Type Description
System.String

The hash digest as a hex-encoded string

| Improve this Doc View Source

Hmac(String, BlockFunction.Hash, String, Boolean)

Gets the HMAC signature of a message given a key and a hashing function.

Declaration
public static string Hmac(string baseString, BlockFunction.Hash type, string key, bool base64)
Parameters
Type Name Description
System.String baseString

The message to sign

BlockFunction.Hash type

The hashing function

System.String key

The HMAC key

System.Boolean base64

Whether the output should be encrypted as a base64 string

Returns
Type Description
System.String

The HMAC signature

| Improve this Doc View Source

Process(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
BlockBase.Process(BotData)
| Improve this Doc View Source

RandomUserAgent(Random)

Gets a random User-Agent header.

Declaration
public static string RandomUserAgent(Random rand)
Parameters
Type Name Description
System.Random rand

A random number generator

Returns
Type Description
System.String

A randomly generated User-Agent header

| Improve this Doc View Source

SetDictionary(String[])

Sets translation keys from an array of lines.

Declaration
public void SetDictionary(string[] lines)
Parameters
Type Name Description
System.String[] lines

The lines containing the colon-separated name and value of the translation keys

| Improve this Doc View Source

ToLS(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
Overrides
BlockBase.ToLS(Boolean)

Implements

System.ComponentModel.INotifyPropertyChanged
  • Improve this Doc
  • View Source
Back to top Generated by DocFX