Function Reference
From Sputnik Wiki
(Difference between revisions)
(→Misc) |
(→Misc) |
||
Line 514: | Line 514: | ||
* [[Core Function FileSize|FileSize( <file> )]] -- Returns the file size in bytes | * [[Core Function FileSize|FileSize( <file> )]] -- Returns the file size in bytes | ||
* [[Core Function FileIsText|FileIsText( <file>, <length> )]] -- Returns true if the file contains only text | * [[Core Function FileIsText|FileIsText( <file>, <length> )]] -- Returns true if the file contains only text | ||
− | * [[Core Function FileRecycleEmpty|FileRecycleEmpty( < | + | * [[Core Function FileRecycleEmpty|FileRecycleEmpty( <root> )]] -- Empty the recycle bin with no GUI, sound or confirmation |
− | * [[Core Function FileRecycle|FileRecycle( < | + | * [[Core Function FileRecycle|FileRecycle( <filename> )]] -- Move a file or directory to the recycle bin |
===== Dialogs ===== | ===== Dialogs ===== |
Revision as of 22:20, 16 September 2013
Function Reference
How to create a Function
To create your own funtions see the Function page.
Core Functions
If a link is red (unclickable) the function either doesnt exist yet and is pending creation or it has been created but does not yet have a page/example.
Language Features
- <Expression> =~ tr/searchList/replacementList/flags -- Translate characters from one character set to another similar to StrTr() function
- <Expression> =~ m/pattern/flags -- Match a string to a regular expression pattern and check if it matches and optionally return captured groups
- <Expression> =~ s/pattern/replacement/flags -- Replace parts of a string using a regular expression pattern and optionally executing functions on the matched groups
- Goto Label; & Label: -- Jump to another section of the script
- <Scope> List( <expressions>, .. ) = <array> -- Extract some elements from an array into ready to use variables
- Parser Engine -- Parse text and have classes created and returned to you
- Array Splicing -- Copy parts out of an array and return them as a new array
Console Functions
- Echo( ) -- Alias for Print( )
- Say( ) -- Alias for Println( )
- Print( <expression> ) -- Prints an expressions string value to the console window
- Println( <expression> ) -- Prints an expressions string value to the console window and inserts a newline character at the end.
- Printf( <expression>, <expressions>... ) -- Print a formatted string (similar to the C printf() function)
- VPrintf( <expression>, <expressions>... ) -- Print a formatted string (similar to the C printf() function) using an array as the parameters
- PrintfC( <format control>, <params> ) -- Print a formatted string to the console window
- Input( <expression> ) -- Capture a string typed to console window
- InputC( <expression> ) -- Capture a char typed to console window
- Pause( <expression> ) -- Pause the execution of the script on the console window until any key is pressed
- Cls( ) -- Alias for ConsoleClear( )
- ConsoleClear( ) -- Clear all text from the console window
- ConsoleHide( ) -- Hide the console window
- ConsoleShow( ) -- Show the console window
- ConsoleState( ) -- Get the console state (Visible, Hidden)
- ConsoleBeep( <freq>, <duration> ) -- Plays the sound of a beep of a specified frequency and duration through the console speaker
- ConsoleSeek( <x>, <y> ) -- Set the position of the console cursor
- ConsoleBackColour( <colour> ) -- Set the background (behind text) colour of the console
- ConsoleForeColour( <colour> ) -- Set the foreground (text) colour of the console
- ConsoleBufferWidth( <newval> ) -- Get or Set the buffer width of the console window
- ConsoleBufferHeight( <newval> ) -- Get or Set the buffer height of the console window
- ConsoleWidth( <newval> ) -- Get or Set the width of the console window
- ConsoleHeight( <newval> ) -- Get or Set the height of the console window
- ConsoleTitle( <newtitle> ) -- Get or Set the title of the console window
- ConsoleCursorLeft( <newval> ) -- Gets or sets the column position of the cursor within the buffer area
- ConsoleCursorTop( <newval> ) -- Gets or sets the row position of the cursor within the buffer area
- ConsoleCursorSize( <newval> ) -- Gets or sets the height of the cursor within a character cell
- ConsoleCursorVisible( <newval> ) -- Gets or sets a value indicating whether the cursor is visible
Multi-Threading Functions
- ThreadCreate( <name>, <function>, <extra> ) -- Create a new thread and start it off executing a function or some code
- ThreadSleep( <name> ) -- Freeze a thread and make it sleep
- ThreadResume( <name> ) -- Unfreeze a thread and allow it to continue execution
- ThreadState( <name> ) -- Returns state of a thread
- ThreadKill( <name> ) -- Terminate a thread and remove it from the script
- ThreadExists( <name> ) -- Check if a thread exists by this name
- ThreadName( ) -- Returns the name of the current thread that is executing this code
- ThreadLock( <lockname> ) {} -- Locks a given section of code allowing only one thread to execute it at a time
- Threads( ) -- Return an array of all threads
Variable Type Conversions
- Bool( <expression> ) -- Returns the TRUE(1) or FALSE(0) representation of an expression
- Char( <expression> ) -- Returns the single letter representation of an expression
- Byte( <expression> ) -- Returns the unsigned 8-bit integer (whole number) representation of an expression
- SByte( <expression> ) -- Returns the signed 8-bit integer (whole number) representation of an expression
- Short( <expression> ) -- Returns the signed 16-bit integer (whole number) representation of an expression
- Int16( <expression> ) -- Returns the signed 16-bit integer (whole number) representation of an expression
- Int32( <expression> ) -- Returns the signed 32-bit integer (whole number) representation of an expression
- Int( <expression> ) -- Returns the signed 32-bit integer (whole number) representation of an expression
- Int64( <expression> ) -- Returns the signed 64-bit integer (whole number) representation of an expression
- Long( <expression> ) -- Returns the signed 64-bit integer (whole number) representation of an expression
- UShort( <expression> ) -- Returns the unsigned 16-bit integer (whole number) representation of an expression
- UInt16( <expression> ) -- Returns the unsigned 16-bit integer (whole number) representation of an expression
- UInt32( <expression> ) -- Returns the unsigned 32-bit integer (whole number) representation of an expression
- UInt( <expression> ) -- Returns the unsigned 32-bit integer (whole number) representation of an expression
- UInt64( <expression> ) -- Returns the unsigned 64-bit integer (whole number) representation of an expression
- ULong( <expression> ) -- Returns the unsigned 64-bit integer (whole number) representation of an expression
- Ptr( <expression> ) -- Returns the signed pointer representation of an expression
- IntPtr( <expression> ) -- Returns the signed pointer representation of an expression
- UPtr( <expression> ) -- Returns the unsigned pointer representation of an expression
- UIntPtr( <expression> ) -- Returns the unsigned pointer representation of an expression
- Float( <expression> ) -- Returns the 32-bit floating point representation of an expression
- Double( <expression> ) -- Returns the 64-bit floating point representation of an expression
- String( <expression> ) -- Returns the String representation of an expression
Common Variable Functions
Misc
- Unset( $variable ) -- Delete a variable
- Ref( $variable ) -- Retrieve the variable at the lowest depth in references that the current variable links to
- IsDeclared( <variable name>, <flag> ) -- Check if a variable has been declared
- Printr( $variable, <newline>, <flag> ) -- Prints all details about a variable in a way thats easy for humans to read it (Will print arrays etc)
- VarDump( $variable, <newline> ) -- Dumps information about a variable
- Assign( <varname>, <data>, <flag> ) -- Assigns a variable by name with the data
- Atof( <variable>, <count>, <start> ) -- Convert string to Double
- Atoi( <variable>, <count>, <start> ) -- Convert string to Int32
- Atol( <variable>, <count>, <start> ) -- Convert string to Int64
- StrTol( <variable>, <count>, <base>, <start> ) -- Convert string to Int64
- StrToul( <variable>, <count>, <base>, <start> ) -- Convert string to UInt64
- IsNan( <variable> ) -- Check if a floating pointer value is NaN (Not a number)
- IsInf( <variable> ) -- Check if a floating pointer value is Infinity
- IsPosInf( <variable> ) -- Check if a floating pointer value is Positive-Infinity
- IsNegInf( <variable> ) -- Check if a floating pointer value is Negative-Infinity
- IsNormal( <variable> ) -- Check if a floating pointer value is neither NaN, PosInf, NegInf or Inf
- SignBit( <variable> ) -- Returns whether the sign of a variable is negative
Type Checking
- isVarChar( $variable ) -- Checks if a variable is a char type
- isVarBool( $variable ) -- Checks if a variable is a boolean type
- isVarByte( $variable ) -- Checks if a variable is an unsigned 8-bit integer type
- isVarSByte( $variable ) -- Checks if a variable is a signed 8-bit integer type
- isVarShort( $variable ) -- Checks if a variable is a signed 16-bit integer type
- isVarInt16( $variable ) -- Checks if a variable is a signed 16-bit integer type
- isVarInt( $variable ) -- Checks if a variable is a signed 32-bit integer type
- isVarInt32( $variable ) -- Checks if a variable is a signed 32-bit integer type
- isVarInt64( $variable ) -- Checks if a variable is a signed 64-bit integer type
- isVarLong( $variable ) -- Checks if a variable is a signed 64-bit integer type
- isVarUShort( $variable ) -- Checks if a variable is an unsigned 16-bit integer type
- isVarUInt16( $variable ) -- Checks if a variable is an unsigned 16-bit integer type
- isVarUInt( $variable ) -- Checks if a variable is an unsigned 32-bit integer type
- isVarUInt32( $variable ) -- Checks if a variable is an unsigned 32-bit integer type
- isVarUInt64( $variable ) -- Checks if a variable is an unsigned 64-bit integer type
- isVarULong( $variable ) -- Checks if a variable is an unsigned 64-bit integer type
- isVarFloat( $variable ) -- Checks if a variable is a single precision floating point type
- isVarFP( $variable ) -- Checks if a check if a variable type is only a float/double nothing else
- isVarDouble( $variable ) -- Checks if a variable is a double precision floating point type
- isVarPtr( $variable ) -- Checks if a variable is an signed pointer type
- isVarIntPtr( $variable ) -- Checks if a variable is an signed pointer type
- isVarUPtr( $variable ) -- Checks if a variable is an unsigned pointer type
- isVarUIntPtr( $variable ) -- Checks if a variable is an unsigned pointer type
- isVarString( $variable ) -- Checks if a variable is a string type
- isVarNumber( $variable ) -- Checks if a variable is any integer or float/double type
- isVarNull( $variable ) -- Checks if a variable is null
- isVarBinary( $variable ) -- Checks if a variable is a binary type
- isVarFunction( $variable ) -- Checks if a variable is a function type
- isVarRef( $variable ) -- Check if a variable is an reference to another variable
- isVarArray( $variable ) -- Check if a variable is an array
- isVarObj( $variable, <type> ) -- Check if a variable is an object type (This includes classes, file handles etc)
- isVarClass( $variable, <type> ) -- Check if a variable's object type is a class
- isVarDLLStruct( $variable ) -- Check if a variable holds a DLLStruct
- isVarGUIObject( $variable ) -- Check if a variable holds a GUI Object
- isVarServer( $variable ) -- Check if a variable holds a Server object from Listen()
- isVarClient( $variable ) -- Check if a variable holds a Client object from Connect()
- isVarClientSocket( $variable ) -- Check if a variable holds a Client socket object
- isVarSocket( $variable ) -- Check if a variable holds a Socket object
- isVarSigned( $variable ) -- Check if a variable holds a signed integer
- isVarUnsigned( $variable ) -- Check if a variable holds an unsigned integer
Get Type Directly
- GetVarType( $variable ) -- Get the common type of a variable
- GetVarTypeName( $variable ) -- Get the common type of a variable (as a string)
- GetVarObjType( $variable ) -- Get the common object type of a variable (If it is an object)
- GetVarObjTypeName( $variable ) -- Get the common object type of a variable (If it is an object) and return it as string
- GetVarGUIObjType( $variable ) -- Get the common object type of a variable (If it is a GUI object)
Binary Data Management Functions
- Pack( <expression>, <expressions> ) -- Pack data into a binary array
- Unpack( <expression>, <binary-array> ) -- Unpack data from a binary array
- BinaryCreate( <size>, <fill> ) -- Create a new binary variable and its array size and fill data type
- BinaryClone( <binary-array> ) -- Clone a binary variable 100% and return a new binary variable with exactly same data as the old one
- BinaryWipe( <binary-array> ) -- Wipes a binary variables data 100% and sets the variable to a blank int containing null
- BinaryStr( <binary-array>, <separator> ) -- Create a Hex string from a binary array
- BinaryHex( <expression>, <flag> ) -- Create a binary array from a hex string
- BinaryLen( <binary-array> ) -- Returns the number of bytes in a binary variable
- BinaryGet( <binary-array>, <index> ) -- Get the byte at an index of a binary variable
- BinarySet( <binary-array>, <index>, <value> ) -- Set the byte at an index of a binary variable
- BinaryReverse( <binary-array>, <start>, <length> ) -- Reverse the order bytes a binary variable
- BinaryMid( <binary-array>, <start>, <length> ) -- Create a binary variable by extracting a number of bytes from another binary variable
- BinaryAppend( <binary-array>, <binary-array2>, <flag> ) -- Append a binary variables data onto the end or beginning of another binary variables data
- BinaryInsert( <binary-array>, <binary-array2>, <index>, <overwrite> ) -- Insert a binary variables data into another binary variable at a specific location
- BinaryUnshift( <binary-array>, <byte> ) -- Add a byte to the beginning of a binary variable
- BinaryPush( <binary-array>, <byte> ) -- Add a byte to the end of a binary variable
- BinaryShift( <binary-array> ) -- Delete the first byte from a binary variable
- BinaryPop( <binary-array> ) -- Delete the last byte from a binary variable
- BinaryResize( <binary-array>, <size>, <data> ) -- Resize a binary variables data array
- BinarySHA1( <binary-array> ) -- Returns the SHA1 hash of a binary variable
- BinaryMD5( <binary-array> ) -- Returns the MD5 hash of a binary variable
- BinaryCompare( <binary-array>, <binary-array2> ) -- Compare two binary variables
- BinaryCompress( <binary-array> ) -- Compress a binary variables data
- BinaryUncompress( <binary-array> ) -- Uncompress a binary variable data
- BinarySave( <binary-array>, <file>, <flag> ) -- Save a binary variable data to file
- BinaryLoad( <file>, <flag> ) -- Create a new binary variable by loading binary data from a file
Binary Memory Stream Management Functions
- StreamCreate( ) -- Create a new binary stream
- StreamCreateB( <binary-stream>, <binary-array> ) -- Create a new binary stream from a binary variable
- StreamLen( <binary-stream> ) -- Get the length of a binary stream
- StreamSetLen( <binary-stream>, <length> ) -- Set the length of a binary stream
- StreamPos( <binary-stream> ) -- Get the current seek position of a binary stream
- StreamSeek( <binary-stream>, <pos> ) -- Set the seek position of a binary stream
- StreamCompare( <binary-stream>, <binary-stream2> ) -- Compare two binary streams to see if they are identical in data content
- StreamRead( <binary-stream>, <count> ) -- Read a number of bytes from a binary stream
- StreamReadByte( <binary-stream> ) -- Read a single byte from a binary stream
- StreamReadUnpack( <binary-stream>, <count>, <def> ) -- Read from a binary stream the same way Unpack() is used
- StreamWrite( <binary-stream>, <binary-array> ) -- Write the bytes from a binary variable to the binary stream
- StreamWriteByte( <binary-stream>, <binary-array> ) -- Write a single byte to the binary stream
- StreamWritePack( <binary-stream>, <def>, <params> ) -- Write a data to the binary stream the same way Pack() is used
- StreamToBinary( <binary-stream> ) -- Return a new binary variable from the data within the binary stream
- StreamSave( <binary-stream>, <file>, <flag> ) -- Save the binary stream to file
- StreamLoad( <file>, <flag> ) -- Load a binary stream from file
Math Functions
- Abs( <expression> ) -- Calculates the absolute value of a number
- ACos( <expression> ) -- Calculates the arcCosine of a number
- ASin( <expression> ) -- Calculates the arcsine of a number
- ATan( <expression> ) -- Calculates the arctangent of a number
- ATan2( <expression>, <expression2> ) -- Compute arc tangent with two parameters
- BaseConv( <number>, <frombase>, <tobase> ) -- Convert a number between arbitrary bases
- BitAND( <expression>, <expression2>, <n> ) -- Performs a bitwise AND operation
- BitNOT( <expression> ) -- Performs a bitwise NOT operation
- BitOR( <expression>, <expression2>, <n> ) -- Performs a bitwise OR operation
- BitSHIFT( <value>, <shift> ) -- Performs a bit shifting operation
- BitTripleSHIFT( <value>, <shift> ) -- Performs a triple bit shifting operation
- BitXOR( <expression>, <expression2>, <n> ) -- Performs a bitwise exclusive OR (XOR) operation
- BitROTATE( <expression>, <shift>, <size> ) -- Performs a bit shifting operation, with rotation
- Ceiling( <expression> ) -- Returns a number rounded up to the next integer
- Cos( <expression> ) -- Calculates the cosine of a number
- Cosh( <expression> ) -- Returns the hyperbolic cosine of the specified angle
- Exp( <expression> ) -- Returns e raised to the specified power
- Floor( <expression> ) -- Returns the largest integer less than or equal to the specified number
- IntToRom( <expression> ) -- Returns the roman numerical value of an integer
- Log( <expression> ) -- Returns the logarithm of a specified number
- Log10( <expression> ) -- Returns the common (base-10) logarithm of a specified number
- Math( <expression> ) -- Parse a string containing mathematical equations
- Max( <expression>, <expression2> ) -- Find the greater number and return it
- Min( <expression>, <expression2> ) -- Find the lesser number and return it
- Mod( <expression>, <expression2> ) -- Performs the modulus operation
- Modf( <x>, <intpart> ) -- Breaks x into an integral and a fractional part
- MatlabMod( <expression>, <expression2> ) -- Performs the Matlab modulus operation
- Pow( <expression>, <expression2> ) -- Returns a specified number raised to the specified power
- Random( <expression>, <expression2> ) -- Get a random number from the defined area.
- Round( <expression>, <decimalplaces> ) -- Returns a number rounded to a specified number of decimal places
- RomToInt( <expression> ) -- Returns the integer value of a roman numerical sequence
- Sin( <expression> ) -- Returns the sine of the specified angle
- Sinh( <expression> ) -- Returns the hyperbolic sine of the specified angle
- Sqrt( <expression> ) -- Returns the square root of a specified number
- Sum( <expressions> ) -- Returns the sum of all the parameters
- Tan( <expression> ) -- Returns the tangent of the specified angle
- Tanh( <expression> ) -- Returns the hyperbolic tangent of the specified angle
- Truncate( <expression> ) -- Calculates the integral part of a specified decimal number
String Functions
- AddCSlashes( <str>, <charlist> ) -- Escape a string with slashes in a C style
- Asc( <char> ) -- Returns the ASCII code of a character
- AscW( <char> ) -- Returns the UNICODE code of a character
- AscArray( <char> ) -- Returns an array of ASCII characters of a string
- AscWArray( <char> ) -- Returns an array of UNICODE characters of a string
- Between( <haystack>, <firstneedle>, <secondneedle>, <case> ) -- Return the text between a start and end substring
- BCrypt( <expression>, <rounds> ) -- Hash a string (usually password) with BCrypt.
- BCryptVerify( <expression>, <hash> ) -- Verify a hash to a string (usually password) with BCrypt.
- ChunkSplit( <body>, <chunklen>, <end> ) -- Split a string into smaller chunks
- Chr( <expression> ) -- Returns a character corresponding to an ASCII code
- ChrW( <expression> ) -- Returns a character corresponding to an UNICODE code
- ChrArray( <expression> ) -- Returns a string corresponding to an array ASCII codes
- ChrWArray( <expression> ) -- Returns a string corresponding to an array UNICODE codes
- Contains( <srting>, <string>, <casesense>) -- Check if string contains a sub string
- CountFields( <string>, <delim>, <quote>, <quoteescape>, <comment>, <trimtype> ) -- Returns the number of values (fields) in the string passed that are separated by the separator string passed
- CSV( <string>, <delim>, <quote>, <quoteescape>, <comment>, <trimtype> ) -- Split strings and parse a CSV text into an array
- Dec( <expression> ) -- Returns a integer representation of a hexadecimal string
- FDec( <expression> ) -- Returns a float representation of a hexadecimal string
- DDec( <expression> ) -- Returns a double representation of a hexadecimal string
- DecPad( <expression>, <count> ) -- Pads numeric string to a given number of chars (Filling in the gap with zeros)
- DecryptString( <expression>, <password> ) -- Decrypt a string with a given password
- Decode64( <expression>, <strict> ) -- Decodes string with MIME base64
- Encode64( <expression> ) -- Encodes string with MIME base64
- Escape( <expression>, <custom> ) -- Add escapes to a string
- EncryptString( <expression>, <password> ) -- Encrypt a string with a given password
- EndsWith( <expression>, <expression2>, <flag> ) -- Check if a string ends with a substring
- Hash( <expression> ) -- Generate a unique hash code for a string value
- Hex2Str( <expression>, <flag> ) -- Convert a hex string back to a normal string
- Hex( <expression>, <length> ) -- Returns a string representation of an integer type converted to hexadecimal
- Fmt( <format control>, <params> ) -- Create a formatted string
- FHex( <expression> ) -- Returns a string representation of an float type converted to hexadecimal
- DHex( <expression> ) -- Returns a string representation of an double type converted to hexadecimal
- InStr( <string>, <substirng>, <casesense>, <occurrence>, <start> ) -- Checks if a string contains a given substring.
- isAlpha( <expression> ) -- Checks if string contains only Alphabetic characters
- isAlphaNumeric( <expression> ) -- Checks if string contains only AlphaNumeric(A-Z, 0-9), Characters
- isASCII( <expression> ) -- Check if string contains only ASCII chars
- isControl( <expression> ) -- Check if string contains only control chars
- isEmpty( <expression> ) -- Checks if a string is completely empty
- isEmptyOrNull( <expression> ) -- Checks if a string is completely empty or if the variable is null or if the variable translates to false (zero)
- isDigit( <expression> ) -- Checks if string only contains numbers
- isFloat( <expression> ) -- Check if string contains a floating point and could be converted
- isLower( <expression> ) -- Checks if string contains only lowercase letters
- isNumeric( <expression> ) -- Checks if string only contains numbers (Allows for float/double)
- isSpace( <expression> ) -- Check if string contains only whitespace
- isSymbol( <expression> ) -- Check if string contains only symbol chars
- IsPunctuation( <expression> ) -- Check if string contains only characters categorized as a punctuation marks
- IsSeparator( <expression> ) -- Check if string contains only characters categorized as a separator character
- IsBlank( <expression> ) -- Check if string contains only spaces and tabs
- isString( <expression> ) -- Check if variable contains only string chars
- isUpper( <expression> ) -- Check if string contains only uppercase chars
- isXDigit( <expression> ) -- Check if string contains only hex chars
- IndexOf( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the first occurrence of the specified string in a string
- IndexOfAny( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the first occurrence of any characters or array of strings in a specified string
- IndexNotOf( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the first none occurrence of the specified string in the current string
- IndexNotOfAny( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the first none occurrence of any characters or array of strings in a specified string
- LastIndexOf( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the last occurrence of the specified string in the current string
- LastIndexOfAny( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the last occurrence of any characters or array of strings in a specified string
- LastIndexNotOf( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the last none occurrence of the specified string in the current string
- LastIndexNotOfAny( <expression>, <needle>, <pos>, <case>, <count> ) -- Reports the index of the last none occurrence of any characters or array of strings in a specified string
- LC( <expression> ) -- Returns string in all lower case
- LCFirst( <expression> ) -- Lower Cases first letter of string
- LCLast( <expression> ) -- Lower Cases last letter of string
- LCWords( <expression> ) -- Lower Cases first letter of each word in string
- Left( <expression>, <count> ) -- Returns a number of characters from the left-hand side of a string
- Lines( <expression> ) -- Returns an array containing all the lines from a string
- Match( <expression>, <charset>, <case> ) -- Check if a string contains only characters from a substring(charset)
- MatchDel( <expression>, <charset>, <case> ) -- Delete all characters found in the charset from a string
- MD5( <expression> ) -- Creates MD5 Hash of specified string
- NthField( <string>, <delim>, <index>, <quote>, <quoteescape>, <comment>, <trimtype> ) -- Returns a field from a row of data (such as comma separated text)
- PadLeft( <expression>, <pad>, <count> ) -- Pad the left of a string a given number of times with another string
- PadRight( <expression>, <pad>, <count> ) -- Pad the right of a string a given number of times with another string
- RandStr( <count>, <allowEscapes>, <allowVariables>, <allowCode> ) -- Generate a random sequence of characters at a given length
- RegexMatch( <expression>, <pattern>, <matches>, <offset> ) -- Perform a regular expression match
- RegexReplace( <expression>, <pattern>, <replacement>, <limit>, <count>, <offset> ) -- Perform a regular expression search and replace
- RegexEscape( <expression>, <delimiter> ) -- Escape regular expression characters
- RegexUnescape( <expression> ) -- Remove any escapes regular expression characters
- ResolveStr( <expression> ) -- Treat a given string as if it was a Sputnik "string" and parse all stuff inside it such as $variables etc
- Repeat( <expression>, <count>, <flag> ) -- Create a new string or new array containing repeats of a string provided
- Replace( <expression>, <find>, <replace>, <case-sensitive-flag> ) -- Replace substrings within a string with other strings
- Reverse( <expression> ) -- Reverse all characters in a string
- RevHex( <expression> ) -- Reverse a string of hex digits
- Right( <expression>, <count> ) -- Returns a number of characters from the right-hand side of a string
- Scanf( <expression>, <def> ) -- Parses input from a string according to a format
- SHA1( <expression> ) -- Returns SHA1 hash of string
- SimilarText( <first>, <second>, <percent> ) -- Calculates the similarity between two input strings and return a percentage of the matching between the two input strings
- Split( <expression>, <delim/pattern>, <flag> ) -- Splits up a string into substrings depending on the given delimiters.
- SPrintf( <format control>, <params>... ) -- Returns a formatted string (similar to the C sprintf() function)
- StartsWith( <expression>, <expression2>, <flag> ) -- Check if a string starts with a substring
- StrChr( <haystack>, <char>, <start> ) -- Locate first occurrence of character in string
- StrrChr( <haystack>, <char>, <start> ) -- Locate last occurrence of character in string
- Strpbrk( <haystack>, <needle>, <start> ) -- Locate a list of possible characters in string and return the position of it
- StripCSlashes( <str> ) -- Unescape string escaped with AddCSlashes()
- StripWS( <str>, <flags>, <charList> ) -- Strips the white space in a string or given characters.
- StrSpn( <subject>, <mask>, <start>, <length> ) -- Finds the length of the initial segment of a string consisting entirely of characters contained within a given mask
- StrCSpn( <subject>, <mask>, <start>, <length> ) -- Find length of initial segment not matching mask
- StrCmp( <str1>, <str2>, <ignoreCase> ) -- String comparison
- StrNatCmp( <str1>, <str2>, <ignoreCase> ) -- String comparisons using a "natural order" algorithm
- StrVersCmp( <str1>, <str2>, <ignoreCase> ) -- String comparison holding name and indices/version numbers
- Str2Hex( <expression>, <flag> ) -- Convert a string to a hex string
- StrInsert( <expression>, <index>, <expression2> ) -- Insert a string at a given index of another string and return the new string
- StrIndex( <expression>, <index>, <value> ) -- Get or set a char from/to a string at a specific index
- StrPos( <haystack>, <needle>, <offset>, <flags> ) -- Find the position of the first/last occurrence of a substring in a string
- StrTr( <str>, <from> <to>, <replace_pairs> ) -- Translate characters or replace substrings
- StrStr( <haystack>, <needle>, <before_needle>, <find_last>, <case> ) -- Find the first/last occurrence of a string
- StrLen( <expression> ) -- Returns length of specified string
- SubStr( <expression>, <start>, <end> ) -- Return part of a string
- SubStrCount( <expression>, <expression2>, <offset>, <length>, <flag> ) -- Count the number of substring occurrences
- SubStrReplace( <expression>, <replacement>, <start>, <length> ) -- Replace text within a portion of a string
- StrSplit( <expression>, <split_length>, <flag> ) -- Convert a string to an array
- StrCompress( <expression> ) -- Compress a string
- StrUncompress( <expression> ) -- Uncompress a string
- Trim( <expression>, <chars> ) -- Removes whitespace from the beginning and end of a string
- TrimLeft( <expression>, <chars> ) -- Strip whitespace from the start of a string
- TrimRight( <expression>, <chars> ) -- Strip whitespace from the end of a string
- UC( <expression> ) -- Returns string in all Upper Case
- UCFirst( <expression> ) -- Upper Cases first letter of string
- UCLast( <expression> ) -- Upper Cases last letter of string
- UCWords( <expression> ) -- Upper Cases first letter of each word in string
- Unescape( <expression>, <custom> ) -- Remove all escapes from a string
- VSPrintf( <format control>, <params>... ) -- Returns a formatted string (similar to the C sprintf() function) but accepts arrays as the arguments
- WordWrap( <str>, <width>, <break>, <cut> ) -- Wraps a string to a given number of characters
CharPtr Functions
Note the Fixed statement is tied directly with CharPtr
- StrNew( <char>, <length>, <flag> -- Create a new string of a given length filled with a given char (or optionally return it as a CharPtr rather than a new string)
- CharCopy( <dest>, <src>, <length> ) -- Copy a length of characters from the source pointer to the destination pointer
- CharCopyRev( <dest>, <src>, <length> ) -- Copy a length of characters from the source pointer to the destination pointer (in reverse so Hello becomes olleH)
Array Functions
- IsHash( <expressions> ) -- Check if all the keys in an array are Strings rather than numeric (Making it a full hashmap rather than full array or mixed)
- Array( <expressions> ) -- Create a new array
- Join( <array>, <separator> ) -- Join an array into a string with an optional separator
- JoinKV( <array>, <separator> ) -- Join an array (as keys and values) into a string with an optional separator
- Count( <array/binary-array> ) -- Returns the size of array (How many elements it currently has stored)
- UBound( <array/binary-array> ) -- Returns the index of the highest element in an array
- LBound( <array/binary-array> ) -- Returns the index of the lowest element in an array
- Push( <array>, <expressions> ) -- Add items to the end of an array
- Insert( <array>, <id>, <expressions> ) -- Add items to an array at a given location
- InsertArray( <array>, <id>, <arrays> ) -- Add arrays to an array at a given location
- Unshift( <array>, <expressions> ) -- Add items to the beginning of an array
- Pop( <array> ) -- Delete the last item in an array
- Shift( <array> ) -- Delete the first item in an array
- Remove( <array>, <start-id>, <end-id> ) -- Delete items from an array starting at a given location and stopping at a given location
- IsIndexSet( <array>, <index> ) -- Check if an element exist at a given index ID within an array
- Grep( <array>, <pattern>, <flag> ) -- Returns a new array consisting of the elements of the input arrays values that match the given regex pattern
- GrepKeys( <array>, <pattern>, <flag> ) -- Returns a new array consisting of the elements of the input arrays keys that match the given regex pattern
- Search( <array>, <value>, <flag>, <invert_flag> ) -- Returns a new array consisting of the elements of the input array that match the given value
- Combine( <array-keys>, <array-values> ) -- Creates a hash (Dictionary) by using the values from the keys array as keys and the values from the values array as the corresponding values
- Walk( <array>, <function> ) -- Walk through the arrays items and execute a user defined function on each one
- Rev( <array> ) -- Returns a new array consisting of the reverse of another array
- IsKeySet( <array>, <key> ) -- Check if given key exists within an array
- Keys( <array> ) -- Create an array containing all KEYS from an array
- Values( <array> ) -- Create an array containing all VALUES from an array
- InArray( <array>, <needle>, <strict>, <flag> ) -- Checks if a value exists in an array
- Flip( <array> ) -- Exchanges all keys with their associated values in an array
- Splice( <array>, <offset>, <length>, <replace_with> ) -- Cut out and return a chunk or portion of an array and optionally replace the cut out section with new data.
- Order( <array>, <flag> ) -- Fix the order of numeric array elements from 0 to whatever.
- Sort( <array>, <flag>, <function> ) -- Sort an array by value or keys optionally modify it in place or return new and optionally use a custom function to decide how to sort it
- CountValues( <array> ) -- Counts all the values of an array
- SumKeys( <array> ) -- Counts the sum total of all the keys of an array
- SumValues( <array> ) -- Counts the sum total of all the values of an array
- IndexOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks if a value exists in an array and returns its index value
- IndexOfValueAny( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks if a value (from an array) exists in an array and returns its index value
- IndexNotOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks for the non-occurrence of a value in an array and returns the first index that does not contain the value
- IndexNotOfValueAny( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks for the non-occurrence of a value (from an array) in an array and returns the first index that does not contain any of the values
- LastIndexOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks if a value exists in an array and returns the index of the last occurrence of the value
- LastIndexOfValueAny( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks if a value (from an array of values) exists in an array and returns the index of the last occurrence of the value (from the value array)
- LastIndexNotOfValue( <array>, <needle>, <strict>, <ignoreCase>, <skipStringKeys> ) -- Checks for the non-occurrence of a value in an array and returns the last index that does not contain the value
Array Pointer Functions
- Each( <array>, <index> ) -- Grab and return the next key & value pair from an array at the next pointer position
- Reset( <array> ) -- Reset the pointer position of an array
- Next( <array> ) -- Increase the pointer position of an array by 1
- Prev( <array> ) -- Decrease the pointer position of an array by 1
- Cur( <array>, <index> ) -- Get or set the pointer position of an array
Linq (Integrated Language Query) Functions
- From( <array> ) -- Create a new Linq object and add this array to it
- AndFrom( <linq>, <array> ) -- Add another array to a Linq object
- NotFrom( <linq>, <array> ) -- Remove array from a Linq object
- Where( <linq>, <query> ) -- Execute a query on the Linq object to sort through it's arrays addingones you desire
- WhereNot( <linq>, <query> ) -- Execute a query on the Linq object to sort through it's arrays removing ones you desire
- AndWhere( <linq>, <query> ) -- Execute a query on the Linq object to sort through it's arrays adding ones you desire (piles ontop of the Where()/WhereNot() instead of creating a new Where() from scratch)
- AndWhereNot( <linq>, <query> ) -- Execute a query on the Linq object to sort through it's arrays removing ones you desire (piles ontop of the Where()/WhereNot() instead of creating a new Where() from scratch)
- Size( <linq> ) -- Get current element count in the Linq object (Results from Where() etc)
- OrderBy( <linq>, <query> ) -- Order the elements in the Linq object (Results from Where() etc) in a customized way
- OrderByDescending( <linq>, <query> ) -- Order the elements in the Linq object (Results from Where() etc) in a customized descending way
- OrderByAscending( <linq>, <query> ) -- Order the elements in the Linq object (Results from Where() etc) in a customized ascending way
- First( <linq>, <query> ) -- Get the first element from the Linq object (Results from Where() etc)
- FirstOrDefault( <linq>, <query>, <default> ) -- Get the first element from the Linq object (Results from Where() etc) or return a default
- Last( <linq>, <query> ) -- Get the last element from the Linq object (Results from Where() etc)
- LastOrDefault( <linq>, <query>, <default> ) -- Get the last element from the Linq object (Results from Where() etc) or return a default
- Any( <linq>, <query> ) -- Check if any item in the Linq object matches the given query
- All( <linq>, <query> ) -- Check if all the items in the Linq object matches the given query
- Invert( <linq> ) -- Reverse all elements from the Linq object (Results from Where() etc)
- Select( <linq> ) -- Return an array containing all the elements from the Linq object (Results from Where() etc)
Enum Functions
- Enumerate( <enum> ) -- Cycle through all Name + Values in an enum
- EnumKey( <enum>, <value> ) -- Return the string KEY for a given integer value
- EnumValue( <enum>, <value> ) -- Return the integer value for a given string KEY
Process Functions
- DLLCall( <Dll/DLLName>, <FunctionName/Alias>, <ReturnType>, <ParameterType>, <CharSet/CallingConvention>, <Parms> ) -- Dynamically call a function in a DLL
- DLLOpen( <DLLName>, <FunctionName/Alias>, <ReturnType>, <ParameterType>, <CharSet/CallingConvention> ) -- Open a DLL and get a function from it and return it as a ready to call object function that is already compiled (vastly speeding up the repeat call speed)
- DLLClose( <DLL> ) -- Close and unset a return value from DLLOpen()
- DLLImport( <varies...> ) -- Dynamically load a function from a DLL and transform it to act and behave like a normal Sputnik function (Can load thousands functions at a time and even save the loaded stuff to DLL for quick access later)
- LoadAssembly( <file> ) -- Load a .NET DLL into a variable
- UnloadAssembly( <assembly> ) -- Unload a .NET DLL from a variable
- GetMethod( <assembly/method>, <namespace>, <class>, <method>, <paramdefs> ) -- Load an instance of a method and its container class into a variable to be able to call it (Or get other methods from a previously obtained method class)
- Invoke( <method>, <params> ) -- Call the function obtained from GetMethod()
- System( <expression> ) -- Execute system command
- Run( <file>, <arguments>, <workdir>, <flag>, <show options> ) -- Runs an external program
- RunWait( <file>, <timeout>, <arguments>, <workdir>, <flag>, <show options> ) -- Runs an external program and waits until the program finishes
- RunShell( <file>, <arguments>, <workdir>, <flag>, <show options> ) -- Runs an external program (Using ShellExecute)
- RunShellWait( <file>, <timeout>, <arguments>, <workdir>, <flag>, <show options> ) -- Runs an external program (Using ShellExecute) and waits until the program finishes
- RunAsSet( <user>, <domain>, <password>, <options> ) -- Initialise a set of user credentials to use during Run and RunWait operations.
- RunCapture( <file>, <arguments>, <workdir>, <flag>, <function> ) -- Run a program in a hidden window and capture its printed output as strings
- PHandle( ) -- Get the process handle of this program
- ProcessClose( <pid/name> ) -- Terminates a named process
- ProcessID( <name> ) -- Gets the process ID of a given name
- ProcessExists( <pid/name> ) -- Checks to see if a specified process exists
- ProcessList( <name> ) -- Returns an array listing the currently running processes (names and PIDs)
- ProcessSetPriority( <pid/name>, <priority> ) -- Changes the priority of a process
- ProcessWait( <pid/name>, <timeout> ) -- Pauses the current thread until a given process exists or optional the timeout expires
- ProcessWaitClose( <pid/name>, <timeout> ) -- Pauses the current thread until a given process no longer exists or optional the timeout expires
- Shutdown( <shutdown code> ) -- Shuts down the system
- Debug( <flag> ) -- Enter or leave debug mode in debug state the program can interact with operating system processes that run in a special mode by enabling the native property SeDebugPrivilege on the current thread
Environment Management
- EnvExpand( <expression> ) -- Convert a string containing %name% env tags and return complete string with names resolved
- EnvGet( <tag> ) -- Get the value of an environment variable
- EnvSet( <tag>, <expression> ) -- Set the value of an environment variable
- EnvUpdate( ) -- Refreshes the OS environment
File Functions
File Create/Read/Write Functions
- FileOpen( <FileName>, <flag> ) -- Opens a file for reading or writing
- FileClose( <file> ) -- Closes a previously opened file
- FileWrite( <file>, <expression>, <useAscii> ) -- Write text to previously opened file at the current File Steam pointer location
- FileWriteBinary( <file>, <binary-array> ) -- Write the data from a binary variable to previously opened file at the current File Steam pointer location
- FileAppend( <file>, <expression>, <useAscii> ) -- Append a line of text to the end of a previously opened text file
- FileAppendBinary( <file>, <binary-array> ) -- Append the data from a binary variable to the end of a previously opened file
- FileSeek( <file>, <offset>, <flag> ) -- Change the POSITION of the File Stream pointer
- FilePos( <file> ) -- Get the current POSITION of the File Stream pointer
- FileRead( <file>, <expression> ) -- Read a number of characters from a text file starting from current File Steam pointer location
- FileReadBinary( <file>, <expression> ) -- Read a number of bytes from a file starting from current File Steam pointer location
- FileReadLine( <file>, <expression> ) -- Read a line of text from a text file (Or specify a name of a file)
- FileReadLines( <file> ) -- Read all lines of text from a text file (Or specify a name of a file)
- FileSave( <file>, <expression>, <useAscii> ) -- Save all text to a file
- FileLoad( <file> ) -- Load all text from a file
Misc
- FileCopy( <file1>, <file2>, <flag> ) -- Copy a file
- FileDelete( <file> ) -- Delete a file
- FileExists( <file> ) -- Check if a given file exists
- FileCreationTime( <file>, <flag> ) -- Get the creation time of a file
- FileWriteTime( <file>, <flag> ) -- Get the last write time of a file
- FileAccessTime( <file>, <flag> ) -- Get the last access time of a file
- FileEncrypt( <file> ) -- Encrypt a file so only the windows account used to encrypt it can decrypt it
- FileDecrypt( <file> ) -- Decrypt a file previously encrypted by this windows user account
- FileMD5( <file> ) -- Calculate the MD5 checksum of a file
- FileSHA1( <file> ) -- Calculate the SHA1 checksum of a file
- FileSize( <file> ) -- Returns the file size in bytes
- FileIsText( <file>, <length> ) -- Returns true if the file contains only text
- FileRecycleEmpty( <root> ) -- Empty the recycle bin with no GUI, sound or confirmation
- FileRecycle( <filename> ) -- Move a file or directory to the recycle bin
Dialogs
- FileSaveDialog ( <title>, <dir>, <filter>, <options>, <default name> ) -- Initiates a Save File Dialog
- FileOpenDialog ( <title>, <dir>, <filter>, <options>, <default name> ) -- Initiates a Load File Dialog
Directory Functions
- GetFiles ( <path>, <pattern> ) -- Get an array of all files in a directory
- GetFolders ( <path>, <pattern> ) -- Get an array of all folders in a directory
- MKDir ( <path> ) -- Creates all directories and subdirectories as specified by path
- RMDir ( <path>, <flag> ) -- Deletes the specified directory and, if indicated, any subdirectories in the directory
- DirExists ( <path> ) -- Determines whether the given path refers to an existing directory on disk
- DirCopy ( <sourcepath>, <destpath> ) -- Copies a directory and all sub-directories and files (Similar to xcopy)
- DirMove( <sourcepath>, <destpath> ) -- Moves a directory to another location
- DirSize( <path> ) -- Returns the size in bytes of a whole directory
- CurDir ( <path> ) -- Get or Set the current working directory
- CombinePath( <path1>, <path1> ) -- Safe way to combine two paths into one
Dialogs
- FolderSelectDialog ( <text>, <dir>, <flag>, <init dir> ) -- Initiates a Browse For Folder Dialog
Path Functions
- ParsePath ( <path> ) -- Resolve a file name and locate its full path
- HasExtension ( <path> ) -- Determines whether a path includes a file name extension
- GetFullPath ( <path> ) -- Returns the absolute path for the specified path string
- GetDirectoryName ( <path> ) -- Returns the directory information for the specified path string
- GetExtension ( <path> ) -- Returns the extension of the specified path string
- GetFileName ( <path> ) -- Returns the file name and extension of the specified path string
- GetFileNameWithoutExtension ( <path> ) -- Returns the file name of the specified path string without the extension
- GetPathRoot ( <path> ) -- Gets the root directory information of the specified path
- IsPathRooted ( <path> ) -- Gets a value indicating whether the specified path string contains absolute or relative path information
- GetDosPath( <path> ) -- Returns a given path in DOS friendly style (shortened)
Network Functions
HTTP Functions
- HTTPFileExists( <url> ) -- Check if a file exists at a given URL
- HTTPGetString( <url> ) -- Copy all text from a URL and return it as a string
- HTTPDownload( <url>, <dest>, <progress>, <completed>, <param> ) -- Download a file from a given URL
MySQL Functions
- MySQLConnect( <ip/ip:port>, <login>, <password> ) -- Connect to a MySQL database
- MySQLSelectDB( <mysql>, <db name> ) -- Select a database
- MySQLQuery( <mysql>, <query> ) -- Execute a query
- MySQLFill( <mysql>, <query> ) -- Grab a table or parts of it from the Database
- MySQLFetch( <mysql data> ) -- Fetch the next row from a table
- MySQLFetchReset( <mysql data> ) -- Reset the current position in the table rows to 0
- MySQLFields( <mysql data> ) -- Return how many Fields are in the table
- MySQLRows( <mysql data> ) -- Return how many Rows are in the table
- MySQLClose( <mysql> ) -- Close a MySQL connection
Sputnik Client/Server Functions (This is just for connecting Sputnik Clients to Sputnik Servers nothing else)
- SSListen( <port>, <max connections>, <name> ) -- Create a server and begin listening for clients to connect
- SSConnect( <ip>, <port>, <connection string>, <name> ) -- Connect to a server
- SSApprove( <server>, <client socket> ) -- Approve a client to connect to the server
- SSDisapprove( <server>, <client socket> ) -- Disapprove a client to connect to the server
- SSClientStatus( /* depends... /* ) -- Get the status of a client or of our client
- SSClientIP( <server>, <client socket> ) -- Get the IP of a client socket
- SSRecv( <server/client> ) -- Check for a message recieved from client/server
- SSRead( <message buffer>, <data type> ) -- Read data from a message
- SSDrop( <server>, <client socket> ) -- Kick a client off the server
- SSSendBufferCreate( <server/client> ) -- Create a new buffer to store data to send to the client/server
- SSSendBufferAppend( <message buffer>, <type>, <data> ) -- Add data to the buffer to send such as Strings etc
- SSSend( /* depends... /* ) -- Send data to client or server
Raw Sockets (TCP/UDP etc)
- SocketAccept( <socket> ) -- Creates a new <socket> for a newly created connection
- SocketAvailable( <socket> ) -- Gets the amount of data that has been received from the network and is available to be read
- SocketBind( <socket>, <ip>, <port> ) -- Associates a <socket> with a local endpoint
- SocketClose( <socket>, <wait> ) -- Closes the <socket> connection and releases all associated resources
- SocketConnect( <socket>, <ip>, <port> ) -- Establishes a connection to a remote host
- SocketConnected( <socket> ) -- Checks if a socket is connected and ready for use or not
- SocketCreate( <sockettype>, <protocoltype>, <addressfamily> ) -- Create a new <socket>
- SocketListen( <socket>, <backlog> ) -- Places a <socket> in a listening state
- SocketReceive( <socket>, <buffersize> ) -- Receives data from a bound <socket> into a receive buffer
- SocketSend( <socket>, <binary-variable>, <length>, <flag> ) -- Sends data to a connected <socket>
- SocketSendTo( <socket>, <ip>, <port>, <binary-variable>, <length>, <flag> ) -- Sends data to the specified ip + port
- SocketSendFile( <socket>, <file-name> ) -- Sends a file as data to a connected <socket>
- SocketShutdown( <socket>, <shutdown-type> ) -- Disables sends and receives on a <socket>
- SocketPoll( <socket>, <milliseconds>, <type> ) -- Sends a kind of ping to determine the status of the <socket>
- SocketHandle( <socket> ) -- Gets the operating system handle for the <socket>
- SocketIsBound( <socket> ) -- Gets a value that indicates whether the <socket> is bound to a specific local port
- SocketOpt( <socket>, <option>, <value> ) -- Get or Set a setting on a <socket>
Misc Network Functions
- HostResolve( <host name> ) -- Resolves a host name such as google.com into an IP address
- Ping( <ip address/host name> ) -- Pings a host and returns the roundtrip-time
Memory Functions
- WriteMem( < Caption / PID >, <Class>, <Address>, <value> ) -- Write a value to an address in an application's memory (Supports multiple values and even binary variables for writing multiple bytes)
- ReadMem( < Caption / PID >, <Class>, <Address>, <defs>, <size> ) -- Read bytes from an application's memory at an address and create variables using same defs and return values as Unpack()
- Alloc( <size>, <filler> ) -- Allocate memory and return the pointer to it
- Realloc( <ptr>, <size> ) -- Resizes a block of memory previously allocated with Alloc()
- Free( <ptr> ) -- Deallocate memory from a pointer
- StringToPTR( <type>, <string> ) -- Allocates memory for the string and writes the string to that memory and returns the pointer for that memory
- PTRToString( <type>, <ptr> ) -- Reads a string from a memory pointer
- PTRRead( <ptr>, <type>, <offset> ) -- Read data from a memory pointer optionally starting from a given index
- PTRWrite( <ptr>, <type>, <offset>, <value> ) -- Write data to a memory pointer optionally starting from a given index
- PTRToDLLStruct( <def string>, <ptr> ) -- Reads a DLLStruct from a memory pointer
- DLLStructCreateDef( <name>, <def string> ) -- Creates a named C/C++ style structure definition that can be used with DLLStructCreate and can also be placed inside other DLLStructs
- DLLStructGetDef( <name>/<dllstruct> ) -- Return the <def string> of a given DLLStruct
- DLLStructCreate( <def string> ) -- Creates a C/C++ style structure to be used with DLLCall
- DLLStructGetData( <dllstruct>, <element>, <index> ) -- Returns the data of an element of the struct
- DLLStructSetData( <dllstruct>, <element>, <index> ) -- Set the data of an element of the struct
- DLLStructGetSize( <dllstruct> ) -- Returns the size of the struct in bytes
- DLLStructGetPtr( <dllstruct>, <element>, <index> ) -- Returns the pointer to the struct or an element in the struct or even a specific index of an array object within an elment
- DLLStructGetVars( <dllstruct> ) -- Create an array of all items and their array size with total byte size
Clipboard Functions
- ClipGet( <type> ) -- Get data from the clipboard
- ClipSet( <type>, <expression> ) -- Set data to the clipboard
Registry Functions
- RegRead( <key>, <value>, <default> ) -- Reads a value from the registry
- RegWrite( <key>, <value>, <type>, <data> ) -- Sets a value in the registry
- RegDelete( <key>, <value> ) -- Delete a key or value from the registry
- RegKeyList( <key> ) -- Return an array of all the keys at this location in the registry
- RegValueList( <key> ) -- Return an array of all the values at this location in the registry
- RegKeyExists( <key> ) -- Check if a key exists in the registry
- RegValueExists( <key>, <value> ) -- Check if a key value in the registry
Time & Date Functions
- Time( ) -- Return current Unix timestamp
GUI Functions
Dialog Creation Functions
- GUICreate( "MDIWindow", <Text>, <Width>, <Height>, <Left>, <Top>, <Style> ) -- Create a GUI Multi-Document-Interface window
- GUICreate( "Window", <Text>, <Width>, <Height>, <Left>, <Top>, <Style> ) -- Create a GUI window
- DoEvents( ) -- Keep GUI windows active by dispatching all messages in the queue
- GUILoad( <GUI Window> ) -- Load a GUI window and display it (Usually after creation or after GUIUnload)
- GUIUnload( <GUI Window> ) -- Unload a GUI window and hide it (GUILoad will bring it back)
- GUIMDIParent( <GUI Window>, <GUI Window> ) -- Set the parent window (An MDI window) for another window to be created inside it
Control Creation Functions
- GUICreate( "Button", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a Button
- GUICreate( "DataGrid", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a DataGrid
- GUICreate( "Timer", <gui object>, <Interval> ) -- Create a Timer
- GUICreate( "ComboBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ComboBox
- GUICreate( "TextBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a TextBox
- GUICreate( "TextBoxEx", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a Multiline TextBox
- GUICreate( "Label", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a Label
- GUICreate( "GroupBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a GroupBox
- GUICreate( "PictureBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a PictureBox
- GUICreate( "ProgressBar", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ProgressBar
- GUICreate( "ListBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ListBox
- GUICreate( "Menu", <gui object> ) -- Create a Menu
- GUICreate( "MenuItem", <gui object>, <Text> ) -- Create a MenuItem
- GUICreate( "TabSheet", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a TabSheet
- GUICreate( "TabPage", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a TabPage
NOT AVAILABLE YET
- GUICreate( "CheckBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a CheckBox
- GUICreate( "RadioButton", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a RadioButton
- GUICreate( "DateTimePicker", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a DateTimePicker
- GUICreate( "LinkLabel", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a LinkLabel
- GUICreate( "CheckedListBox", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a CheckedListBox
- GUICreate( "ListView", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ListView
- GUICreate( "MaskedTextBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a MaskedTextBox
- GUICreate( "MonthCalendar", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a MonthCalendar
- GUICreate( "NumericUpDown", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a NumericUpDown
- GUICreate( "RichTextBox", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a RichTextBox
- GUICreate( "ToolTip", <gui object>, <Text>, <Left>, <Top>, <Width>, <Height> ) -- Create a ToolTip
- GUICreate( "TreeView", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a TreeView
- GUICreate( "WebBrowser", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a WebBrowser
- GUICreate( "StatusBar", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a StatusBar
- GUICreate( "ToolStrip", <gui object>, <Left>, <Top>, <Width>, <Height> ) -- Create a ToolStrip
Window/Control Properties Get/Set Functions
Note - Any options not here are most likely found using GUIGetProp and GUISetProp the bulk of all props can be found/used in them 2 funtions however anything special and not generic will go in the functions below.
- GUIWindow( <window> ) -- Properties & Functions specifically for Windows
- GUIDataGrid( <datagrid> ) -- Properties & Functions specifically for DataGrid
- GUITimer( <timer> ) -- Properties & Functions specifically for Timer
- GUIComboBox( <combobox> ) -- Properties & Functions specifically for ComboBox
- GUIListBox( <listbox> ) -- Properties & Functions specifically for ListBox
- GUITabSheet( <tabsheet> ) -- Properties & Functions specifically for TabSheet
- GUIProgressBar( <progressbar> ) -- Properties & Functions specifically for ProgressBar
- GUIPictureBox( <picturebox> ) -- Properties & Functions specifically for PictureBox
- GUIMsgFilter( <gui>, <command> ) -- Use a function to receive all messages windows sends to the GUI window (HWND, MSG, WPARAM, LPARAM).
- GUIWndProc( <gui>, <command> ) -- Use a function to receive all the WindProc messages windows sends to the GUI window (HWND, MSG, WPARAM, LPARAM).
Common Dialog/Control Properties Get/Set Functions
- GUIGetProp( <gui object>, <prop> ) -- Get the value of a GUI objects property
- GUISetProp( <gui object>, <prop>, <value> ) -- Set the value of a GUI objects property
- GUIGetPropList( <gui object>, <searchfor>, <flag> ) -- Get an array of the the names and types of all compatible/incompatible/all properties that the GUI object offers
GUI Link (Event) Functions
- GUILink( <gui object>, <linktype>, <action>, <param var> ) -- Add a link on a Click event to a GUI object
Other GUI Functions
- GUIInvoke( ??? ) -- Call a method on a GUI object
- GUICreate( "Font", ......??? ) -- Create a Font
- MsgBox( <message>, <title>, <flag>, <timeout> ) -- Show a message dialog
- InputBox( <title>, <message>, <default text> ) -- Shows a box to input text
- InputBoxEx( <title>, <message>, <default text> ) -- Shows a box to input multiple lines of text
- ToolTip( <text>, <x>, <y> ) -- Creates a tooltip anywhere on the screen
- ToolTipKill( <ToolTip> ) -- Delete a tooltip that was made using ToolTip()
- PSet( <gui object>, <x>, <y>, <object> ) -- Draw at a pixel
Bitmap Functions
- BitmapCreate( <width>, <height> ) -- Create a new blank bitmap object
- BitmapGetPixel( <bitmap>, <x>, <y> ) -- Get a pixel on a bitmap object
- BitmapSetPixel( <bitmap>, <x>, <y>, <colour> ) -- Alter a pixel on a bitmap object
Keyboard Control Functions
- HotKeySet( <keydef>, <expression> ) -- Create a custom hotkey to run custom code or execute a function
- SendKeys( <keydef>, <flag> ) -- Sends simulated keystrokes to the active window
- RealGetKeyState( <vk_keycode/expression> ) -- Checks if a key or series of keys is pressed down
- KeyHook( <name>, <command> ) -- Places a global system wide Keyhook with callback to a function or command
- KeyHookKill( <ptr> ) -- Removes a previously set MouseHook
Mouse Control Functions
- MouseClick ( <button>, <x>, <y>, <clicks>, <speed> ) -- Perform a mouse click operation
- MouseClickDrag ( <button>, <x1>, <y1>, <x2>, <y2>, <speed> ) -- Perform a mouse click and drag operation
- MouseDown ( <button> ) -- Perform a mouse down event at the current mouse position
- MouseUp ( <button> ) -- Perform a mouse up event at the current mouse position
- MouseMove ( <x>, <y>, <speed> ) -- Moves the mouse pointer
- MouseGetPos ( ) -- Retrieves the current position of the mouse cursor
- MouseWheel ( <direction>, <clicks> ) -- Moves the mouse wheel up or down
- MouseHook( <name>, <command> ) -- Places a global system wide MouseHook with callback to a function or command
- MouseHookKill( <ptr> ) -- Removes a previously set MouseHook
Window Management Functions
(For info on using <title>, <text> See Window Titles and Text (Advanced) )
- WinActivate ( <title>, <text> ) -- Activates (gives focus to) a window
- WinActive ( <title>, <text> ) -- Checks to see if a specified window exists and is currently active
- WinExists ( <title>, <text> ) -- Checks to see if a specified window exists
- WinGetClassList ( <title>, <text> ) -- Retrieves the classes from a window
- WinGetHandle ( <title>, <text> ) -- Retrieves the internal handle of a window
- WinGetPos ( <title>, <text> ) -- Retrieves the position and size of a given window
- WinGetCaretPos ( ) -- Returns the coordinates of the caret in the foreground window
- WinGetTitle ( <title>, <text> ) -- Retrieves the full title from a window
- WinGetText ( <title>, <text> ) -- Retrieves the text from a window
- WinGetState ( <title>, <text> ) -- Retrieves the state of a given window
- WinGetProcess ( <title>, <text> ) -- Retrieves the Process ID (PID) associated with a window
- WinGetClientSize ( <title>, <text> ) -- Retrieves the size of a given window's client area
- WinClose ( <title>, <text> ) -- Closes a window
- WinKill ( <title>, <text> ) -- Forces a window to close
- WinMove ( <title>, <text>, <x>, <y>, <width>, <height>, <speed> ) -- Moves and/or resizes a window
- WinWait ( <title>, <text>, <timeout> ) -- Waits until the requested window exists
- WinWaitActive ( <title>, <text>, <timeout> ) -- Waits until the requested window is active
- WinWaitNotActive ( <title>, <text>, <timeout> ) -- Waits until the requested window is not active
- WinWaitClose ( <title>, <text>, <timeout> ) -- Waits until the requested window does not exist
- WinSetTitle ( <title>, <text>, <newtitle> ) -- Changes the title of a window
- WinSetState ( <title>, <text>, <flag> ) -- Shows, hides, minimizes, maximizes, or restores a window
- WinSetTrans ( <title>, <text>, <transparency> ) -- Sets the transparency of a window
- WinMinimizeAll ( ) -- Minimizes all windows
- WinMinimizeAllUndo ( ) -- Undoes a previous WinMinimizeAll function
- WinFlash ( <title>, <text>, <flashes>, <delay> ) -- Flashes a window in the taskbar
- WinList ( <title>, <text> ) -- Retrieves a list of windows
Controls
(For info on using <title>, <text> See Window Titles and Text (Advanced) )
- ControlClick ( <title>, <text>, <controlID>, <button>, <clicks>, <x>, <y> ) -- Sends a mouse click command to a given control
- ControlSend ( <title>, <text>, <controlID>, <string> <flag> ) -- Sends a string of characters to a control
- ControlGetFocus ( <title>, <text> ) -- Returns the ControlRef# of the control that has keyboard focus within a specified window
- ControlGetPos ( <title>, <text>, <controlID> ) -- Retrieves the position and size of a control relative to it's window
- ControlDisable ( <title>, <text>, <controlID> ) -- Disables a control
- ControlEnable ( <title>, <text>, <controlID> ) -- Enables a control
- ControlShow ( <title>, <text>, <controlID> ) -- Shows a control that was hidden
- ControlHide ( <title>, <text>, <controlID> ) -- Hides a control
- ControlGetText ( <title>, <text>, <controlID> ) -- Retrieves text from a control
- ControlSetText ( <title>, <text>, <controlID>, <text> ) -- Sets text of a control
- ControlMove ( <title>, <text>, <controlID>, <x>, <y>, <width>, <height>, <speed> ) -- Moves a control within a window
- ControlGetHandle ( <title>, <text>, <controlID> ) -- Retrieves the internal handle of a control
NOT AVAILABLE YET
- ControlCommand ( <title>, <text>, <controlID>, <command>, <option> ) -- Sends a command to a control
- ControlFocus ( <title>, <text>, <controlID> ) -- Sets input focus to a given control on a window
Graphics/Pixel Functions
- PixelGetColour ( <x>, <y> ) -- Returns a pixel colour according to x, y pixel coordinates
- PixelGetMouse ( ) -- Returns a pixel colour according to x, y position of the mouse pointer
- PixelSearch ( <left>, <top>, <right>, <bottom>, <colour>, <shade>, <padding>, <step> ) -- Searches a rectangle of pixels for the pixel colour provided
- PixelSearchHWND ( <hwnd>, <left>, <top>, <right>, <bottom>, <colour>, <shade>, <padding>, <step> ) -- Searches a rectangle of pixels for the pixel colour provided
- PixelChecksum ( <left>, <top>, <right>, <bottom>, <step>, <hwnd> ) -- Generates a checksum for a region of pixels
- Colour( <name> ) -- Get the colour INT value of a given colours name
- RGB( <red>, <green>, <blue> ) -- Get the colour INT value of given red, green and blue bytes
- GetRValue( <colour> ) -- Get the red byte from a colour INT value
- GetGValue( <colour> ) -- Get the green byte from a colour INT value
- GetBValue( <colour> ) -- Get the blue byte from a colour INT value
- ColourDialog( ) -- Allows the user to select a colour and allows you to get the RED, GREEN, BLUE etc values
- FontDialog( ) -- Allows the user to select a font and allows you to get the Name, size, bold etc values
Misc Functions
- Warn( <message> ) -- Show a warning message with source file name and line number
- newClass( <name>, <params> ) -- Create a new instance of a class by its name as a string
- Sleep( <expression> ) -- Pause the current executing thread for the given milliseconds
- TickCount( <expression> ) -- Retrieves the number of milliseconds that have elapsed since the current operating system was started
- AddPath( <path> ) -- Add a directory to the search list when using ParsePath() and all other functions such as Include(), Require() etc
- DelPath( <path> ) -- Remove a directory from the search list when using ParsePath() and all other functions such as Include(), Require() etc
- MKFunc(<params>, <body>) -- Create a user defined function to be called from a variable
- CallFunc( <function>, <array>) -- Calls a user defined function contained in a variable
- Call(<function/array>, <expressions>) -- Calls a function contained in a string parameter
- CallArray( <function/array>, <array>) -- Calls a function contained in a string parameter
- Return <expressions> -- Returns a result from a Function
- Throw( <expression> ) -- Throw an exception
- Die( <expression> ) -- Gives an error and terminates the program
- Eval( <expression>, <flag> ) -- Evaluate a string as Sputnik code
- GC( <flag> ) -- Use the garbage collector
- HWND( ) -- Get the HWND of the hidden window used by this program (It handles hotkeys etc)
- Require( <file>, <flag> ) -- Add all functions etc from a file for use
- Include( <file>, <flag> ) -- Add all functions etc from a file for use and execute all expressions
- Opt( <option>, <value> ) -- Changes the operation of various Sputnik functions/parameters
- UnsetFunction( <function-name> ) -- Delete a previous user defined Function from Sputnik
- UnsetClass( <class-name> ) -- Delete a previous user defined Class from Sputnik
- UnsetEnum( <enum-name> ) -- Delete a previous user defined Enum from Sputnik
- UnsetDLLStruct( <dllstruct-name> ) -- Delete a previous user defined DLLStruct from Sputnik
- UnsetDLLImport( <dllimport-function-name> ) -- Delete a function imported using the DLLImport() function
- FunctionExists( <expression> ) -- Check if a given Function exists
- ClassName( <variable> ) -- Return the name of the class on a variable or a class this code is running inside of (automatically uses $this if no param is given)
- ClassStack( <variable> ) -- Return a reference to a classes internal variable stack (as an array) (or set the class stack from an existing array)
- ClassExists( <expression> ) -- Check if a given Class exists
- EnumExists( <expression> ) -- Check if a given Enum exists
- DLLStructExists( <expression> ) -- Check if a given DLLStruct exists
- DLLImportExists( <expression> ) -- Check if a given DLLImport exists
- FunctionList( <expression> ) -- Return an array of all user defined functions (Or just ones fitting a given pattern)
- ClassList( <expression> ) -- Return an array of all user defined classes (Or just ones fitting a given pattern)
- EnumList( <expression> ) -- Return an array of all user defined enums (Or just ones fitting a given pattern)
- DLLStructList( <expression> ) -- Return an array of all user defined dllstructs (Or just ones fitting a given pattern)
- DLLImportList( <expression> ) -- Return an array of all user defined dllimports (Or just ones fitting a given pattern)
- IsAdmin( ) -- Check if the script is running in admin mode or not (Run as administrator)
- ObjToVar( <variable> ) -- Convert a $variable's object to its compatible $variable data type
- VarToObj( <variable> ) -- Convert a $variable to its compatible object (such as .NET base object)
User Defined Functions
These functions are created using Sputnik and are not part of the Sputnik core language.