### Create Header Cell with VegaDiv (Vega Script) Source: https://context7.com/luxionuo/spherex-vega/llms.txt Demonstrates the use of `VegaDiv` to create styled header cells for dialog tables, replacing extensive traditional Gump code. It shows a shortcut syntax and an example of creating a table header with account-related columns. ```Vega Script // VegaDiv shortcut replaces 6+ lines of traditional gump code VegaDiv 10,10,200,20,Text Example,0 // Traditional equivalent (what VegaDiv replaces): // local.X = 10 // local.Y = 10 // local.Width = 200 // local.Height = 20 // local.String = "Text Example" // local.FontColor = 0 // local.Border = 1 // GumpPicTiled 2702 // GumpPicTiled 2702 // GumpPicTiled +> +1> 2702 // GumpPicTiled +> 2702 // GumpPicTiled +> +> -1> -1> 3004 // DText +4> +2> // Using with local variables (requires 'call') call VegaDiv 10,10,350,20,,50 // Example: Create table header call VegaDiv 10,10,675,20,,48 call VegaDiv 10,35,100,20,Account Name,50 call VegaDiv 110,35,80,20,Status,50 call VegaDiv 190,35,100,20,Actions,50 ``` -------------------------------- ### Configure Vega Shard Customization Settings Source: https://context7.com/luxionuo/spherex-vega/llms.txt Configures Vega to integrate with custom shard mechanics for skills, level, and experience systems. This involves defining the total number of skills and flags for custom systems, along with necessary privilege levels for access and INI editing. Installation steps in `spheretables.scp` are also provided. ```csharp // Vega_ShardCustom.scp configuration [DEFNAME Vega_Shard_Custom] Vega_Custom_Skills 57 // Total number of skills Vega_Custom_LevelSystem 0 // 1 if using custom level system Vega_Custom_LevelSystemTag "" // Tag name for level (e.g., "level") Vega_Custom_ExpSystem 0 // 1 if using custom exp system Vega_Custom_ExpSystemTag "" // Tag name for exp (e.g., "exp") Vega_Custom_IniInfoAccessPlevel 7 // Plevel required to edit INI Vega_Custom_AccessPlevel 4 // Minimum plevel to use Vega // Installation in spheretables.scp // Vega Plugin Vega/Config/ Vega/Core/ Vega/Dialogs/ Vega/Functions/ Vega/Lang/ Vega_ShardCustom.scp // Authorization by privilege level [PLEVEL 4] Vega V ``` -------------------------------- ### Get Total Account Gold Balance (Vega) Source: https://github.com/luxionuo/spherex-vega/wiki/functions The `vGetAccountBalance` function retrieves the total amount of gold across all characters in an account. This provides a consolidated view of the player's wealth. It can be combined with the `Commas` function for enhanced readability. ```Vega ``` ```Vega > ``` -------------------------------- ### Map Custom Functions to Vega Buttons Source: https://context7.com/luxionuo/spherex-vega/llms.txt Maps custom shard functions to six configurable buttons in Vega's advanced panel. This allows users to trigger specific, custom-defined actions via UI buttons. The example shows how button IDs are checked in a dialog handler and linked to corresponding custom functions. ```csharp // Button handlers in main dialog ON=6100 6199 // Custom buttons Src.Vega if ( == 6101) src.f_vega_custom1 elif ( == 6102) src.f_vega_custom2 elif ( == 6103) src.f_vega_custom3 elif ( == 6104) src.f_vega_custom4 elif ( == 6105) src.f_vega_custom5 elif ( == 6106) src.f_vega_custom6 endif // Create custom function [FUNCTION f_vega_custom1] Src.Sysmessage Custom function 1 executed // Add your custom logic here // Examples: spawn specific items, teleport to custom locations, // run custom shard scripts, etc. ``` -------------------------------- ### Get Account Total Balance Function Source: https://context7.com/luxionuo/spherex-vega/llms.txt Calculates the total amount of gold accumulated across all characters within a specific account. The function iterates through characters and sums their gold. ```csharp // Function to get total account gold [FUNCTION vGetAccountBalance] local.AccountBalance = 0 for 0 4 local.AccountBalance += .gold> endfor return // Usage examples // Display with comma formatting > // Example output: "1,234,567" // In dialog display VegaDivSub 365,200,100,20,Gold Account VegaDivSubTrunc 465,200,125,20,">" ``` -------------------------------- ### Create New Account Script Source: https://context7.com/luxionuo/spherex-vega/llms.txt Handles the creation of new player accounts via a dialog interface. It takes username, password, and privilege level as input. Includes security checks to prevent excessive privilege assignment and checks if the account already exists. The UI elements for the dialog are also defined. ```Vega Script // Account creation from dialog (button 500) ON=500 local.Account = local.Password = local.Plevel = if ( > 5) if ( > 4) Src.Sysmessage @33,,1 [Security] You can create an account up to plevel 4 else if !(>) Serv.Account Add Serv.Account plevel Src.Sysmessage Account '' created successfully. serv.log Account '' created successfully. else Src.Sysmessage @33,,1 Account '' already exists. endif endif endif // Dialog interface with text fields VegaDiv 10,378,90,20,Username,50 VegaTextarea 100,378,100,20,53,2,14 VegaDiv 200,378,90,20,Password,50 VegaTextarea 290,378,100,20,53,3,14 VegaDiv 390,378,50,20,Plevel,50 VegaTextarea 440,378,30,20,53,4,1,1 VegaBtn 470,378,Create,500,63 ``` -------------------------------- ### Vega Shortcut for UI Element Creation Source: https://github.com/luxionuo/spherex-vega/wiki/VegaGlobals This PHP code shows how Vega's shortcut library simplifies UI element creation, translating complex traditional code into a single, readable line. It achieves the same result as the traditional method with significantly less code. ```php VegaDiv 10,10,200,20,Text Example,0 ``` -------------------------------- ### Open Vega Main Panel Command Source: https://context7.com/luxionuo/spherex-vega/llms.txt Opens the main Vega assistant interface. This is accessed via the '.vega' or '.v' in-game commands. Programmatically, it uses a function call to display the main dialog. ```csharp // In-game command to open Vega .vega // Alternative short command .v // Programmatic function call [FUNCTION Vega] if !() Serv.NewItem i_mem_Vega New.Tag0.Lang = ENG New.Timer = -1 New.Cont = endif Src.DialogClose d_lux_Vega Src.Dialog d_lux_Vega ``` -------------------------------- ### Traditional GumpPicTiled UI Element Construction Source: https://github.com/luxionuo/spherex-vega/wiki/VegaGlobals This PHP code demonstrates the traditional method of creating a UI element using GumpPicTiled, involving multiple lines to define position, size, and appearance. It sets up various properties like X, Y, Width, Height, and String content before drawing. ```php local.X = 10 local.Y = 10 local.Width = 200 local.Height = 20 local.String = "Text Example" local.FontColor = 0 local.Border = 1 GumpPicTiled 2702 GumpPicTiled 2702 GumpPicTiled +> +1> 2702 GumpPicTiled +> 2702 GumpPicTiled +> +> -1> -1> 3004 DText +4> +2> ``` -------------------------------- ### Open Info Panel Command and Function Source: https://context7.com/luxionuo/spherex-vega/llms.txt Displays detailed information about a targeted character, NPC, item, weapon, or armor. It can be invoked with '.vinfo' to target an object or '.vInfo 04001234' for a specific UID. The function implementation handles targeting or direct UID input. ```csharp // Target an object to view info .vinfo // View info for specific UID Src.vInfo 04001234 // Function implementation [FUNCTION vinfo] if () Src.Ctag0.vInfo_Uid= Src.Dialog d_vega_info else targetf f_vinfo endif // Example: View player stats // Opens dialog showing STR, DEX, INT, resistances, armor, and combat stats // Ref2 = // Displays: , , // Shows resistances: , , ``` -------------------------------- ### Create Button with Text using Vega Source: https://context7.com/luxionuo/spherex-vega/llms.txt Creates interactive buttons with optional text labels. This is used for triggering actions within the UI. The `VegaBtn` function creates a button with text, while `VegaBtnEmpty` creates one without. Button press handling is typically done within dialog handlers. ```csharp // Button with text VegaBtn 10,100,0,Teleport,3001 // Empty button (no text) VegaBtnEmpty 10,120,0,2002 // Example: Action buttons panel VegaDiv 10,180,120,20,Quick Actions,50 VegaBtn 10,200,0,Admin Menu,2001 VegaBtn 10,220,0,Info Panel,2002 VegaBtn 10,240,0,Edit Panel,2003 VegaBtnEmpty 10,260,0,2004 VegaDivSub 30,260,100,20,Show Clients // Button press handling in dialog [DIALOG d_lux_vega BUTTON] ON=3001 Src.tele ON=2002 Src.vInfo ``` -------------------------------- ### Open Edit Menu Command Source: https://context7.com/luxionuo/spherex-vega/llms.txt Opens the editing interface for modifying properties of targeted objects. This command is initiated with '.vedit' and is also accessible from the vInfo panel via button 200. ```csharp // Open edit menu command .vedit // Opens after selecting target // Provides interface to modify object properties // Accessible from vInfo panel via button 200 ``` -------------------------------- ### Using Local Variables with VegaDiv Source: https://github.com/luxionuo/spherex-vega/wiki/VegaDiv To utilize pre-defined local variables within a VegaDiv header, the 'call' keyword must precede the VegaDiv function. This allows dynamic content insertion based on the dialog's local scope. ```vega call VegaDiv 10,10,350,20,,50 ``` -------------------------------- ### Vega Panel Commands Source: https://github.com/luxionuo/spherex-vega/wiki/functions Commands to open different panels within the Vega interface. ```APIDOC ## Vega Panel Commands ### Description These commands are used to open various panels and menus within the Vega interface. ### Method Execute ### Endpoints - `.vega` or `.v` - `.vedit` - `.vinfo` ### Parameters None ### Request Example - `.vega` - `.vedit` - `.vinfo` ### Response Opens the respective Vega panel or menu. ``` -------------------------------- ### Create Text Entry Field with Vega Source: https://context7.com/luxionuo/spherex-vega/llms.txt Creates a multi-line text input area with an optional character limit. This is used for user input fields such as search boxes or forms. The `VegaTextarea` function defines the input area, and its parameters control size, limit, and default text. Input handling is often done in button handlers. ```csharp // Textarea with limit VegaTextarea 100,50,200,20,53,1,16,Default Text // Parameters: x,y,width,height,color,textID,limit,pretext // Set limit to 0 for unlimited text // Example: Search box VegaDiv 10,330,40,20,Find VegaDivSubEmpty 50,330,130,20 VegaTextarea 54,332,126,20,65,1,16 VegaDiv 180,330,20,20 VegaBtnEmpty 180,330,0,200 // Handle text input in button handler ON=200 Src.Ctag0.VegaSearch = 1 Src.Ctag0.VegaAccSearch = // Use entered text for search ``` -------------------------------- ### Super Teleport Function (Vega Script) Source: https://context7.com/luxionuo/spherex-vega/llms.txt An enhanced teleportation function `f_SuperTele` that allows chaining multiple teleport targets. After teleporting to one target, it automatically prompts for the next, facilitating quick navigation between locations. Includes error handling for invalid targets. ```Vega Script [FUNCTION f_SuperTele] TARGETFG t_sub [FUNCTION Supertele_sub] IF () GO ELSEIF () GO ELSE SYSMESSAGE Target not valid ENDIF TARGETFG Supertele_sub // Usage: Opens targeting cursor // Click on character or location to teleport // Automatically prompts for next teleport target // Useful for quick navigation between multiple locations ``` -------------------------------- ### Format Numbers with Commas (Vega) Source: https://github.com/luxionuo/spherex-vega/wiki/functions The `Commas` function formats numerical data by inserting commas as thousands separators. This improves readability for large numbers, such as currency or quantities. It takes a numerical input and returns a string representation. ```Vega > ``` -------------------------------- ### Create Sub Cell with Vega Source: https://context7.com/luxionuo/spherex-vega/llms.txt Creates a secondary styled cell for data rows, supporting plain text and text truncation. It is used to display specific data points within a UI row. The function signatures vary based on whether text is included or truncated. ```csharp // Basic sub cell with text VegaDivSub 10,55,150,20,Player Name,0 // Empty sub cell VegaDivSubEmpty 10,75,150,20 // Sub cell with text truncation (fits text to cell width) VegaDivSubTrunc 235,55,125,20, // Example: Account list display call VegaDivSub 10,30,35,20,1 call VegaDivSub 45,30,40,20, call VegaDivSub 85,30,150,20, call VegaDivSub 235,30,80,20, / call VegaDivSub 350,30,50,20,>) ? Online:Offline>,>) ? 65:35> ``` -------------------------------- ### Commas Source: https://github.com/luxionuo/spherex-vega/wiki/functions Formats numbers with comma separators for better readability. ```APIDOC ## Commas ### Description This function formats numerical values by adding comma separators, making large numbers easier to read. For example, it transforms `198374` into `198,374`. ### Method Read Only ### Endpoint `Commas ` ### Parameters #### Path Parameters - **Value** (Number/Reference) - Required - The number or reference to a number that needs formatting. ### Request Example `>` ### Response #### Success Response (200) - **formatted_number** (String) - The input number formatted with comma separators. ``` -------------------------------- ### VegaDiv Function Signature and Basic Usage Source: https://github.com/luxionuo/spherex-vega/wiki/VegaDiv The VegaDiv function creates a header cell in Vega Dialog. It requires parameters for position (x, y), dimensions (width, height), text content, and color. This is a fundamental building block for structured table headers. ```vega VegaDiv 10,10,350,20,Information,50 ``` -------------------------------- ### AccountIsOnline Source: https://github.com/luxionuo/spherex-vega/wiki/functions Checks if any character in the account is currently online. ```APIDOC ## AccountIsOnline ### Description Returns a value indicating whether one of the characters associated with the account is currently playing. ### Method Read Only ### Endpoint `AccountIsOnline ` ### Parameters #### Path Parameters - **Account** (Reference) - Required - The account reference to check. ### Request Example `>` ### Response #### Success Response (200) - **return value** (Integer) - Returns 1 if a character is online, 0 otherwise. ``` -------------------------------- ### vGetAccountBalance Source: https://github.com/luxionuo/spherex-vega/wiki/functions Retrieves the total gold balance for all characters in an account. ```APIDOC ## vGetAccountBalance ### Description Returns the sum of all gold across all characters within a given account. This value can be further formatted using the `Commas` function for improved readability. ### Method Read Only ### Endpoint `vGetAccountBalance` ### Parameters None ### Request Example `` ### Response #### Success Response (200) - **total_gold** (Number) - The total amount of gold in the account. ### Usage Example with Commas `>` ``` -------------------------------- ### Format Numbers with Commas (Vega Script) Source: https://context7.com/luxionuo/spherex-vega/llms.txt A utility function that formats large numbers by inserting commas as thousands separators, improving readability. It is used in conjunction with UI elements to display formatted numerical data. ```Vega Script // Function usage > // Input: 198374 // Output: "198,374" // Example with account balance > // Input: 5000000 // Output: "5,000,000" // Display in dialog VegaDivSub 365,200,100,20,Gold Bank VegaDivSubTrunc 465,200,125,20,">" // Shows: "Gold Bank: 1,234,567" ``` -------------------------------- ### Super Remove Function (Vega Script) Source: https://context7.com/luxionuo/spherex-vega/llms.txt An enhanced remove command `f_SuperRemove` that continuously prompts for objects to remove. It uses a targeting cursor and automatically prompts for the next target after removal. A safety check prevents the accidental removal of player characters. ```Vega Script [FUNCTION f_SuperRemove] TARGETFG SuperRemove_sub [FUNCTION SuperRemove_sub] IF ( && !) ARGO.remove ENDIF TARGETFG SuperRemove_sub // Usage: Opens targeting cursor // Click on items or NPCs to remove them // Automatically prompts for next target // Safety check prevents removing player characters // Useful for bulk cleanup operations ``` -------------------------------- ### Check Account Online Status Function Source: https://context7.com/luxionuo/spherex-vega/llms.txt Determines if any character within a given account is currently logged in. It iterates through the characters associated with an account to check their online status. ```csharp // Function to check if account is online [FUNCTION AccountIsOnline] local.Account = if (.Chars> > 0) for 0 .Chars>-1> if (.Char..IsOnline>) local.AccountOnline = 1 endif endfor if () return 1 else return 0 endif else return 0 endif // Usage example > // Returns: 1 if online, 0 if offline // Display in dialog call VegaDivSub 350,50,50,20,>) ? Online:Offline>,>) ? 65:35> ``` -------------------------------- ### Check Account Online Status (Vega) Source: https://github.com/luxionuo/spherex-vega/wiki/functions The `AccountIsOnline` function checks if any character within a specified account is currently playing. It returns a boolean value, 1 for online and 0 for offline. This is useful for real-time status monitoring. ```Vega > ``` -------------------------------- ### Round Up Numbers Function (Vega Script) Source: https://context7.com/luxionuo/spherex-vega/llms.txt Implements a function `F_ROUND_UP` that rounds any positive number up to the nearest whole number. It handles floating-point arithmetic to achieve the ceiling effect. This is useful for calculations involving divisions where a whole number result is needed. ```Vega Script [FUNCTION F_ROUND_UP] IF > < RETURN 1 else LOCAL.INT = >> ENDIF IF (/> > ) RETURN ) + 1>> else RETURN ENDIF // Usage example local.TotalPages = /15>> // Input: 47 accounts / 15 = 3.13 // Output: 4 pages ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.