Script Builder

Back to Index

The Script Builder allows you to create your own scripts for reading archives.


Script Builder Button


The main field is where you write your script, or an existing script can be loaded from the dropdown list below. A the bottom, there is a list of the available commands - double clicking a command will insert it into your script.

When you have finished, you can check your script for syntax errors, and test it on an archive. When you are satisfied, you can save the script, allowing you to use it in Game Extractor at any time.

The best way to learn how to script is to look at any of the scripts that come with Game Extractor - they provide excellent examples that you can copy from and study.

The commands are as follows...

CleanExit ;
Stops running the script.

CLog (name) (offset) (compressedLength) (offsetOffset) (compressedLengthOffset) (decompressedLength) (decompressedLengthOffset) ;
Records a compressed file.

ComType (compressionType) ;
The type of compression used in the archive.

Do ;
(commands)
While (variable) (function) (check) ;

Repeats the (commands) whilever the While statement evaluates to true.

FindLoc (variable) (type) (searchValue) (fileNumber) ;
Finds the next occurance of the (searchValue) in the file.

For (variable) = (startValue) To (endValue) ;
(commands)
Next (variable) ;

Repeats the (commands) for each of the items in the loop.

Get (variable) (type) (fileNumber) ;
Reads a value from the file.

GetCT (variable) (type) (terminator) (fileNumber) ;
Keeps reading from the file until it reads the terminator, then stops.

GetDString (variable) (length) (fileNumber) ;
Reads a string of text, of the given length.

GoTo (variable) (fileNumber) ;
Jumps to a different location in the archive.

IDString (fileNumber) (string) ;
Reads the ID string from the start of an archive.

If (variable) (function) (check) ;
(commands1)
Else ;
(commands2)
EndIf ;

Runs the (commands1) if the statement evaluates to true, otherwise runs (commands2).

ImpType (replaceType) ;
Whether files can be replaced in the archive or not.

Log (name) (offset) (length) (offsetOffset) (lengthOffset) ;
Records a non-compressed file.

Math (firstVariable) (function) (secondVariable) ;
Performs a methematical operation.

Open (directory) (filename) (fileNumber) ;
Opens an additional file.

ReverseLong (variable) ;
Changes the variable to BigEndian order.

SavePos (variable) (fileNumber) ;
Gets the current offset in the file.

Set (variable) (value) ;
Creates or sets a value.

String (firstVariable) (function) (secondVariable) ;
Add or remove text from a string.


Some commands can only use preset values...

(type)
Long, Int, Byte, String

(function)
+=, -=, *=, /=, <, >, <=, >=, =, <>

(replaceType)
Standard, SFileOff, SFileSize, None, StandardTail

(compressionType)
ZLib1


For further information about scripts, and for more script examples, see the Wiki at http://wiki.xentax.com