Fwatch is a program extending Operation Flashpoint's scripting functionality.
It creates a hook on file operations. When the game attempts to open file with a special name Fwatch takes over. It's able to perform a variety of operations (like reading/writing text files, string manipulation, utilizing WINAPI) and send results back to the game.
It was created by Kegetys in 2005. This project (which started in the late 2010) is a continuation. It features 98 new commands, compatibility with 1.99 and has several old issues fixed.
For quick start simply double click on Fwatch.exe or FwatchCWA.exe (for Cold War Assault).
Make exception in your Antivirus/Firewall software.
All parameters passed to the Fwatch.exe are transferred to the game. Use shortcut (target field) or command line to type in arguments. -nomap is added automatically when you start the game through the Fwatch executable.
Fwatch custom parameters:
-nolaunch - installs hook without starting the game. Then you can manually launch Flashpoint and/or dedicated server with OFPR_Server.exe / ColdWarAssault_Server.exe. Do not start or quit the Fwatch while the game is running or the latter will crash.
-steam - same as -nolaunch but it will additionally start the game via Steam.
-gamespy=<ip> - changes master server address for the in-game server browser.
-reporthost - informs master server when you host a game so it will show up in a browser. Requires -gamespy parameter. Port is set by the -port= parameter.
-sortmissions - moves missions from the active modfolders to the mission folders and back when you quit the game. First place files in<mod>\Missions\ and <mod>\MPMissions\.
-removenomap - cancel adding -nomap automatically. For use on Wine on Linux.
If you have Russian localization of the game ...
To determine whether Fwatch is running use this condition in scripting:
localize "STR_USRACT_CHEAT_1" == "FWATCH"This string comes from the stringtable.csv and the Fwatch process replaces its value in the game memory. This modification will not take place if the STR_USRACT_CHEAT_1 is not in the stringtable.csv or if its value in the file has been changed (that is to say it's different from Cheat 1).
If the presence check does not work for you then:
- make sure you're starting the game with the fwatch.exe or fwatchCWA.exe
- if the string is missing from your stringtable.csv then add it
- use original stringtable.csv (e.g. remove it from the modfolders that you're running)
New Fwatch is still compatible with the original presence check method (function fwatch_check.sqf) but I do not recommend using it as it doesn't work with addons and compressed multiplayer missions.
Fwatch Command Syntax
Data Types
Memory Commands on a Dedicated Server
Source Directory for the FILE Commands
Source Directory for the New Commands
Game Limitations
Error Handling
Fwatch Command Syntax
Fwatch can be called by any command that reads an external file (addAction, exec, loadFile or preprocessFile).
String that you pass to one of these commands begins with a backslash and a colon followed by Fwatch command name. Subsequent phrases are treated as arguments.
\:name1 name2 argument1 argument2 argument3 argument4Backslash is not obligatory but recommended because in its absence long arguments will crash the game.
for example:
loadFile "\:file write test.db foo 1"
All arguments are required unless stated otherwise. They must be written in the specified order.
If you want to pass string with spaces then put it into additional quotation marks. Otherwise every word is going to count as a separate parameter.
loadFile Format ["\:file read ""%1"" %2", "My File.txt", "foo"] - correct
loadFile Format [{\:file read "%1" %2}, "My File.txt", "foo"] - correct
loadFile Format ["\:file read %1 %2", "My File.txt", "foo"] - incorrect
30 new commands (show) have a different system of passing data. Each argument must start with an identifier followed up by a colon and then by value.\:igse load end:150 split:true ""file:name with spaces.txt""All arguments are optional. They can be written in any order.
Arguments that require boolean are false by default. If you pass empty string, zero or false then the option will remain turned off. For any other text - it will be activated.
Text arguments in the new system do not need quotes. Instead they are separated by "Unit Separator" character. Hold ALT and press 0, 3, 1 on numeric keypad and release ALT.\:string compare text1:hello worldIt's indicated on the command page which arguments require this notation.text2:hi world
Data Types
All input and output data are de facto strings. However, in command reference they are treated for what they represent.
For example: :info lock returns string containing an array._lock = loadFile ":info lock"To assign that array to a variable use call command:
_lock = "[true,false,false]"_lock = call loadFile ":info lock"New commands that only return a string (e.g. :string replace) do not require execution of call as it would be redundant. See example code in the command description page.
_lock = [true,false,false]
Memory Commands on a Dedicated Server
Only 10 mem commands will work on a dedicated server: :mem bullets
:mem getdaylight
:mem getdifficulty
:mem getrespawntype
:mem getresside
:mem getweather
:mem getworld
:mem missioninfo
:mem setdifficulty
:mem setweather
Fwatch automatically recognises whether they are executed on a client or a server.
Source Directory for the FILE Commands
FILE type commands (e.g. :file write) save to and read from fwatch\mdb\ directory. File names are converted to lowercase and all slashes and other invalid characters in it will be replaced with an underscore.
Source Directory for the New Commands
Default working directory for the CLASS, IGSE and CLIP type commands is current (unpacked) mission folder. They will return error on PBO missions.
To access game root directory start the path with ..\\:igse load file:..\res\bin\config.cpp
Commands that modify files are restricted from operating outside except for these locations:
..\fwatch\idbfwatch\idb is a new common storage folder for save data.
..\fwatch\tmp
..\in-game-script-editor
..\flashpointcutscenemaker
..\missioneditor3d
..\@addontest
fwatch\tmp is meant for temporary files and also stores data downloaded with :exe wget.
Commands that remove files actually move them to the recycle bin instead (unless the file is stored in fwatch\tmp - then it's deleted).
Game Limitations
Command format will crash the game when input text is larger than 2048 characters. Use concatenation operator to work around (it's slower, though).
Commands :file read, :file read2, :file readvars, :file vars, :file wget may output indefinitely large arrays crossing the game's limit for a single allocation. Monitor size of the data you're working with. New commands (e.g. :igse load) work around this restriction by returning code that merges bunch of smaller arrays into a single large one.
Error Handling
33 commands return detailed error description (show)
Error information is stored in the output array. For 5 FILE commands (show) it is stored in a separate local array _fwatch_error instead (it needs to be declared beforehand).
Array contains following items:
- 0 - bool indicating if the operation was completed
- 1 - Fwatch error code number. See list
- 2 - WINAPI, SHFileOperation or errno error code number
- 3 - error description
Example:_result = call loadFile "\:IGSE LOAD file:???"
? !(_result select 0) : hint (_result select 3)
; For FILE commands
_fwatch_error = [true, 0, 0, ""]
_variable = call loadFile "\:FILE READ test.db foo"
? !(_fwatch_error select 0) : hint (_fwatch_error select 3)
:input getjoystick
This command reads joystick input using Windows API.
- Can select which joystick to read (one from max 16 connected)
- Supports up to 6 axes, 32 buttons, digital/analog POV
- Displays numbers for joystick identification
- Queries axes names
- Axes value range is from 0 to 65535
When you connect a controller system assigns an ID number to the device (from 0 to 15). If you reconnect device you'll still find it under the same ID number.
If you connect joystick in the middle of the game it may take up to 10 seconds before it's detected by the command.
If you won't pass any arguments then the command automatically searches for a device starting from ID 0 to 15. In case of error it returns array with error description and last used joystick ID.
Axis center position is 32767 for joysticks and 32511 for joypads.
Pressed buttons are returned as strings in an array. View list of possible values.
According to the MSDN: POV values range 0 through 35,900. These values represent the angle, in degrees, of each view multiplied by 100.
For digital POV the values are:
31500 0 4500 27000 65535 9000 22500 18000 13500
If the controller doesn't have POV then the value is zero
I've noticed that two devices from the same manufacturer do not necessarily share the same MID (manufacturer identification) number.
:mem getjoystick
This command reads joystick input from the game memory.
- Supports one joystick
- Supports up to 4 axes, 8 buttons, digital POV
- Axes values range from -1 to 1. Step is 0.01
- Has a deadzone
Values are always returned even without a joystick. Center POV is 65535 even if the controller doesn't have a POV switch.
Pressed buttons are returned as strings in an array. View list of possible values.
Controller must be connected before launching the game otherwise it won't work.
Game uses device with the lowest ID number.
:input getkeys, :input agetkeys
These commands return array with pressed keyboard keys and mouse buttons. The difference between them is in holding a key. In the case of the latter a value will keep popping in and out of array which allows for programming repeated action.
View list of possible values.
When Num Lock is enabled, pressing SHIFT and numpad key will change input (e.g SHIFT+7 returns HOME).
If you hold numpad key and SHIFT simultaneously and then release numpad key then it will be treated as if constantly pressed. Press it again to unblock it.
Numpad enter is not detected.
Pause Break key cannot be held (only single press).
Holding Right Alt is treated as if CTRL + ALT (LCTRL + RALT) were pressed. This is related to Windows regional keyboard settings. On some layouts Right Alt key is defined as Alt Graph which is equivalent to holding down the Ctrl and Alt keys together.
I've tested a couple of keyboard settings:
RALT + LCTRL RALT US International US Czech Russian Finnish French German Spanish Polish UK Italian
More on AltGr you'll find on Wikipedia.
Animation codes are enumerated animation classes from the configuration files.
Game process:
class X --> Class States --> all subclasses Where X is selected by the moves property in the unit class. Default is CFGMovesMC.
Example:
class SoldierWB : Soldier { moves = "CfgMovesMC"; }; class CfgMovesMC { class States { class DeadState : Default //code 0 class Stand : StandBase //code 1 class StandVar2 : Stand //code 2 }; };
Other configs may add new codes to the pool.class CfgMovesMC { class States { class DeadState : Default //was already defined class DeadState2 : DeadState //code 3 }; };
Game loads configuration files starting from:
1. Main config (\bin\config.cpp)Animation codes may be different if you'll use addons which add new animations.
2. Self-dependent addons (in alphabetical order).
3. Addons requiring other addons (in alphabetical order).
Code list for Operation Flashpoint: Resistance 1.96 including all original addons: view.
Use Animation Viewer script to preview them in the game.
Directory fwatch\data\ stores over a dozen of extra scripts and functions that take advantage of the Fwatch features. They are listed below, each with brief description. More information you'll find inside the files.
Functions
ConvertKeyString
CurrentLanguage
DateDifference
DateDifferenceInDays
FormatDate
getAspectRatio
InitFLib
inKeys
MeasureTime
ModifyDate
path
pathDediScripts
InputMulti
MemMulti
onScreenTyping
- Every time you call Fwatch the game is frozen until the operation is completed. If there are many Fwatch commands executed at once the game will render less frames per second. Avoid redundant commands.
- Use scripts InputMulti.sqs and MemMulti.sqs when you continuously require input and game information.
- When saving to fwatch\mdb\ try to store your variables in a single file. To load them all use :file readvars instead of using :file read for each one.
- Use unique filenames in file operations for your missions as they can read, write and delete files from each other.
- If you're storing multiple files in the fwatch\idb\ directory then create a sub-folder and move your files there to keep storage tidy.
- Be careful with the usage of wget, especially in multiplayer missions as it can easily cause large amounts of requests to the web server. For example if you do a request at the start of a MP mission, running the script on all players in a 20 player multiplayer game there will instantly be 21 requests made to the web server once the mission starts.
- Pay special attention to where you need to run the scripts in a multiplayer game, for example if you are saving a variable to a file it maybe isn't necessary to save it anywhere else than in the server machine.
| command | description | ||||||||||||||||||||||||||||||||||||||||||||||||
| class list |
Class names
example:
_ok = call loadFile "\:class list ""file:mission.sqm"" classpath:[Mission,Vehicles]" Parses given file and returns list of classes. To find nested class use classpath: argument. For large files use offset: in order to reduce searching time. | ||||||||||||||||||||||||||||||||||||||||||||||||
| class modify |
Modify class
example:
_ok = call loadFile ":class modify ""file:config.cpp"" classpath:[CfgWeapons] ""add:M16 : Riffle""" Performs one of three possible operations (create new class, rename existing one or delete class and its contents) on the selected file. To find nested class use classpath: argument. If a class you want to rename has inheritance then argument to: should include that inherit name. | ||||||||||||||||||||||||||||||||||||||||||||||||
| class modtok |
Modify class property
example:
_ok = call loadFile "\:class modtok ""file:config.cpp"" classpath:[CfgWeapons,M16] add:optics=0" Performs one of four possible operations (create new property, append value, rename property or remove it) on the selected file. To find nested class use classpath: argument. Pass name=value for arguments add: and append:. If property you want to add already exists then its value will be overwritten. If property you want to append doesn't exist then it will be created. Don't quote text that you want to append to a string. To append array to an array wrap the value in brackets. Array names must end with square brackets. If parameter index: was specified then the operation is performed on an item inside the array. Accessing sub-arrays is not supported. | ||||||||||||||||||||||||||||||||||||||||||||||||
| class token |
Class properties
example:
_ok = call loadFile "\:class token file:mission.sqm classpath:[Mission,Groups,Item0,Vehicles,Item0]" Parses given file and returns list of properties from the specified class. To find nested class use classpath: argument. For large files use offset: in order to reduce searching time. If token: was specified then only that property will be returned. All values are wrapped in quotation marks. Use wrap:no to cancel or wrap:nodouble to disable wrapping for values that already have quotation marks. Multi-dimensional arrays are not supported. | ||||||||||||||||||||||||||||||||||||||||||||||||
| clip copy |
Text to clipboard
example:
_result = loadFile Format ["\:clip copy text:%1", "Hello World!"] Copies given text to the Windows clipboard. Pass letter "n" in argument escape: to replace \n with new lines. Pass letter "t" to replace \t with tabulators. Write number before the letter to limit amount of replacements. | ||||||||||||||||||||||||||||||||||||||||||||||||
| clip copyfile |
Copy files to clibpoard
example:
_ok = call loadFile "\:clip copyfile mission.sqm"
Copy file names to the Windows clipboard. Argument is list of files separated by spaces. If file has space in its name then wrap it in quotation marks. Path info you'll find here. | ||||||||||||||||||||||||||||||||||||||||||||||||
| clip cutfile |
Move files to clibpoard
example:
_ok = call loadFile "\:clip cutfile mission.sqm"
Copy file names to the Windows clipboard with a "move" instruction. Argument is list of files separated by spaces. If file has a space in its name then wrap it in quotation marks. Path info you'll find here. | ||||||||||||||||||||||||||||||||||||||||||||||||
| clip fromfile |
File text to clipboard
example:
_ok = call loadFile "\:clip fromfile ""Clipboard Text.txt"""
Copies text from the selected file to the Windows clipboard. Pass "a" to append. | ||||||||||||||||||||||||||||||||||||||||||||||||
| clip get |
Clipboard text
example:
_text = loadFile "\:clip get" Returns text stored in the Windows clipboard. | ||||||||||||||||||||||||||||||||||||||||||||||||
| clip getline |
Lines from clipboard
example:
_ok = call loadFile "\:clip getline" Returns given range of lines (all of them if not specified) from the text stored in the Windows clipboard. Combine arguments cut: and split: in order to segment lines (parts will be put into additional sub-array). | ||||||||||||||||||||||||||||||||||||||||||||||||
| clip pastefile |
Paste files from clipboard
example:
_ok = call loadFile "\:clip pastefile" Copies or moves files that were stored in the Windows clipboard. Path info you'll find here. Clipboard is emptied after a successful "move" operation. Pass argument ?list to get list of files without performing any file operation. | ||||||||||||||||||||||||||||||||||||||||||||||||
| clip size |
Clipboard text length
example:
_ok = call loadFile "\:clip size" Returns number of characters and number of lines stored in the Windows clipboard. | ||||||||||||||||||||||||||||||||||||||||||||||||
| clip tofile |
Save clipboard text
example:
_ok = call loadFile "\:clip tofile ""Clipboard Text.txt"""
Writes text from the Windows clipboard to a text file. Won't overwrite unless "w" was passed. Pass "a" to append if the file already exists. | ||||||||||||||||||||||||||||||||||||||||||||||||
| exe addontest |
Addon Tester mod
example:
_ok = call loadFile ":exe addontest" Launches external program meant to supplement @addontest mod. Pass check with process ID to see if the program is still running. Use close with process ID to terminate the program. Argument -unpbo= along with file name will make the program extract pbo archive from the \@addontest\addons directory. | ||||||||||||||||||||||||||||||||||||||||||||||||
| exe preprocess |
Preprocess file
example:
_ok = call loadFile ":exe preprocess config.cpp config2.cpp" Launches external program which preprocesses selected file. First parameter is input file and second is output file. Path info you'll find here. If you pass only one filename then program will preprocess without writing (syntax check). Add parameter -merge to add contents to an existing file. When the program is finished it writes array with results to the fwatch\tmp\<num>.pid where <num> is process id. Contents are as follows:
Pass check with process ID to see if the program is still running. Use close with process ID to terminate the program. | ||||||||||||||||||||||||||||||||||||||||||||||||
| exe unpbo |
Unpack pbo file
example:
_ok = call loadFile ":exe unpbo Missions\01takethecar.abel.pbo"
Launches external program for extracting PBO files. Argument is a path to the file starting from the game root directory. Aleternatively you can pass -F <filename1,...> <pboname> to get only specific files (will be faster). Archives are extracted to the fwatch\tmp\ directory. When the program is finished, its result number (0 - success, 1 - failure) is written to the fwatch\tmp\<num>.pid where <num> is process id. Pass check with process ID to see if the program is still running. Use close with process ID to terminate the program. | ||||||||||||||||||||||||||||||||||||||||||||||||
| exe wget |
Download data
example:
_ok = call loadFile ":exe wget http://www.site.domain/something.sqs"
Launches external program which downloads data from the specified web address. File is saved to the fwatch\tmp\ directory. Pass check with process ID to check if the program is still running. Use close with process ID to terminate the program. When the program is finished result number is saved to the fwatch\tmp\<num>.pid where <num> is process id. Wget manual you'll find here. | ||||||||||||||||||||||||||||||||||||||||||||||||
| restart client |
Relaunch game
example:
call loadFile "\:restart client" Launches external program which terminates current game process and then creates a new one with given arguments. Pass string without a quote. Parameters previously passed to the game are transferred to the new instance (except for -mod and <-connect). Operations are documented in the fwatch\data\gameRestartLog.txt. | ||||||||||||||||||||||||||||||||||||||||||||||||
| restart server |
Relaunch dedicated server
example:
loadFile "\:restart server" Signals to the Fwatch process to terminate current server instance and then create a new one with given arguments. Pass string without a quote. Executable (OFPR_Server.exe or ColdWarAssault_Server.exe) must be in the game directory. | ||||||||||||||||||||||||||||||||||||||||||||||||
| spig exe |
SPIG save conversion
example:
loadFile ":spig exe spig2sqm.exe spig_sqm1.txt" Executes given program from the Set-Pos-In-Game\Exe\ directory. Second argument file name from the fwatch\mdb\ folder. In case of an error it returns error message instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file awrite |
Append variable
example:
_status = call loadFile Format [":file awrite test.db %1 %2", "foo", [3,4]] Appends value to the specified variable in the given file in fwatch\mdb\. If variable doesn't exist then it will be created. Returns 1 on success and -1 on failure. String values should be wrapped in quotation marks. Detailed error information is returned in _fwatch_error local array. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file delete |
Remove file
example:
_status = call loadFile Format [":file delete test.db"]
Removes given file from fwatch\mdb\. Returns 1 on success and -1 on failure. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file dxdll |
DxDLL presence
example:
_dxdll = call loadFile ":file dxdll" Checks if d3d8.dll file is in the game directory. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file exists |
File presence
example:
_file = call loadFile ":file exists test.db"
Checks if specified file is in the fwatch\mdb\ directory. Returns 1 if there is and -1 if not. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file modlist |
List of modfolders
example:
_mods = call loadFile ":file modlist" Returns list of modfolders in the game directory. Detailed error information is stored in _fwatch_error local array. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file qwrite |
Variable quick save
example:
_success = call loadFile Format [":file qwrite test.db %1 %2", "foo", 1] Writes variable to the given file in fwatch\mdb\ without checking if the same variable is already there. Returns 1 on success and -1 on failure. String values should be wrapped in quotation marks. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file read |
Read variable
example:
_x = call loadFile Format [":file read test.db %1", "foo"] Returns value from a specified variable in the given file in fwatch\mdb\. Returns -1 on failure. Detailed error information is returned in _fwatch_error local array therefore you must use call with this command. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file read2 |
Read variable
example:
_var = call loadFile ":file read2 flashpoint.cfg language" Returns value from a specified variable in the given file. Source folder is game root directory. In case of error it returns -1. Detailed error information is returned in _fwatch_error local array therefore you must use call with this command. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file readvars |
Read all variables
example:
_result = call loadFile ":file readvars test.db"
Returns code with all variables and their values (in a var=val; format) from the specified file in fwatch\mdb\. Result is 1 on success and -1 on failure. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file remove |
Remove variable
example:
_status = call loadFile Format [":file remove test.db foo"] Removes specified variable from the specified file in fwatch\mdb\. Returns 1 on success and -1 on failure. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file renamemissions |
Replace MP missions
example:
_ok = call loadFile ":file renamemissions MPMissions@bis MPMissions@fdf" Renames MPMissions directory to name1 and name2 directory to MPMissions. Do not pack mission (PBO) which uses this command, otherwise it won't work. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file vars |
Variable names
example:
_array = call loadFile Format [":file vars test.db"]
Returns array with all variable names stored in the specified file in fwatch\mdb\. Returns -1 on failure. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file wget |
Download data
example:
_data = loadFile ":file wget http://www.site.domain/something.sqs"
I recommend to use exe wget instead to avoid freezing the game. Launches external program which returns data from the specified web address. You must wait at least one second between calls or the command returns -1. | ||||||||||||||||||||||||||||||||||||||||||||||||
| file write |
Write variable
example:
_status = call loadFile Format [":file write test.db %1 %2", "foo", 1] Saves variable (overwrites) to the specified file in fwatch\mdb\. Returns 1 on success and -1 on failure. String values should be wrapped in quotation marks. Detailed error information is returned in _fwatch_error local array therefore you must use call with this command. | ||||||||||||||||||||||||||||||||||||||||||||||||
| igse copy |
Copy file
example:
_ok = call loadFile "\:igse copy source:mission.sqm destination:mission.backup" Copies selected file to the the given location with specified new name. Path info you'll find here. You may copy files from the outside to a non-restricted location but cannot copy in the opposite direction. | ||||||||||||||||||||||||||||||||||||||||||||||||
| igse find |
Find text in file
example:
_ok = call loadFile "\:igse find ""file:mission.sqm"" text:soldierwb" Searches for occurrences of a given text in the selected file. Path info you'll find here. Use argument column: to find only occurrences that start at the given position in a line. With replace: command will rewrite the file replacing all occurrences. For large files limit range (instead of going through entire text at once) and use offset: to continue search from the last position. | ||||||||||||||||||||||||||||||||||||||||||||||||
| igse list |
List of files
example:
_files = call loadFile "\:igse list path:*"
Returns list of files and their attributes. Path info you'll find here. Path should have a wildcard (*). For date array structure see info date. Use argument systemtime: to return dates in system time instead of local time. File size is divided into three values (full megabytes and kilobytes are subtracted from the amount of bytes). List of possible attributes:
| ||||||||||||||||||||||||||||||||||||||||||||||||
| igse load |
File text lines
example:
_text = call loadFile Format ["\:igse load ""file:%1"" end:%2", "init.sqs", 150] Returns lines from the selected text file. Path info you'll find here. Combine argument cut: with split: to segment lines (parts will be put into additional sub-array). For large files limit range (instead of going through entire text at once) and use offset: to continue reading from the last position. Available modes:
| ||||||||||||||||||||||||||||||||||||||||||||||||
| igse new |
Create file
example:
_ok = call loadFile Format ["\:igse new ""file:%1""", "new.txt"] Creates a new file or takes action specified by the mode parameter. Path info you'll find here. Available modes:
| ||||||||||||||||||||||||||||||||||||||||||||||||
| igse rename |
Rename file
example:
_ok = call loadFile Format ["\:igse rename ""source:%1"" ""destination:%2""", "old.txt", "new.txt"] Changes name and location of a given file. Path info you'll find here. Moving files to the \fwatch\tmp\ directory is restricted. | ||||||||||||||||||||||||||||||||||||||||||||||||
| igse write |
Write text
example:
_ok = call loadFile Format ["\:igse write ""file:%1"" text:%2", "My File.txt", "Hello World!"] Writes given text in the new line at the end of the selected file. If line number was specified then instead it will replace contents of that line with given text . Use zero or negative number for a line relative from the end. Pass "t" in the escape: argument to replace \t with tabulators. Pass "n" to replace \n with new lines. Write number before the letter to limit amount of replacements. Available modes (when line number was passed):
| ||||||||||||||||||||||||||||||||||||||||||||||||
| info date |
Date and time
example:
_date = call loadFile ":info date" Gets current date, time and time zone information from Windows. Time zone variable is the difference from GMT in minutes. It does not represent current time but Windows time zone setting. Pass string to return system time instead of local time. Pass an existing array with date in order to correct its day name number (for when you modify date). | ||||||||||||||||||||||||||||||||||||||||||||||||
| info debugout |
Debug
example:
loadFile ":info debugout testing"
Output Win32 debug string. | ||||||||||||||||||||||||||||||||||||||||||||||||
| info errorlog |
Log Fwatch errors
example:
_log = call loadFile ":info errorlog true"
Enables saving Fwatch error information to the \fwatch\idb\_errorLog.txt or \fwatch\idb\_errorLogDedi.txt on a dedicated server. | ||||||||||||||||||||||||||||||||||||||||||||||||
| info resolution |
Screen resolution
example:
_array = call loadFile ":info resolution" Returns Windows desktop resolution, game window position and size, rendering area position and size. | ||||||||||||||||||||||||||||||||||||||||||||||||
| info starttime |
Game start date
example:
_ok = call loadFile ":info starttime" Returns date and time indicating when the game process was started. | ||||||||||||||||||||||||||||||||||||||||||||||||
| info tick |
Time in ms
example:
_milliseconds = call loadFile ":info tick" Returns the number of milliseconds that have elapsed since path.sqf was created. | ||||||||||||||||||||||||||||||||||||||||||||||||
| info version |
Fwatch version
example:
_version = call loadFile ":info version" Returns Fwatch version number. Pass extra parameter to get an array with additional information instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| input agetkey |
Is key pressed
example:
_x = call loadFile ":input agetkey X"
Asynchronous version of input getkey. Does not work with all the keys (use input agetkeys instead). | ||||||||||||||||||||||||||||||||||||||||||||||||
| input agetkeys |
Keyboard input
example:
_keys = call loadFile ":input agetkeys" I recommend to use InputMulti.sqs script instead. This is an asynchronous version of the input getkeys. | ||||||||||||||||||||||||||||||||||||||||||||||||
| input getjoystick |
Joystick input
example:
_joystick = call loadFile ":input getjoystick" I recommend to use InputMulti.sqs script instead. Reads joystick input using Windows API. More information you'll find in the Input Commands Info section. This command may not be entirely reliable. | ||||||||||||||||||||||||||||||||||||||||||||||||
| input getkey |
Is key pressed
example:
_x = call loadFile ":input getkey X"
Checks if given keyboard key is currently pressed. Returns 1 if so and -1 otherwise. Does not work with all the keys (use input getkeys instead). | ||||||||||||||||||||||||||||||||||||||||||||||||
| input getkeys |
Keyboard input
example:
_keys = call loadFile ":input getkeys" I recommend to use InputMulti.sqs script instead. Returns array of all keyboard keys and mouse buttons presses. If argument was passed then it will return which (left or right) SHIFT, ALT, CTRL were pressed. More information you'll find in the Input Command Info section. | ||||||||||||||||||||||||||||||||||||||||||||||||
| input getmouse |
Mouse input
example:
_mouse = call loadFile ":input getmouse" I recommend to use InputMulti.sqs script instead. Returns position of the Windows mouse cursor and state of the buttons. The latter works asynchronously, so if you query the state every 5 seconds and the button was clicked during this time the state will be true even if the button is not down at the moment. | ||||||||||||||||||||||||||||||||||||||||||||||||
| input lock |
Num, Caps, Scroll lock
example:
_lock = call loadFile ":input lock" I recommend to use InputMulti.sqs script instead. Command returns state (on / off) of the numeric keypad lock, capital letters lock and scrolling lock. | ||||||||||||||||||||||||||||||||||||||||||||||||
| input multi |
Multiple input sources
example:
_input = call loadFile ":input multi" Use this command ONLY via InputMulti.sqs script. Combination of input getkeys, input agetkeys, input lock, input getmouse, mem getcursor, mem getscroll, mem getjoystick, input getjoystick and mem getspeedkey. See also Input Commands Info. Side keys (e.g. LSHIFT, RSHIFT) are returned. WINAPI joystick input is disabled by default. Pass number from 0 to 15 to access specific device or -1 for search mode. | ||||||||||||||||||||||||||||||||||||||||||||||||
| input setmouse |
Set cursor position
example:
loadFile ":input setmouse 500 300" Sets Windows mouse cursor position to the given coordinates. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem bullets |
Projectiles properties
example:
_properties = call loadFile ":mem bullets bullet:6 shell:30" Changes projectiles properties by modifying values in the memory and returns current numbers. Acceleration is in m/s. Lifetime values are in seconds. Changes do not affect existing bullets. In multiplayer each machine creates projectile according to local settings but effects are synchronized to the computer on which the projectile was fired. I recommend to execute this command on all machines to avoid issues. Subtracting flare duration from its light duration gives you delay before the flare is lit. Flares immediately lose momentum when lit. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem error |
Error message
example:
hint loadFile ":mem error" Reads from the memory first 512 characters of the currently shown scripting error. Pass clip to copy message to the clipboard (error array will be returned instead). | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getcam |
Camera position
example:
_camera = call loadFile ":mem getcam" I recommend to use MemMulti.sqs script instead. Reads current camera values from the memory. When the camera sticks to the ground (<0.1m) then there's 0.05m disparity in height compared to the numbers returned by getPosASL and getPos2.sqf measurements. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getcinemaborder |
Black bars
example:
_border = call loadFile ":mem getcinemaborder" Reads value from the memory indicating whether cutscene borders are enabled. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getcursor |
Cursor position
example:
_cursor = call loadFile ":mem getcursor" I recommend to use InputMulti.sqs script instead. Reads dialog cursor position from the memory. X=0.5 Y=0.5 is the center of the screen. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getdate |
Mission date
example:
_date = call loadFile ":mem getdate" Reads date from the buffer. Values are written to the buffer when user looks at the watch (directly or through map screen) or when the missionStart command is executed. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getdaylight |
World brightness
example:
_light = call loadFile ":mem getdaylight" Reads values from memory regarding current amount of light. First value reaches peak at noon and goes to zero when it's fully dark. Second value is the general amount of brightness - it's month dependent. Vehicle lights are enabled around [0.33, 0.05]. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getdifficulty |
Difficulty options
example:
_difficulty = call loadFile Format [":mem getdifficulty sp %1", cadetMode] Reads game difficulty settings from the memory. First parameter does not make a difference on a dedicated server. Second parameter does not make a difference in multiplayer on client (current settings are always returned). In case of an error command returns empty array. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getgraphics |
Video settings
example:
_graphics = call loadFile ":mem getgraphics" Reads current graphics settings from the memory. Refresh rate value equals zero in windowed mode. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getjoystick |
Joystick input
example:
_joystick = call loadFile ":mem getjoystick" I recommend to use InputMulti.sqs script instead. Reads joystick input from the memory. More information you'll find in the Input Commands Info section. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getmap |
Map display
example:
_map = call loadFile ":mem getmap" I recommend to use MemMulti.sqs script instead. Reads value from the memory indicating whether 2D island map is being displayed. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getnv |
NV display
example:
_isNV = call loadFile ":mem getnv" I recommend to use MemMulti.sqs script instead. Reads value from the memory indicating whether player is using nightvision goggles. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getplayeraim |
Aim angle
example:
_aim = call loadFile ":mem getplayeraim" Output structure will change in 1.16 I recommend to use MemMulti.sqs script instead. Reads player's aim angle values from the memory. Use asin to convert crosshair pitch to degrees. Use deg to convert gun pitch to degrees. Value range for gun angles depends on weapon configuration. Gun offset and pitch are equal 0 and 1 respectively when player is inside a vehicle. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getplayeranim |
Player animation
example:
_anim = call loadFile ":mem getplayeranim" I recommend to use MemMulti.sqs script instead. Read player's soldier current animation code from the memory. More information you'll find in the Animation Codes section. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getplayerhatch |
Vehicle hatch
example:
_state = call loadFile ":mem getplayerhatch driver"
Reads values from the memory that determine if a hatch is opened or closed in player's vehicle and returns them in an array. Pass an extra argument to get a number instead - status of the specified seat. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getplayerladder |
Position on a ladder
example:
_ladder = call loadFile ":mem getplayerladder" Reads from the memory player's position on a ladder that he's currently climbing and ladder identification within the building (0 - first ladder, 1 - second etc.). | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getplayerview |
Camera type
example:
_view = call loadFile ":mem getplayerview" I recommend to use MemMulti.sqs script instead. Reads player's camera mode from the memory. A view type may be toggled but not displayed (e.g. if a weapon doesn't have optics like hand grenades). | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getradiobox |
Radio menu display
example:
_isRadio = call loadFile ":mem getradiobox" I recommend to use MemMulti.sqs script instead. Reads value from the memory value that indicates if the radio menu is displayed. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getrespawntype |
Respawn type
example:
_respawn = call loadFile ":mem getrespawntype" Reads value from the memory indicating player's respawn mode in a multiplayer mission. Details you'll find here. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getresside |
Resistance side
example:
_resistance = loadFile ":mem getresside" Reads value from the memory indicating with whom resistance units are friendly. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getscroll |
Mouse scroll
example:
_scroll = call loadFile ":mem getscroll" I recommend to use InputMulti.sqs script instead. Reads mouse scroll counter from the memory. It increases by 1 every time user rolls wheel forward and decreases by 1 when rolled backward. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getspeedkey |
Vehicle acceleration
example:
_type = loadFile ":mem getspeedkey" I recommend to use InputMulti.sqs script instead. Reads from the memory values related to forward/backward keyboard presses and estimates player's vehicle movement type. Values are zero if a dialog is displayed. If an extra parameter was passed then the command returns array with raw values instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getweather |
Current weather
example:
_current = call loadFile ":mem getweather" I recommend to use MemMulti.sqs script instead. Reads weather condition values from the memory. Weather time (float) is different from thunderbolt/wind time (integer). Use mission time (integer) to compare with the latter. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem getworld |
Island name
example:
_island = loadFile ":mem getworld" Reads island shortcut name from the memory. Pass extra parameter to get an array with additional information. Island size is a power of 2 up to 1024. Original islands have size 256. Island size won't be read on a dedicated server. Negative latitude indicates northern hemisphere. Negative longitude indicates western hemisphere. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem isdialog |
Are dialogs displayed
example:
_dialogNum = call loadFile ":mem isdialog" I recommend to use MemMulti.sqs script instead. Returns number of currently displayed dialogs from the memory. Escape menu, chat input, player list and custom dialogs increment this number by one. Multiple custom dialogs still count as one. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem masterserver |
Get/set master server
example:
_array = call loadFile ":mem masterserver get"
Reads or modifies master server address in the memory. Command only works in the main menu. Returns array for "get" operation and bool for "set". Maximum length for the second argument is 63 characters and for third - 18 characters. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem missioninfo |
Mission name
example:
_names = call loadFile ":mem missioninfo" Reads information from the memory which identifies the current mission. Mission name equals __cur_sp or __cur_mp if it's packed (PBO). | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem modlist |
Chosen modfolders
example:
_array = call loadFile :mem modlist" Reads from the memory arguments that user passed to the game and returns list of selected modfolders. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem multi |
Multiple memory values
example:
_array = call loadFile Format [":mem multi %1", dialog] Use this command ONLY via MemMulti.sqs script. Combination of mem getcam, mem getmap, mem getnv, mem getplayerview, mem getplayeraim, mem getplayeranim, mem isdialog, mem getradiobox, mem getweather. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setcam |
Change camera
example:
loadFile ":mem setcam extCameraPosition:[1,1,1]"
Modifies third person camera position in the memory. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setcursor |
Set cursor position
example:
loadFile ":mem setcursor 0.5 0.5" Changes dialog cursor position by writing values to the memory. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setdifficulty |
Change difficulty
example:
loadFile Format [":mem setdifficulty mp - %1", [true,true,false,false,"-","-","-",false,false,true,false,"-"]] Modifies game difficulty settings in the memory. Second parameter does not make difference on client in multiplayer. Changes on client in MP last until you enter mission selection screen. Pass value different than bool in order to skip option. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setgraphics |
Change video settings
example:
loadFile ":mem setgraphics brightness:1.8 viewdistance:500" Changes game graphics by modifying values in the memory. View distance modification lasts until mission termination or if user enters video settings menu. Other changes are reverted between missions except for FOV and UI which isn't restored in SP Mission Editor for testing purposes. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setmap |
Turn map on/off
example:
loadFile ":mem setmap 1"
Switches 2D island map on / off by changing value in the memory. Game does not allow showing map during a cutscene. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setplayeraim |
Set aim angle
example:
loadFile Format [":mem setplayeraim %1", [0,"-",0,0]] Input structure will change in 1.16 Modifies player's aim angle values in the memory. Pass - (minus) to skip a value. When you change direction player will turn for a couple degrees. Iterate command with time interval to reach desired orientation. Final crosshair pitch will be different from wanted pitch. See demo mission on how to apply correction. Gun offset modification has only a temporary effect. Gun pitch cannot be changed while player is in a vehicle (if you try the game will crash). Crosshair values cannot be changed if the mouse is deactivated (aka when user pressed "turn left/right", looked around with keypad, is using joystick or if dialog is displayed). You can modify gun values instead but it will work only in optics mode. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setplayeranim |
Set player animation
example:
loadFile ":mem setplayeranim 101"
Changes player's unit current animation by modifying value in the memory. It works immediately and there's no transition state. Game broadcasts this change in multiplayer. Sometimes animation may stop in the middle or be played infinitely (e.g. moving forward) - it depends on previous unit state (before modification). Using code out of range will crash the game. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setplayerhatch |
Turn in/out
example:
loadFile ":mem setplayerhatch driver"
Causes player to open or close hatch in his vehicle by modifying value in the memory. If second parameter was not specified then it will change to the opposite value. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setplayerladder |
Move player on a ladder
example:
loadFile ":mem setplayerladder 0.5"
Changes player's position on a ladder and/or on a current ladder in the building. If given ID is out of range then the game will crash. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setplayerview |
Change camera type
example:
loadFile ":mem setplayerview internal"
Changes player's camera mode by modifying "toggle" value in the memory. Identical to switchCamera. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setradiobox |
Radio menu on/off
example:
loadFile ":mem setradiobox true"
Shows/hide radio menu by modifying value in the memory. Sometimes it doesn't work if menu wasn't invoked manually before. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setrespawntype |
Change respawn
example:
loadFile ":mem setrespawntype 0"
Changes player's respawn mode by modifying value in the memory. Respawn types you'll find here. Changing respawn after you died in "NONE" or "BIRD" won't have an effect. Changing respawn to "INSTANT" or "BASE" will not work after you died once in "GROUP". | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setspeedkey |
Set vehicle acceleration
example:
loadFile ":mem setspeedkey forward"
Changes player's vehicle speed by modyfing value in the memory. To take effect command must be iterated in short cycles. It won't work during a cutscene. | ||||||||||||||||||||||||||||||||||||||||||||||||
| mem setweather |
Change weather
example:
_current = call loadFile ":mem setweather maxtide:-100"
Changes weather values in the memory. Game updates weather condition every couple of seconds. Changes done to tide and wave values are reverted between missions. When changing sea level I recommend to execute this command on all machines to avoid desynchronization. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string case |
Shift text case
example:
_text = loadFile Format ["\:string case text:%1 Transforms letters in a string to lower or uppercase. If words: was enabled then upper: will capitalize letters starting words and lower: will lowercase everything else. If sentences: was enabled then upper: will capitalize letters starting sentences and lower: will lowercase everything else. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string compare |
Compare text
example:
_value = call loadFile Format ["\:string compare text1:%1 Compares two strings with each other according to the lexicographical order. Alternatively use natural: to compare in a natural order. Option reverseCase: use in combination with caseSensitive:. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string cut |
Get text part
example:
_hello = loadFile Format ["\:string cut text:%1 Returns portion of the given text. Default start: value is zero and for end: it's length of the text. If starting position is larger than end position then the command will return characters backwards. Use exclude: to cut text from the middle. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string domain |
URL domain
example:
_split = call loadFile "\:string domain http://ofp-faguss.com/fwatch"
Splits web address into parts. Pass string without quotation marks. Number indicates where the query string begins in the first array. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string find |
Text search
example:
_positions = call loadFile Format ["\:string find text:%1 Returns array with positions of all occurrences in a given text. Default result limit is -1 (no limit). | ||||||||||||||||||||||||||||||||||||||||||||||||
| string first |
First occurrence
example:
_x = call loadFile Format [{:string first "%1" "%2"}, "foo", "xx foo yy foo"]
Returns position of the first occurrence in the given text or -1 if not found. I recommend to use string find instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string index |
Single character
example:
_letter = call loadFile Format [{:string index "%1" 1}, "hello"]
Returns a character (wrapped in quotation marks) from the given text at the specified position. I recommend to use string cut instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string isempty |
Is text there
example:
_isEmpty = call loadFile format ["\:string isempty %1", " "] Determines if given string consists entirely out of whitespace (e.g. spaces, tabs). Pass string without wrapping it in quotation marks. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string isnumber |
Is text a number
example:
_value = loadFile Format ["\:string isnumber text:%1", "50.58"] Determines if given string consists out of digits. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string isvariable |
Check var name
example:
_isVar = call loadFile format ["\:string isvariable text:%1", "_var10"] Determines if a string can be used as a scripting variable name. Available modes:
| ||||||||||||||||||||||||||||||||||||||||||||||||
| string join |
Merge text
example:
_text = loadFile Format ["\:string join text:%1 Returns combination of two strings merged at a given position. If argument position: was not passed then text is added at the end. Pass negative number for a position relative from the end. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string last |
Last occurrence
example:
_x = call loadFile Format [{:string first "%1" "%2"}, "foo", "xx foo yy foo"]
Returns position of the last occurrence in the given text or -1 if not found. I recommend to use string find instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string length |
Text size
example:
_length = call loadFile Format [{:string length "%1"}, "hello"]
Returns the number of characters in the given text. I recommend to use string size instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string range |
Get text part
example:
_cut = call loadFile Format [{:string range "%1" 1 4}, "hello"]
Returns the range of characters (wrapped in quotation marks) from the given text. I recommend to use string cut instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string replace |
Replace text
example:
_text = loadFile Format ["\:string replace text:%1 Replaces all occurrences in a string with given text. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string replacechar |
Replace characters
example:
_text = loadFile Format ["\:string replacechar text:%1 Replaces all occurrences of the selected characters in a string with given single character. Use matchWord: to match standalone characters. Use correspond: to replace character with corresponding character from the replace: argument. If there's no replacement match then the character will be removed. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string size |
Text length
example:
_length = call loadFile Format ["\:string size %1", "foo bar"] Returns the number of characters in the given text. Pass string without quotation marks. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string split |
Split letters
example:
_array = call loadFile Format ["\:string split text:%1", "hello"] Splits string into fragments and returns them in an array. Default segment size is 1. Default segment limit is -1 (no limit). Default start position is 0 and end position is last character. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string toarray |
Split letters
example:
_array = call loadFile Format [{:string toarray "%1"}, "hello"]
Returns all characters from the given string as array items. I recommend to use string split instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string tokenize |
Split text
example:
_array = call loadFile Format ["\:string tokenize text:%1 Splits string using given characters as delimiters and returns fragments in an array. Use wordDelimiter: argument to treat delimiter as a word. With addEmpty:start first item in the array will be empty string if the source begins with a delimiter. With addEmpty:end last item in the array will be empty string if the source ends with a delimiter. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string tolower |
Lowercase text
example:
_text = call loadFile Format [{:string tolower "%1"}, "HELLO"]
Returns string (wrapped in quotation marks) in lower case. I recommend to use string case instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string toupper |
Uppercase text
example:
_text = call loadFile Format [{:string toupper "%1"}, "hello"]
Returns string (wrapped in quotation marks) in upper case. I recommend to use string case instead. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string trim |
Remove spaces
example:
_string = loadFile Format ["\:string trim text:%1 Removes whitespace from the given text according to the selected mode. | ||||||||||||||||||||||||||||||||||||||||||||||||
| string wordpos |
Word search
example:
_positions = call loadFile Format ["\:string wordpos text:%1", "Hello World!"] Finds positions of all words and returns them in an array. | ||||||||||||||||||||||||||||||||||||||||||||||||