Misc

Miscellaneous methods that dont go in any other sections.


SimbaEnv

type
  SimbaEnv = record
    const SimbaPath       = 'PathToSimbaDir';
    const IncludesPath    = 'PathToSimbaDir/Includes';
    const PluginsPath     = 'PathToSimbaDir/Plugins';
    const ScriptsPath     = 'PathToSimbaDir/Scripts';
    const ScreenshotsPath = 'PathToSimbaDir/Screenshots';
    const DataPath        = 'PathToSimbaDir/Data';
    const TempPath        = 'PathToSimbaDir/Data/Temp';
  end;

Record which contains constants to Simba environment paths.

Example:

WriteLn(SimbaEnv.ScriptsPath);

ClearSimbaOutput

procedure ClearSimbaOutput;

Clear the scripts output box in Simba.


SetSimbaSetting

function SetSimbaSetting(Name: String; DefValue: String = ''): String;

GetSimbaSetting

procedure GetSimbaSetting(Name, Value: String);

PlaySound

procedure PlaySound(Sound: String);

StopSound

procedure StopSound;

SetClipBoard

procedure SetClipBoard(Data: string);

Sets the systems clipboard string.


GetClipBoard

function GetClipBoard: String;

Returns the systems clipboard string.


ShowComboDialog

function ShowComboDialog(Caption, Prompt: string; List: TStringArray): Integer;

ShowQueryDialog

function ShowQueryDialog(Caption, Prompt: String; var Value: String): Boolean;

EDialogIcon

enum(NONE, ERROR, WARNING, INFO)

The icon a dialog can have.

Note

This enum is scoped so use like EDialogIcon.ERROR


EDialogButton

enum(YES, NO, OK, CANCEL, ABORT, RETRY, IGNORE, ALL, NO_TO_ALL, YES_TO_ALL, CLOSE)

The buttons a dialog can have.

Note

This enum is scoped so use like EDialogButton.YES


ShowDialog

function ShowDialog(Icon: EDialogIcon; Buttons: EDialogButtons; Title, Msg: String): EDialogButton;

Show a dialog waiting until a button is used. Once closed will return which button was clicked.

Note

If the dialog was closed without a button EDialogButton.CLOSE will be returned.


ShowDTMEditor

function ShowDTMEditor(Target: TTarget): String;
function ShowDTMEditor: String;

ShowACA

function ShowACA(Target: TTarget; Title: String): TColorTolerance;
function ShowACA: TColorTolerance;

ShowDirectoryDialog

function ShowDirectoryDialog(Title, InitialDirectory: String; out Directory: String): Boolean;

ShowTrayNotification

procedure ShowTrayNotification(Title, Message: String; Timeout: Integer = 3000);

SetSimbaTitle

procedure SetSimbaTitle(S: String);

GetSimbaPID

function GetSimbaPID: TProcessID;

Returns the Simba’s PID this script is running in.


GetSimbaTargetPID

function GetSimbaTargetPID: TProcessID;

Returns the current Simba target PID (what is selected with the crosshair)


GetSimbaTargetWindow

function GetSimbaTargetWindow: TWindowHandle;

Returns the current Simba target window (what is selected with the crosshair)


SaveScreenshot

function SaveScreenshot: String;

Saves a screenshot of the current target. Returns the screenshot path, which will be in Simba’s Screenshots directory.


SaveScreenshot

function SaveScreenshot(FileName: String): String;

Saves a screenshot of the current target to the given filename. Will overwrite if the file already exists.


AddOnTerminate

procedure AddOnTerminate(Proc: procedure);
procedure AddOnTerminate(Proc: procedure of object);

Adds a procedure to be called when the script is terminated.


AddOnUserTerminate

procedure AddOnUserTerminate(Proc: procedure);
procedure AddOnUserTerminate(Proc: procedure of object);

Adds a procedure to be called when the script is terminated with the stop button being clicked.


AddOnPause

procedure AddOnPause(Proc: procedure);
procedure AddOnPause(Proc: procedure of object);

Adds a procedure to be called when the script is paused.


AddOnResume

procedure AddOnResume(Proc: procedure);
procedure AddOnResume(Proc: procedure of object);

Adds a procedure to be called when the script is resumed from pause.


AddOnResume

procedure AddOnResume(Proc: procedure);
procedure AddOnResume(Proc: procedure of object);

Adds a procedure to be called when the script is resumed from pause.


TerminateScript

procedure TerminateScript;
procedure TerminateScript(Reason: String);

Terminates the script on the next operation.


PauseScript

procedure PauseScript;

Programmatically pauses the script. The only way for the script to resumed is by the user clicking the play button.


GetTimeRunning

function GetTimeRunning: UInt64;

Returns milliseconds since the script was started.


GetTimeStamp

function GetTimeStamp(Format: String = '[hh:mm:ss:uu]'): String;

Formats GetTimeRunning using FormatMilliseconds