A base class for all user scripts to inherit. Only scripts that inherit directly from this class and have a default (parameterless) public constructor will be detected and started.
More...
|
static void | Wait (int ms) |
| Pauses execution of the Script for a specific amount of time. Must be called inside the main script loop (the Tick event or any sub methods called from it). More...
|
|
static void | Yield () |
| Yields the execution of the script for 1 frame. More...
|
|
static T | InstantiateScript< T > () |
| Spawns a new Script instance of the specified type. More...
|
|
|
EventHandler | Tick |
| An event that is raised every tick of the script. Put code that needs to be looped each frame in here. More...
|
|
EventHandler | Aborted |
| An event that is raised when this Script gets aborted for any reason. This should be used for cleaning up anything created during this Script. More...
|
|
WinForms.KeyEventHandler | KeyUp |
| An event that is raised when a key is lifted. The System.Windows.Forms.KeyEventArgs contains the key that was lifted. More...
|
|
WinForms.KeyEventHandler | KeyDown |
| An event that is raised when a key is first pressed. The System.Windows.Forms.KeyEventArgs contains the key that was pressed. More...
|
|
string | Name [get] |
| Gets the name of this Script. More...
|
|
string | Filename [get] |
| Gets the filename of this Script. More...
|
|
bool | IsPaused [get] |
| Checks if this Script is paused. More...
|
|
bool | IsRunning [get] |
| Checks if this Script is running. More...
|
|
bool | IsExecuting [get] |
| Checks if this Script is executing. More...
|
|
ScriptSettings | Settings [get] |
| Gets an INI file associated with this Script. The File will be in the same location as this Script but with an extension of ".ini". Use this to save and load settings for this Script. More...
|
|
int | Interval [get, set] |
| Gets or sets the interval in ms between Tick for this Script. Default value is 0 meaning the event will execute once each frame. More...
|
|
A base class for all user scripts to inherit. Only scripts that inherit directly from this class and have a default (parameterless) public constructor will be detected and started.
◆ Script()
◆ Abort()
void GTA.Script.Abort |
( |
| ) |
|
Aborts execution of this Script.
◆ GetRelativeFilePath()
string GTA.Script.GetRelativeFilePath |
( |
string |
filePath | ) |
|
Gets the full file path for a file relative to this Script. e.g: GetRelativeFilePath("ScriptFiles\texture1.png")
may return "C:\Program Files\Rockstar Games\Grand Theft Auto V\scripts\ScriptFiles\texture1.png"
.
- Parameters
-
filePath | The file path relative to the location of this Script. |
◆ InstantiateScript< T >()
static T GTA.Script.InstantiateScript< T > |
( |
| ) |
|
|
static |
Spawns a new Script instance of the specified type.
◆ Pause()
void GTA.Script.Pause |
( |
| ) |
|
Pause execution of this Script.
◆ Resume()
void GTA.Script.Resume |
( |
| ) |
|
Starts execution of this Script after it has been Paused.
◆ ToString()
override string GTA.Script.ToString |
( |
| ) |
|
Returns a string that represents this Script.
◆ Wait()
static void GTA.Script.Wait |
( |
int |
ms | ) |
|
|
static |
Pauses execution of the Script for a specific amount of time. Must be called inside the main script loop (the Tick event or any sub methods called from it).
- Parameters
-
ms | The time in milliseconds to pause for. |
◆ Yield()
static void GTA.Script.Yield |
( |
| ) |
|
|
static |
Yields the execution of the script for 1 frame.
◆ BaseDirectory
string GTA.Script.BaseDirectory => Path.GetDirectoryName(Filename) |
Gets the Directory where this Script is stored.
◆ Aborted
EventHandler GTA.Script.Aborted |
|
addremove |
An event that is raised when this Script gets aborted for any reason. This should be used for cleaning up anything created during this Script.
◆ Filename
string GTA.Script.Filename |
|
get |
Gets the filename of this Script.
◆ Interval
Gets or sets the interval in ms between Tick for this Script. Default value is 0 meaning the event will execute once each frame.
◆ IsExecuting
bool GTA.Script.IsExecuting |
|
get |
Checks if this Script is executing.
◆ IsPaused
Checks if this Script is paused.
◆ IsRunning
bool GTA.Script.IsRunning |
|
get |
Checks if this Script is running.
◆ KeyDown
WinForms.KeyEventHandler GTA.Script.KeyDown |
|
addremove |
An event that is raised when a key is first pressed. The System.Windows.Forms.KeyEventArgs contains the key that was pressed.
◆ KeyUp
WinForms.KeyEventHandler GTA.Script.KeyUp |
|
addremove |
An event that is raised when a key is lifted. The System.Windows.Forms.KeyEventArgs contains the key that was lifted.
◆ Name
◆ Settings
Gets an INI file associated with this Script. The File will be in the same location as this Script but with an extension of ".ini". Use this to save and load settings for this Script.
◆ Tick
EventHandler GTA.Script.Tick |
|
addremove |
An event that is raised every tick of the script. Put code that needs to be looped each frame in here.
The documentation for this class was generated from the following file:
- C:/Users/nitan/source/repos/scripthookvdotnet/source/scripting_v3/GTA/Script.cs