### Start OpenBullet2 Web Application Source: https://docs.openbullet.dev/docs/installation/linux This command is used to start the OpenBullet2 web application after the updater has successfully downloaded the latest version. It requires the .NET runtime to be installed. ```bash dotnet ./OpenBullet2.Web.dll ``` -------------------------------- ### Install wget, Download Updater, Make Executable, Run, and Start App (Linux Server x64) Source: https://docs.openbullet.dev/docs/installation/linux This comprehensive command sequence is for Linux servers (x64) without a GUI. It installs wget, downloads the updater, makes it executable, runs the updater, and finally starts the OpenBullet2 web application using .NET. ```bash sudo apt install -y wget wget https://github.com/openbullet/openbullet2/releases/latest/download/ob2-web-updater-linux-x64 chmod +x ./ob2-web-updater-linux-x64 ./ob2-web-updater-linux-x64 dotnet ./OpenBullet2.Web.dll ``` -------------------------------- ### Make Updater Executable and Run (Linux x64) Source: https://docs.openbullet.dev/docs/installation/linux This snippet demonstrates how to make the OpenBullet2 web updater executable and then run it on a Linux x64 system. It requires the user to first navigate to the directory containing the updater. ```bash chmod +x ./ob2-web-updater-linux-x64 ./ob2-web-updater-linux-x64 ``` -------------------------------- ### Make Updater Executable and Run (Linux arm64) Source: https://docs.openbullet.dev/docs/installation/linux This snippet shows the commands to make the OpenBullet2 web updater executable and subsequently run it on a Linux arm64 system. Ensure you are in the directory where the updater was downloaded. ```bash chmod +x ./ob2-web-updater-linux-arm64 ./ob2-web-updater-linux-arm64 ``` -------------------------------- ### Handling Proxy Null Check Source: https://docs.openbullet.dev/docs/lolicode/bot_data Provides an example of how to safely access proxy properties by first checking if `data.Proxy` is null. This is crucial as the proxy object will be null if proxies are disabled in the bot's configuration. ```csharp if (data.Proxy != null) { string proxyHost = data.Proxy.Host; // Use proxy details } else { // Handle scenario where proxies are not used } ``` -------------------------------- ### LoliCode and C# Integration Example Source: https://docs.openbullet.dev/docs/lolicode/general-info Demonstrates how to define C# methods, use LoliCode blocks like RandomInteger, and integrate pure C# code within the LoliCode environment. It showcases conditional logic using LoliCode statements and C# variables. ```LoliCode/C# // You can define C# methods like this int Add(int first, int second) { return first + second; } // This is the representation of a block you see in Stacker BLOCK:RandomInteger minimum = 0 maximum = 10 => VAR @num1 ENDBLOCK BLOCK:RandomInteger minimum = 0 maximum = 10 => VAR @num2 ENDBLOCK // A piece of pure C# code int result = Add(num1, num2); // These are LoliCode statements. You can also use plain C# IF INTKEY @result GreaterThan 10 CLOG DarkCyan $"Result: {result}" ELSE CLOG Cyan $"Result: {result}" END ``` -------------------------------- ### Use External Library in LoliCode (C#) Source: https://docs.openbullet.dev/docs/lolicode/external-libraries Example of how to use an external C# library, specifically the Humanizer library, within an OpenBullet 2 LoliCode script. It demonstrates importing the namespace and calling a library function. ```csharp using Humanizer; string apple = "apple"; string apples = apple.Pluralize(); CLOG SkyBlue @apples ``` -------------------------------- ### LoliCode Block Structure Example Source: https://docs.openbullet.dev/docs/lolicode/blocks This snippet demonstrates the basic syntax of a LoliCode block. It includes mandatory elements like BLOCK, Id, and ENDBLOCK, along with optional elements such as LABEL, DISABLED, SAFE, settings, and output variables. ```plaintext BLOCK:Id [LABEL:Custom label] [DISABLED] [SAFE] [settingName = settingValue] [=> VAR/CAP @outputVariable] ENDBLOCK ``` -------------------------------- ### LoliCode Fixed Value Types Source: https://docs.openbullet.dev/docs/lolicode/blocks Examples of fixed value types used in LoliCode settings, including Boolean, Integer, Float, String, Enum, Byte Array, List of Strings, and Dictionary of Strings. ```plaintext Bool: true or false Int: 123 Float: 0.42 String: "hello" Enum: GET Byte Array: plvB6Yer List of Strings: ["one", "two", "three"] Dictionary of Strings: {("one", "first"), ("two", "second"), ("three", "third")} ``` -------------------------------- ### LoliCode Interpolated Value Types Source: https://docs.openbullet.dev/docs/lolicode/blocks Examples of interpolated value types in LoliCode, which allow embedding variables within strings, lists, or dictionaries. This enables dynamic string construction. ```plaintext String: $"This is my " List of Strings: $["one", "", "three"] Dictionary of Strings: {("one", "first"), ("", "second"), ("three", "third")} ``` -------------------------------- ### Custom Wordlist Type Syntax for Keywords and Codes Source: https://docs.openbullet.dev/docs/wordlists/general-info An example of defining a custom wordlist type named 'KeywordsCodes'. This type uses a regular expression to validate lines containing a keyword and a 6-digit code separated by a colon, and defines two slices: KEYWORD and CODE. ```ini [WORDLIST TYPE] Name=KeywordsCodes Regex=^[a-z]{4,8}:[0-9]{6}$ Verify=True Separator=: Slices=KEYWORD,CODE ``` -------------------------------- ### Define Proxy Ban Conditions with Keycheck Block (LoliCode) Source: https://docs.openbullet.dev/docs/proxies/proxies-for-config-makers The Keycheck block in LoliCode allows you to define conditions under which a proxy should be banned or considered successful. This example demonstrates banning a proxy if the HTTP response code is 429 (Too Many Requests) or marking a successful connection if it contains 'Success!'. It can be used to control proxy behavior based on response criteria. ```LoliCode BLOCK:Keycheck KEYCHAIN SUCCESS OR STRINGKEY @data.SOURCE Contains "Success!" KEYCHAIN BAN OR INTKEY @data.RESPONSECODE EqualTo 429 ENDBLOCK ``` -------------------------------- ### Create .NET Console App and Add Package (CLI) Source: https://docs.openbullet.dev/docs/lolicode/external-libraries Steps to create a new .NET console application and add a NuGet package using the .NET CLI. This is a prerequisite for obtaining the .dll file of an external library. ```bash dotnet new console dotnet add package ``` -------------------------------- ### Build Project and Locate DLL (CLI) Source: https://docs.openbullet.dev/docs/lolicode/external-libraries Commands to build a .NET project and navigate to the directory containing the compiled .dll files. These files are then copied to the OpenBullet 2 plugins folder. ```bash dotnet build cd bin/Debug/net8.0/ ``` -------------------------------- ### Run OpenBullet 2 Docker Container Source: https://docs.openbullet.dev/docs/installation/docker This command launches the OpenBullet 2 Docker container, maps ports, and mounts a volume for persistent user data. It ensures that user settings are saved externally and the container can be easily managed. ```bash docker run --name openbullet2 --rm -p 8069:5000 -v C:/OB2/UserData/:/app/UserData/ -it openbullet/openbullet2:latest ``` -------------------------------- ### Run OpenBullet 2 Updater (Linux x64) Source: https://docs.openbullet.dev/docs/updating/update-linux This command executes the OpenBullet 2 web client updater for the Linux x64 architecture. Ensure you are in the main OpenBullet 2 directory before running. ```bash ./ob2-updater-web-linux-x64 ``` -------------------------------- ### Take Multiple Items from Resource (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements TAKE retrieves a specified number of items from a configured resource and assigns them as a list of strings to a variable. The resource must be defined in the 'Data > Resources' section. ```LoliCode TAKE 5 FROM "resourceName" => @myList ``` -------------------------------- ### Logging Messages with Data Logger Source: https://docs.openbullet.dev/docs/lolicode/bot_data Shows how to use the `data.Logger` object to output messages during bot execution. It covers logging simple strings, objects, and lists of strings, with options to specify color and whether to render as HTML. The logger can also be enabled, disabled, or cleared. ```csharp data.Logger.Log("Processing user login.", "#FF0000", true); data.Logger.LogObject(userObject, "blue", false); List errors = new List { "Error 1", "Error 2" }; data.Logger.Log(errors, "red", false); data.Logger.Clear(); ``` -------------------------------- ### Take Single Item from Resource (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements TAKEONE retrieves a single item from a configured resource and assigns it to a specified string variable. The resource must be defined in the 'Data > Resources' section. ```LoliCode TAKEONE FROM "resourceName" => @myString LOG myString ``` -------------------------------- ### Using Regex Class in LoliCode with System.Text.RegularExpressions Source: https://docs.openbullet.dev/docs/lolicode/usings This snippet demonstrates how to use the Regex class from the System.Text.RegularExpressions namespace in LoliCode. It shows the correct 'using' statement to prevent 'type or namespace name could not be found' errors. Requires the 'using' directive for the specified namespace. ```lolicode using System.Text.RegularExpressions string match = new Regex(@"^\d{{4}}").Match(input.DATA).ToString(); CLOG Magenta @match ``` -------------------------------- ### Capturing Variables with Data Marker Source: https://docs.openbullet.dev/docs/lolicode/bot_data Illustrates the use of `data.MarkForCapture` to designate specific variables to be captured at the end of a bot's execution. This is useful for extracting key data points from a process for later analysis or reporting. ```csharp string username = "exampleUser"; data.MarkForCapture("username"); ``` -------------------------------- ### Run OpenBullet 2 Updater (Linux ARM64) Source: https://docs.openbullet.dev/docs/updating/update-linux This command executes the OpenBullet 2 web client updater for the Linux ARM64 architecture. Ensure you are in the main OpenBullet 2 directory before running. ```bash ./ob2-updater-web-linux-arm64 ``` -------------------------------- ### Access Proxy Information in LoliCode / C# Source: https://docs.openbullet.dev/docs/proxies/proxies-for-config-makers In LoliCode and C#, you can access detailed information about the currently used proxy through the `data.Proxy` object. This includes properties like its ID, type, host, port, authentication details, working status, country, ping, usage statistics, and current status (Available, Busy, Bad, Banned). The `data.UseProxy` boolean indicates if a proxy is active. ```C# // Example usage in C# (conceptual) bool useProxy = data.UseProxy; Proxy currentProxy = data.Proxy; if (currentProxy != null) { string host = currentProxy.Host; int port = currentProxy.Port; ProxyStatus status = currentProxy.ProxyStatus; // ... access other properties like Id, Type, Country, Ping, etc. string proxyString = currentProxy.ToString(); // Formats proxy in standard syntax } ``` -------------------------------- ### Accessing Bot Data Properties Source: https://docs.openbullet.dev/docs/lolicode/bot_data Demonstrates how to access various properties of the `data` variable to retrieve information about the current bot's state, HTTP responses, and configuration. This includes accessing response status codes, content, headers, cookies, and proxy details. ```csharp string responseContent = data.SOURCE; int statusCode = data.RESPONSECODE; string proxyHost = data.Proxy.Host; string cookieValue = data.COOKIES["PHPSESSID"]; ``` -------------------------------- ### Store and Access Data in Globals Variable (C#) Source: https://docs.openbullet.dev/docs/lolicode/globals Demonstrates how to store and retrieve data within the `globals` variable, which is a dynamic C# object. This allows for flexible data management across different bots in a job. No external dependencies are required for basic usage. ```csharp globals.myValue = 42; int value = globals.myValue; ``` -------------------------------- ### Default Wordlist Type Syntax in Environment.ini Source: https://docs.openbullet.dev/docs/wordlists/general-info Defines the basic structure for a wordlist type in OpenBullet 2's Environment.ini file. It includes fields for name, regular expression for validation, verification flag, separator character, and slice variable names. ```ini [WORDLIST TYPE] Name=Default Regex=^.* Verify=False Separator= Slices=DATA ``` -------------------------------- ### Set String Variable and Capture (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements SET VAR assigns a string value to a variable. SET CAP assigns a string value and marks it for capture. LOG can then be used to display the variable's content. ```LoliCode SET VAR @myString "variable" LOG myString SET CAP @myCapture "capture" LOG myCapture ``` -------------------------------- ### LoliCode Variable Value Types Source: https://docs.openbullet.dev/docs/lolicode/blocks Demonstrates variable value types in LoliCode, which are references to variables defined elsewhere in the configuration. This is used for dynamic data referencing. ```plaintext Variable: @name ``` -------------------------------- ### Conditional Logic IF ELSE ELSE IF (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements Provides conditional execution pathways. IF checks the initial condition, ELSE IF checks subsequent conditions if prior ones were false, and ELSE executes if no preceding conditions were met. END marks the conclusion of the conditional structure. ```LoliCode IF INTKEY 5 LessThan 1 LOG "nope" ELSE IF INTKEY 5 LessThan 3 LOG "nope again" ELSE LOG "yep" END ``` -------------------------------- ### Set Specific Proxy (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements SET PROXY configures a specific proxy with its address, port, and type (HTTP, SOCKS4, SOCKS4A, SOCKS5). Optional username and password can also be provided. ```LoliCode SET PROXY "127.0.0.1" 9050 SOCKS5 SET PROXY "127.0.0.1" 9050 SOCKS5 "username" "password" ``` -------------------------------- ### Asynchronous Code Execution Lock (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements ACQUIRELOCK and RELEASELOCK are used for asynchronous operations on global variables, ensuring exclusive access. This must be used with TRY-CATCH-FINALLY. The FINALLY block guarantees the lock is released. ```LoliCode ACQUIRELOCK globals TRY // Do some async operation here CATCH throw; // Rethrow any exception FINALLY RELEASELOCK globals END ``` -------------------------------- ### Create Hacker Theme (CSS) Source: https://docs.openbullet.dev/docs/customization/themes This CSS code defines a custom theme named 'hacker.css' for OpenBullet. It allows overriding primary and secondary colors, background colors, and accent colors. It also sets a custom font family for the entire interface. This theme can be uploaded to the web client. ```css :root { /* Override the colors as you please */ --fg-primary: #1a9d1a !important; --fg-light: #31d907 !important; --fg-inactive: #16620d !important; --fg-inactive-light: #22b120 !important; --bg-primary: #0f160e !important; --bg-variable: #202a5e !important; --bg-interpolated: #1f4d2f !important; --fg-accent: #225607 !important; --fg-accent-light: #225607 !important; --bg-secondary: #131e12 !important; --bg-tertiary: #33373a !important; --bg-accent: #090e25 !important; --fg-good: yellowgreen !important; --fg-bad: tomato !important; --fg-custom: darkorange !important; --fg-tocheck: #7fe5ff !important; --fg-banned: #DDA0DD !important; --fg-retry: #FFFF00 !important; --fg-error: rgb(240, 23, 60) !important; --bg-bad: rgb(131, 36, 19) !important; --fg-gold: gold !important; --fg-silver: silver !important; --fg-bronze: rgb(228, 151, 63) !important; --fg-variable: #2a3a8b !important; --fg-interpolated: #287443 !important; } /* Override any other style as you please */ * { font-family: 'Chivo Mono', sans-serif !important; } ``` -------------------------------- ### Conditional Execution While True (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements The WHILE statement executes a block of code as long as a specified condition remains true. The END keyword denotes the end of the conditional block. ```LoliCode WHILE INTKEY 1 LessThan 2 ... END ``` -------------------------------- ### Jump to Code Location (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements The JUMP statement transfers script execution to a specified label. Care must be taken to avoid creating infinite loops. ```LoliCode ... #HERE ... JUMP #HERE ``` -------------------------------- ### Error Handling TRY CATCH (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements The TRY-CATCH block executes code within the TRY section and, if an error occurs, executes the CATCH section. END signifies the end of the block. ```LoliCode TRY // request to an unreliable URL CATCH // fallback request to a reliable URL END ``` -------------------------------- ### Set Proxy Usage (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements SET USEPROXY controls whether the current proxy settings are used for subsequent requests. TRUE enables proxy usage, while FALSE disables it. ```LoliCode SET USEPROXY TRUE SET USEPROXY FALSE ``` -------------------------------- ### Iterate Through List Variable (LoliCode) Source: https://docs.openbullet.dev/docs/lolicode/statements The FOREACH statement iterates over each element in a list variable, assigning the current element to a specified variable for processing within the loop. The END keyword signifies the loop's termination. ```LoliCode BLOCK:ConstantList value = ["one", "two", "three"] => VAR @list ENDBLOCK FOREACH elem IN list LOG elem END ```