API Documentation
Greetings and welcome to our documentation! This resource provides you all the necessary information on how to effectively use our API :)
General Guidelines
-
It is recommended that native calls be executed in a script thread. To ensure native-safety, we convert both the API and DirectX threads into appropriate threads to allow invoking. However, it is important to note that issues may arise in relation to entity spawning/editing if the native isn't directly called on a script thread.
-
In the event that it is necessary to pause execution within an option function callback that is run in DirectX mode (.click_dx), it is advisable to create a DirectX thread/job instead of invoking the sleep functon, as this will cause the main menu thread to be paused.
-
It is strongly advised not to utilize time.sleep for the purpose of sleeping/yielding within a DirectX or script thread. Instead, it is recommended to use menu.sleep.
-
Your script must have the following code at the bottom of __init__.py, otherwise the script will terminate when it reaches the end of the script.
Script Installation
North will perform a recursive scan of the scripts directory to locate __init__.py. All local modules you create will be supported and can be loaded from the same directory as the file (or any directory deeper). Furthermore, the __location__ variable will contain the current working directory of your script.
Trusted Mode
Certain functions within the API may post a risk to your account if used improperly. To mitigate this risk, these features are disabled by default. However, if you wish to use a script that requires these functions, you may enable Trusted Mode. It is important to note that scripts that rely on these features will not function properly if they are not enabled. Fortunately, it is possible to toggle these features both prior to loading a script and during the script's execution.
- Stats
- Globals and Locals
- HTTP
- Memory
- Transactions
Global Types
Vector2
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Vec2 |
Vec2() |
Same as Vec2(0.0, 0.0) |
| Constructor |
Vec2 |
Vec2(xy: float) |
Same as Vec2(xy, xy) |
| Constructor |
Vec2 |
Vec2(x: float, y: float) |
Returns a Vec2 |
| Property |
float |
x |
Returns the x value |
| Property |
float |
y |
Returns the y value |
Example
from north import Vec2
pos = Vec2(12.0, 345.0)
print(f'The position is {pos.x}, {pos.y}')
Vector3
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Vec3 |
Vec3() |
Same as Vec3(0.0, 0.0, 0.0) |
| Constructor |
Vec3 |
Vec3(xyz: float) |
Same as Vec3(xyz, xyz, xyz) |
| Constructor |
Vec3 |
Vec3(x: float, y: float, z: float) |
Returns a Vec3 |
| Property |
float |
x |
Returns the x value |
| Property |
float |
y |
Returns the y value |
| Property |
float |
z |
Returns the z value |
Example
from north import Vec3
pos = Vec3(12.0, 345.0, 23.34)
print(f'The position is {pos.x}, {pos.y}, {pos.z}')
Localization
from north import Localization
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Localization |
Localization() |
Returns an empty Localization |
| Constructor |
Localization |
Localization(str) |
Returns a Localization |
| Method |
None |
reset() |
Resets the translated string back to the original |
| Method |
None |
set(string: str) |
Sets the original and translated |
| Method |
None |
set_mapped(string: str) |
Sets the translated string |
| Method |
None |
set_translate(bool) |
Sets the active string to be the translated string |
| Method |
str |
get_original() |
Returns the original string |
| Method |
str |
get() |
Returns the active string |
| Method |
bool |
has_translation() |
Returns if the string is marked as translated |
| Property |
bool |
Translate |
Value set by set_translate |
| Property |
str |
Original |
Value set by set |
| Property |
str |
Mapped |
Value set by set_mapped |
Example
from north import Localization
val = Localization('i love north')
val.set_mapped('j\'aime le nord')
print(f'non translated: {val.get_original()}')
print(f'non translated: {val.get()}')
print(f'translated: {val.Mapped}')
val.set_translate(True) # or val.Translate = True
print(f'translated: {val.get()}')
Color
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Color |
Color() |
Same as Color(0, 0, 0, 0) |
| Constructor |
Color |
Color(r: int, g: int, b: int, a: int) |
Returns a Color |
| Property |
int |
r |
Returns the r value |
| Property |
int |
g |
Returns the b value |
| Property |
int |
b |
Returns the b value |
| Property |
int |
a |
Returns the a value |
Example
from north import Color
col = Color(123, 23, 45, 200)
print(f'The red value is {col.r}')
Modules
Players
import north.players as players
Player
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
Id |
The id of the player |
| Property |
str |
Name |
The name of the player |
| Property |
bool |
Connected |
If the player is connected to the session fully |
| Property |
bool |
Exists |
If the players ped exists |
| Property |
bool |
Alive |
If the players ped is alive |
| Property |
bool |
InVehicle |
If the player is in a vehicle |
| Property |
bool |
HasWeaponInHand |
If the player has a weapon in their hand |
| Property |
bool |
IsAiming |
If the player is aiming at anything |
| Property |
bool |
IsFriend |
If the player is your friend |
| Property |
bool |
IsModder |
If the player is modding |
| Property |
bool |
IsScriptHost |
If the player is host of the freemode script |
| Property |
bool |
IsSpectating |
If you're spectating the player |
| Property |
bool |
HasBounty |
If the player has a bounty |
| Property |
int |
BountyValue |
The value of the bounty |
| Property |
int |
WeaponHash |
The hash of their equipped weapon |
| Property |
int |
ModelHash |
The hash of their model |
| Property |
Vec3 |
Coords |
Their current position |
| Property |
Vec3 |
Rotation |
Their current rotation (order 2) |
| Property |
Vec2 |
Waypoint |
Their current waypoint position |
| Property |
float |
Heading |
Their current heading |
| Property |
float |
Speed |
Their current speed |
| Property |
float |
FOVRatio |
Their FOV ratio |
| Property |
float |
AspectRatio |
Their aspect ratio |
| Property |
int |
Ped |
The script handle of their ped |
| Property |
int |
Entity |
The script handle of their ped or vehicle |
| Property |
int |
WeaponEntity |
The script handle of their weapon |
| Property |
int |
Vehicle |
The script handle of their vehicle |
| Method |
Player |
selected() |
Returns Player for the selected player in the menu |
| Method |
Player |
local() |
Returns Player for the local player (you!) |
| Method |
bool |
session() |
Returns if the selected player is the session |
| Method |
None |
for_each(function) |
Iterates each player and calls function with param Player |
| Method |
Player |
get(index: int) |
Returns Player for the player index |
| Method |
Player |
random(ignore: int <opt>) |
Returns a random Player, ignoring ignore |
| Method |
None |
lost_connection_kick() |
Kicks the player |
| Method |
None |
session_host_kick() |
Kicks the player (requires you to be session host) |
| Method |
None |
freemode_host_kick() |
Kicks the player (requires you to be script host) |
Example
import north.players as players
print(f'My name is: {players.Player.Local().Name}')
print(f'The players name that i have selected in North is: {players.Player.Selected().Name}')
print(f'The players name in slot 0 is: {players.Player.get(0).Name}')
print(f'Here is the name of a random player: {players.Player.random(players.Player.Local().Id).Name}')
print('Here is a list of every player in the session:')
players.Player.for_each(lambda player: print(f'{player.Name}'))
Memory
import north.memory as memory
| Member |
(Return) Type |
Name |
Description |
| Method |
ScanResult |
scan(pattern: str) |
Scans for the signature |
| Method |
MemoryAddress[] |
scan_all(pattern: str) |
Scans for the signature and returns all hits |
| Method |
ScanResult |
scan_module(module: str, pattern: str) |
Scans for the signature inside the module |
| Method |
MemoryAddress |
base_address() |
Returns the base address of the game |
| Method |
MemoryAddress |
module_base_address(module: str) |
Returns the base address of the module |
Example
import north.memory as memory
print(f'Base: {memory.base_address().Address}')
print(f'SocialClub.dll base: {memory.module_base_address('SocialClub.dll').Address}')
scan_result = memory.scan('48 8B 0D ? ? ? ? 4C 8D 44 24 20 48 8B D7 E8 ? ? ? ? B0 01')
if scan_result.Success:
print(f'Network Base Config: {scan_result.Address.read(3, 7).UInt64}')
scan_results = memory.scan_all('48 8B 0D ? ? ? ? 4C')
for result in scan_results:
print(f'Found hit at {result.Address}')
scan_result = memory.scan_module('SocialClub.dll', '48 8B 0D ? ? ? ? 4C')
if scan_result.Success:
print(f'Found hit in SocialClub at: {scan_result.Address.Address}')
MemoryAddress
| Member |
(Return) Type |
Name |
Description |
| Constructor |
MemoryAddress |
MemoryAddress() |
Sets the address to 0 |
| Constructor |
MemoryAddress |
MemoryAddress(address: int) |
Returns a MemoryAddress |
| Property |
int |
Address |
Get or set the address |
| Property |
int |
Byte(value: int) |
Get or set the address as a 1 byte value |
| Property |
int |
UByte(value: int) |
Get or set the address as a 1 byte unsigned value |
| Property |
int |
Short(value: int) |
Get or set the address as a 2 byte value |
| Property |
int |
UShort(value: int) |
Get or set the address as a 2 byte unsigned value |
| Property |
int |
Int(value: int) |
Get or set the address as a 4 byte value |
| Property |
int |
UInt(value: int) |
Get or set the address as a 4 byte unsigned value |
| Property |
int |
Int64(value: int) |
Get or set the address as an 8 byte value |
| Property |
int |
UInt64(value: int) |
Get or set the address as an 8 byte unsigned value |
| Property |
int |
Float(value: float) |
Get or set the address as float |
| Property |
int |
Double(value: float) |
Get or set the address as a double |
| Property |
int |
Str(value: str) |
Get or set the address as a string |
| Property |
int |
Vec2(value: Vec2) |
Get or set the address as a Vec2 value |
| Property |
int |
Vec3(value: Vec3) |
Get or set the address as a Vec3 value |
| Method |
None |
nop(count: int) |
Writes count nops to the address |
| Method |
MemoryAddress |
read(opcode_size: int, opcode_length: int) |
The value at the address |
Example
import north.memory as memory
address = memory.MemoryAddress(memory.base_address() + 0x12345)
print(f'Current value: {address.Int}')
address.Int = 12345
print(f'New value: {address.Int}')
print(f'Pointer value: {address.read(3, 7).UInt64}')
ScanResult
| Member |
(Return) Type |
Name |
Description |
| Property |
bool |
Success |
If the scan was successful |
| Property |
MemoryAddress |
Address |
The resulting MemoryAddress |
Example
import north.memory as memory
scan_result = memory.scan('48 8B 0D ? ? ? ? 4C 8D 44 24 20 48 8B D7 E8 ? ? ? ? B0 01')
if scan_result.Success:
print(f'Network Base Config: {scan_result.Address.read(3, 7).UInt64}')
Pools
import north.pools as pools
| Member |
(Return) Type |
Name |
Description |
| Method |
EntityPool |
get_stunt_jumps() |
Returns an EntityPool for this entity type |
| Method |
EntityPool |
get_pickups() |
Returns an EntityPool for this entity type |
| Method |
EntityPool |
get_peds() |
Returns an EntityPool for this entity type |
| Method |
EntityPool |
get_objects() |
Returns an EntityPool for this entity type |
| Method |
EntityPool |
get_vehicles() |
Returns an EntityPool for this entity type |
EntityPool
| Member |
(Return) Type |
Name |
Description |
| Property |
int[] |
Entities |
Returns a list of script handles |
| Property |
int |
MaxSize |
Returns the max size for the pool |
Example
import north.pools as pools
peds = pools.get_peds()
print(f'Ped pool: {len(peds.Entities)}/{peds.MaxSize}')
for entity in peds.Entities:
print(f'found ped with handle {entity}')
Hashlist
import north.hashlist as hashlist
| Member |
(Return) Type |
Name |
Description |
| Method |
VehicleHashList[] |
get_vehicles() |
Returns a list of VehicleHashList for all vehicles |
| Method |
int[] |
get_weapon_components() |
Returns a list of weapon component hashes |
VehicleHashList
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
Hash |
The hash of the vehicle |
| Property |
str |
Name |
The game name for the vehicle |
| Property |
str |
NameDLC |
The name of the DLC the vehicle belongs to (if none, returns 'Empty') |
| Property |
int |
Class |
The class of the vehicle |
Example
import north.hashlist as hashlist
vehicles = hashlist.get_vehicles()
for vehicle in vehicles:
print(f'Vehicle {vehicle.Name} with hash {vehicle.Hash} belongs to DLC {vehicle.NameDLC}')
for comp in hashlist.get_weapon_components():
print(f'Found weapon component {comp}')
Stats
import north.stats as stats
Stat
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Stat |
Stat(stat_name: str) |
Returns a Stat |
| Constructor |
Stat |
Stat(stat_hash: int) |
Returns a Stat |
| Property |
int |
Int |
Get or set the stat to an int |
| Property |
float |
Float |
Get or set the stat to a float |
| Property |
bool |
Bool |
Get or set the stat to a bool |
Example
import north.stats as stats
print(f'My character 0\'s rank XP is {stats.Stat('MP0_CHAR_RANK_FM').Int}')
stats.Stat('MP0_CHAR_RANK_FM').Int += 10
print(f'My character 0\'s rank XP is {stats.Stat('MP0_CHAR_RANK_FM').Int}')
Native
import north.natives as native
| Member |
(Return) Type |
Name |
Description |
| Method |
NativeContext |
invoke(hash: int, ...) |
Invokes a native |
NativeContext
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
Int |
Gets the return as an int |
| Property |
float |
Float |
Gets the return as a float |
| Property |
bool |
Bool |
Gets the return as a bool |
| Property |
Vec2 |
Vec2 |
Gets the return as a Vec2 |
| Property |
Vec3 |
Vec3 |
Gets the return as a Vec3 |
| Property |
str |
Str |
Gets the return as a str |
Example
import north.natives as native
handle = native.invoke(0xD80958FC74E988A6).Int
print(f'My ped handle is {handle}')
Events
import north.events as events
| Member |
(Return) Type |
Name |
Description |
| Method |
None |
add_listener(type: events.Types, callback(event: ...): None) |
Adds an event listener |
| Method |
None |
add_hook(type: events.Types, callback(event: ...): bool) |
Adds an event hook (return False to not allow the event) |
Events
| Member |
Name |
Description |
| Property |
PlayerJoinSession |
Data for player joined the session |
| Property |
PlayerLeaveSession |
Data for player left the session |
| Property |
ModderDetected |
Data for player was detected as a modder |
| Property |
ScriptEvent |
Data for script event received |
| Property |
ChatMessage |
Data for global chat message received |
| Property |
TextMessage |
Data for text message received |
Types
| Member |
Name |
Description |
| Enum |
PlayerJoinSessionEvent |
Player joined the session |
| Enum |
PlayerLeaveSessionEvent |
Player left the session |
| Enum |
ModderDetectedEvent |
Player was detected as a modder |
| Enum |
ScriptEventEvent |
Script event received |
| Enum |
ChatMessageEvent |
Global chat message received |
| Enum |
TextMessageEvent |
Text message received |
PlayerJoinSession
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
Slot |
Returns the slot (id) of the player joining |
| Property |
str |
Name |
Returns the players name |
| Property |
str |
IP |
Returns the players IP |
| Property |
int |
RockstarId |
Returns the players rockstar id |
| Property |
int |
PeerToken |
Returns the players peer token |
PlayerLeaveSession
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
Slot |
Returns the slot (id) of the player leaving |
ModderDetected
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
PlayerId |
Returns the id of the player |
| Property |
int |
Reason |
Returns the reason for the player being flagged |
ScriptEvent
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
PlayerId |
Returns the id of the player |
| Property |
int |
EventId |
Returns the event id of the script event |
| Property |
int[] |
Params |
Returns the params of the script event starting at index 2 |
ChatMessage
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
PlayerId |
Returns the id of the player |
| Property |
str |
Message |
Returns the mesage |
| Property |
bool |
Team |
Returns whether the message was sent to team only |
TextMessage
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
PlayerId |
Returns the id of the player |
| Property |
str |
Message |
Returns the mesage |
Example
import north.events as events
import north.players as players
def player_join_session_event(event):
print(f'{event.PlayerJoinSession.Name} is joining into slot {event.PlayerJoinSession.Slot}')
pass
events.add_listener(events.Types.PlayerJoinSessionEvent, player_join_session_event)
def script_event_hook(event):
if event.ScriptEvent.EventId == 1234:
if event.ScriptEvent.Params[0] == 1:
print(f'Blocking script event from {players.Player.get(event.ScriptEvent.PlayerId).Name}')
return False
return True
events.add_hook(events.Types.ScriptEventEvent, script_event_hook)
import north.input as game_input
| Member |
(Return) Type |
Name |
Description |
| Method |
bool |
is_mouse_within(pos: Vec2, scale: Vec2) |
Returns if the mouse is within a position |
| Method |
bool |
is_pressed(vkey: int) |
Returns if the virtual key is pressed |
| Method |
bool |
is_just_pressed(vkey: int) |
Returns if the virtual key was just pressed |
| Method |
bool |
is_just_released(vkey: int) |
Returns if the virtual key was just released |
| Method |
bool |
is_mouse_pressed(vkey: int) |
Returns if the mouse key is pressed |
| Method |
bool |
is_mouse_just_pressed(vkey: int) |
Returns if the mouse key was just pressed |
| Method |
bool |
is_mouse_just_released(vkey: int) |
Returns if the mouse key was just released |
| Method |
bool |
is_mouse_double_clicked(vkey: int) |
Returns if the mouse key was just double clicked |
| Method |
bool |
is_pad_pressed(key: int) |
Returns if a controller key (or game input) is pressed |
| Method |
bool |
is_pad_just_pressed(key: int) |
Returns if a controller key (or game input) was just pressed |
| Method |
bool |
is_pad_just_released(key: int) |
Returns if a controller key (or game input) was just released |
| Method |
str |
get_key_name(vkey: int) |
Returns a name for the virtual key |
| Method |
str |
get_clipboard_text() |
Returns the contents of the clipboard |
| Method |
None |
set_clipboard_text(text: str) |
Sets the contents of the clipboard |
Example
import north.input as game_input
print(f'Current clipboard text: {game_input.get_clipboard_text()}')
VK_F4 = 0x73 # https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
print(f'Is F4 pressed? {game_input.is_pressed(VK_F4)}')
ScApi
import north.scapi as scapi
| Member |
(Return) Type |
Name |
Description |
| Method |
None |
get_profile_from_rid(rid: int, callback(success: bool, account: ScApiRockstarAccount): None) |
Gets profile from the rockstar ID |
| Method |
None |
get_profiles_from_name(name: str, page_offset: int, callback(success: bool, accounts: ScApiRockstarAccount[], info: ScApiResultInfo): None) |
Gets profiles from the name |
ScApiRockstarAccount
| Member |
(Return) Type |
Name |
Description |
| Property |
str |
Name |
Returns the name of the profile |
| Property |
int |
RockstarId |
Returns the rockstar id of the profile |
ScApiResultInfo
| Member |
(Return) Type |
Name |
Description |
| Property |
int |
Total |
The total count of profiles |
| Property |
int |
NextOffset |
The next offset for pagination |
| Property |
str |
Query |
The name of the searched account |
Example
import north.scapi as scapi
def rid_callback(success, account):
if success:
print(f'Found account with rid {account.RockstarId}, their name is {account.Name}')
pass
scapi.get_profile_from_rid(12345, rid_callback)
def name_callback(success, accounts, info):
if success:
print(f'Found {len(accounts)} accounts matching search in current page')
for account in accounts:
print(f'Found: {account.RockstarId} - {account.Name}')
if info.NextOffset > 0:
scapi.get_profiles_from_name(info.Query, info.NextOffset, name_callback)
pass
scapi.get_profiles_from_name('MrBoss', 0, name_callback)
Rage
import north.rage as rage
| Member |
(Return) Type |
Name |
Description |
| Method |
int |
get_entity_handle(address: int) |
Returns the handle of the entity address |
| Method |
int |
get_entity_address(entity: int) |
Returns the address of the entity |
| Method |
None |
invite_player(rid: int) |
Invites the player to your session |
| Method |
None |
invite_players(rids: int[]) |
Invites the players to your session |
| Method |
None |
send_friend_request(rid: int) |
Sends a friend request to the player |
| Method |
bool |
is_basket_transaction_busy() |
Returns if a transaction is busy |
| Method |
bool |
process_basket_transaction(category: int, action: int, destination: int, items: Transaction[]) |
Processes a transaction |
Transaction
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Transaction |
Transaction(id: int, extra_id: int, price: int, stat: int, quantity: int) |
Returns a Transaction |
| Property |
int |
Id |
The id of the transaction |
| Property |
int |
ExtraInventoryId |
The extra inventory id of the transaction |
| Property |
int |
Price |
The price of the transaction |
| Property |
int |
StatValue |
The stat value of the transaction |
| Property |
int |
Quantity |
The quantity of the transaction |
Example
import north.rage as rage
import north.natives as native
import north.menu as menu
def joaat(name): # GET_HASH_KEY
return native.invoke(0xD24D37CC275948CC, name).Int
def transaction_job():
# hangar $6m
trans = [ rage.Transaction(joaat('MP_STAT_HANGAR_CONTRABAND_MISSION_v0'), joaat('HANGAR_CONTRABAND_MISSION_0_t0_v0'), 0, 1, 1) ]
rage.process_basket_transaction(joaat('CATEGORY_INVENTORY_CONTRABAND_MISSION'), joaat('NET_SHOP_ACTION_BUY_CONTRABAND_MISSION'), 4, trans)
while rage.is_basket_transaction_busy():
menu.go_to_main() # yield
trans = [
rage.Transaction(joaat('MP_STAT_HANGAR_CONTRABAND_MISSION_v0'), joaat('HANGAR_CONTRABAND_MISSION_0_t0_v0'), 0, 1, 1),
rage.Transaction(joaat('MP_STAT_HANGAR_CONTRABAND_TOTAL_v0'), -1, 0, 1, 1),
rage.Transaction(joaat('CF_MISSION_PASSED'), joaat('MP_STAT_HANGAR_CONTRABAND_TOTAL_v0'), 200, 0, 1),
rage.Transaction(joaat('MP_STAT_HANGAR_CONTRABAND_MISSION_v0'), joaat('HANGAR_CONTRABAND_MISSION_0_t0_v0'), 0, 1, 1),
rage.Transaction(joaat('MP_STAT_HANGAR_CONTRABAND_TOTAL_v0'), -1, 0, 1, 1),
rage.Transaction(joaat('CF_MISSION_PASSED'), joaat('MP_STAT_HANGAR_CONTRABAND_TOTAL_v0'), 100, 0, 1),
]
rage.process_basket_transaction(joaat('CATEGORY_INVENTORY_CONTRABAND_MISSION'), joaat('NET_SHOP_ACTION_REMOVE_CONTRABAND'), 4, trans)
pass
menu.add_dx_job(transaction_job)
Control
import north.control as control
| Member |
(Return) Type |
Name |
Description |
| Method |
None |
request_control(entity: int, take_ownership: bool, callback(entity: int): None) |
Request control of an entity |
| Method |
None |
request_model(model: int, callback(model: int): None) |
Request a model |
| Method |
None |
request_animation(animation: Tuple[str, str], callback(animation: Tuple[str, str]): None) |
Request an animation |
| Method |
None |
request_particle(asset: Tuple[str, str], callback(asset: Tuple[str, str]): None) |
Request a particle |
| Method |
None |
request_weapon(weapon_hash: int, callback(weapon_hash: int): None) |
Request a weapon |
| Method |
None |
request_clipset(clipset: str, callback(clipset: str): None) |
Request a clipset |
| Method |
None |
request_model_wait(model: int) |
Request a model (thread blocking, only allowed in script threads) |
| Method |
None |
request_control_wait(entity: int, take_ownership: bool) |
Request control of an entity (thread blocking, only allowed in script threads) |
| Method |
None |
request_weapon_wait(weapon_hash: int) |
Request a weapon (thread blocking, only allowed in script threads) |
| Method |
None |
request_dictionary_wait(dictionary: str) |
Request a texture dictionary (thread blocking, only allowed in script threads) |
Example
import north.control as control
def control_handler(entity):
print(f'I now have control of entity {entity}')
pass
control.request_control(123, control_handler)
Notify
import north.notify as notify
| Member |
(Return) Type |
Name |
Description |
| Method |
None |
msg(text: str, color: Color <opt>, time: int <opt>) |
Notifies with icon Info |
| Method |
None |
msg_icon(icon: Icons, text: str, color: Color <opt>, time: int <opt>) |
Notifies with another icon |
| Method |
None |
protection(sender: str, event: str, redirected: bool, blocked: bool) |
Notifies a protection event |
Icons
| Member |
Name |
| Enum |
Info |
| Enum |
Modder |
| Enum |
PlayerJoinSession |
| Enum |
PlayerLeaveSession |
| Enum |
Protections |
| Enum |
Spawner |
| Enum |
Spoofing |
| Enum |
Hotkey |
| Enum |
WeatherChange |
| Enum |
Hazard |
Example
import north.notify as notify
import north.events as events
def player_join_session_event(event):
notify.msg_icon(notify.Icons.PlayerJoinSession, f'{event.PlayerJoinSession.Name} is joining!', Color(255, 0, 255, 255), 10000) # 10s
pass
events.add_listener(events.Types.PlayerJoinSessionEvent, player_join_session_event)
Gui
| Member |
(Return) Type |
Name |
Description |
| Method |
Texture |
load_image(path: str) |
Loads an image |
| Method |
Vec2 |
get_text_center_point(text: str) |
Gets the center point of text with Default font |
| Method |
Vec2 |
get_icon_center_point(icon: str) |
Gets the center point of an icon with Icon font |
| Method |
Vec2 |
get_icon_center_point_small(icon: str) |
Gets the center point of an icon with IconSmall font |
| Method |
Vec2 |
get_icon_center_point_smaller(icon: str) |
Gets the center point of an icon with IconSmaller font |
| Method |
Vec2 |
get_icon_center_point_even_smaller(icon: str) |
Gets the center point of an icon with IconEvenSmaller font |
| Method |
Vec2 |
get_font_size(font: Fonts, text: str, wrap: float <opt>, cache: bool <opt>) |
Gets the font size |
| Method |
Vec2 |
script_values(x: float, y: float) |
Converts script values (0.0 to 1.0) to DirectX |
| Method |
None |
image(img: Texture, pos: Vec2, scale: Vec2, color: Color) |
Draws an image |
| Method |
Tuple[float, float] |
text(text: str, pos: Vec2, font: Fonts, color: Color, justify: Justify <opt>, wrap: float <opt>, box: bool <opt>, box_scale: float <opt>, box_color: Color <opt>) |
Draws text, returns the rendered width and height |
| Method |
None |
image_rounded(img: Texture, xy: Vec2, wh: Vec2, color: Color, rounding: float, flag: Rounding) |
Draws a rounded image |
| Method |
None |
rect_outline_rounded(xy: Vec2, wh: Vec2, box_color: Color, outline_color: Color, thickness: float, flag: Rounding) |
Draws a rounded rect outline |
| Method |
None |
outline(xy: Vec2, wh: Vec2, color: Color, thickness: float, flag: Rounding) |
Draws an outline |
| Method |
None |
rect_rounded(xy: Vec2, wh: Vec2, color: Color, rounding: float, flag: Rounding) |
Draws a rounded rect |
| Method |
None |
outline_rounded(xy: Vec2, wh: Vec2, box_color: Color, outline_color: Color, thickness: float, rounding: Float flag: Rounding) |
Drawes a rounded outline |
| Method |
None |
chevron(xy: Vec2, wh: Vec2, color: Color) |
Draws a chevron (arrow) |
| Method |
None |
circle(xy: Vec2, scale: float, color: Color) |
Draws a circle |
| Method |
None |
rect(xy: Vec2, wh: Vec2, color: Color, thickness: float) |
Draws a rect |
| Method |
None |
rect_filled(xy: Vec2, wh: Vec2, color: Color) |
Draws a filled rect |
| Method |
None |
rect_outline(xy: Vec2, wh: Vec2, box_color: Color, outline_color: Color, thickness: float) |
Draws a rect with an outline |
| Method |
None |
line(xy: Vec2, wh: Vec2, color: Color, thickness: float) |
Draws a line |
Rounding
| Member |
Name |
| Enum |
None |
| Enum |
TopLeft |
| Enum |
TopRight |
| Enum |
BottomLeft |
| Enum |
BottomRight |
| Enum |
All |
| Enum |
Top |
| Enum |
Bottom |
| Enum |
Left |
| Enum |
Right |
Fonts
| Member |
Name |
| Enum |
Default |
| Enum |
DefaultSmall |
| Enum |
DefaultSmaller |
| Enum |
DefaultLarge |
| Enum |
Icon |
| Enum |
IconSmall |
| Enum |
IconSmaller |
| Enum |
IconEvenSmaller |
Justify
| Member |
Name |
| Enum |
Left |
| Enum |
Right |
| Enum |
Center |
Example
import north.menu as menu
import north.gui as gui
loaded_textures = False
test_image = gui.Texture()
def dx_thread():
if not loaded_textures:
loaded_textures = True
test_image = gui.load_image(f'{__location__}/images/test.png')
pass
gui.rect_filled(Vec2(100.0, 100.0), Vec2(300.0, 300.0), Color(255, 0, 0, 255))
if test_image:
gui.image(test_image, Vec2(100.0, 100.0), Vec2(300.0, 100.0), Color(255, 255, 255, 255))
gui.text('Cool Text', Vec2(200.0, 200.0), gui.Fonts.DefaultLarge, Color(255, 255, 255, 255))
return True
menu.add_dx_thread(dx_thread)
Script
import north.script as script
| Member |
(Return) Type |
Name |
Description |
| Method |
GtaThread |
get_script(name: str) |
Gets a script thread |
| Method |
GtaThread[] |
get_all_scripts() |
Gets all script threads |
| Method |
None |
script_event(player: int, params: int[]) |
Triggers a script event for a player |
| Method |
None |
script_event_lobby(params: int[]) |
Triggers a script event for all players |
ScrThreadContext
| Member |
(Return) Type |
Name |
| Property |
int |
ThreadId |
| Property |
int |
Hash |
| Property |
int |
State |
| Property |
int |
InstructionPointer |
| Property |
int |
FramePointer |
| Property |
int |
StackPointer |
| Property |
int |
TimerA |
| Property |
int |
TimerB |
| Property |
int |
TimerWait |
| Property |
int |
StackSize |
| Property |
int |
Priority |
ScrThread
| Member |
(Return) Type |
Name |
| Property |
ScrThreadContext |
ScrThreadContext |
| Property |
int |
Stack |
| Property |
int |
ArgSize |
| Property |
int |
ArgLoc |
| Property |
str |
ExitMessage |
| Property |
str |
Name |
GtaThread
| Member |
(Return) Type |
Name |
| Property |
ScriptThread |
ScriptThread |
| Property |
int |
Hash |
| Property |
int |
InstanceId |
| Property |
bool |
IsMissionScript |
| Property |
bool |
IsSafeForNetworkGame |
| Property |
bool |
HasThreadBeenPaused |
| Property |
bool |
CanScriptBePaused |
| Property |
bool |
IsHighPriority |
Globals
| Member |
(Return) Type |
Name |
| Constructor |
Globals |
Globals(global: int) |
| Method |
Globals |
at(offset: int) |
| Method |
Globals |
at(offset: int, size: int) |
| Property |
int |
Int |
| Property |
float |
Float |
| Property |
bool |
Bool |
Locals
| Member |
(Return) Type |
Name |
| Constructor |
Locals |
Locals(script_name: str, global: int) |
| Method |
Locals |
at(offset: int) |
| Method |
Locals |
at(offset: int, size: int) |
| Property |
int |
Int |
| Property |
float |
Float |
| Property |
bool |
Bool |
Example
import north.script as script
import north.players as players
# bullshark testosterone
script.Globals(2672505).at(3690).Bool = True
# re-init tunables
script.Locals('social_controller', 66).Int = 1
script.Locals('social_controller', 67).Int = 0
# get the state of freemode script
freemode = script.get_script('freemode')
print(f'Freemodes state is {freemode.ScriptThread.ScrThreadContext.State}')
# get player ranks
def print_player_ranks(player):
rank = script.Globals(1853910).at(player.Id, 862).at(205).at(6).Int
print(f'{player.Name} has as rank of {rank}')
pass
players.Player.for_each(print_player_ranks)
import north.menu as menu
| Member |
(Return) Type |
Name |
Description |
| Method |
None |
add_script_thread(callback: bool) |
Adds a script thread, will continue executing while it returns true |
| Method |
None |
add_dx_thread(callback: bool) |
Adds a DirectX thread, will continue executing while it returns true |
| Method |
None |
add_script_job(callback: None) |
Adds a script thread that stops executing when it returns |
| Method |
None |
add_dx_job(callback: None) |
Adds a DirectX thread that stops executing when it returns |
| Method |
None |
sleep(ms: int) |
Sleeps (yields) the current thread |
| Method |
None |
go_to_main() |
Yields the current thread |
| Method |
Group |
add_group(submenu_name: str, group_name: str, column: int) |
Adds a group to the Scripts tab in North |
| Method |
Group |
add_player_group(submenu_name: str, group_name: str, column: int) |
Adds a group to the Players tab in North |
FeatureType
| Member |
Name |
| Enum |
ScrollType |
| Enum |
PressType |
| Enum |
ToggleType |
Int
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Int |
Int(value: int) |
Creates a value to be used with option functions |
| Property |
int |
Value |
Gets or sets the value |
Float
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Float |
Float(value: float) |
Creates a value to be used with option functions |
| Property |
float |
Value |
Gets or sets the value |
Bool
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Bool |
Bool(value: bool) |
Creates a value to be used with option functions |
| Property |
bool |
Value |
Gets or sets the value |
Str
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Str |
Str(value: str) |
Creates a value to be used with option functions |
| Property |
str |
Value |
Gets or sets the value |
Group
| Member |
(Return) Type |
Name |
Description |
| Method |
Button |
add_button(name: str) |
Adds a button |
| Method |
Node |
add_node(name: str) |
Adds a node |
| Method |
Toggle |
add_toggle(name: str) |
Adds a toggle |
| Method |
Breaker |
add_breaker(name: str) |
Adds a breaker |
| Method |
Label |
add_label(name: str) |
Adds a label |
| Method |
NumberInt |
add_number_int(name: str, type: FeatureType) |
Adds a number int |
| Method |
NumberFloat |
add_number_float(name: str, type: FeatureType) |
Adds a number float |
| Method |
ComboInt |
add_combo_int(name: str, type: FeatureType) |
Adds a combo int |
| Method |
ComboFloat |
add_combo_float(name: str, type: FeatureType) |
Adds a combo float |
| Method |
ComboStr |
add_combo_str(name: str, type: FeatureType) |
Adds a combo str |
| Property |
Function |
SectionOpen |
Callback that'll be called when the section is opened, ran in a script thread |
| Property |
Function |
SectionOpenDx |
Callback that'll be called when the section is opened, ran in a DirectX thread |
| Property |
str |
SubmenuName |
The submenu name |
| Property |
str |
GroupName |
The group name |
| Property |
int |
Column |
The column |
| Property |
bool |
DisableScroll |
If the group should stay in a set position when scrolling the groups |
ComboListMultiState
| Member |
(Return) Type |
Name |
Description |
| Method |
bool |
is_active() |
Returns if any option is toggled |
| Method |
bool |
is_set(index: int) |
Returns if the list index is toggled |
ComboListStr
| Member |
(Return) Type |
Name |
Description |
| Constructor |
ComboListStr |
ComboListStr(name: str, value: str) |
Constructs the data |
| Constructor |
ComboListStr |
ComboListStr(name: Localization, value: str) |
Constructs the data |
| Property |
Localization |
Name |
The localized name |
| Property |
str |
Value |
The value |
ComboListFloat
| Member |
(Return) Type |
Name |
Description |
| Constructor |
ComboListFloat |
ComboListFloat(name: str, value: float) |
Constructs the data |
| Constructor |
ComboListFloat |
ComboListFloat(name: Localization, value: float) |
Constructs the data |
| Property |
Localization |
Name |
The localized name |
| Property |
float |
Value |
The value |
ComboListInt
| Member |
(Return) Type |
Name |
Description |
| Constructor |
ComboListInt |
ComboListInt(name: str, value: int) |
Constructs the data |
| Constructor |
ComboListInt |
ComboListInt(name: Localization, value: int) |
Constructs the data |
| Property |
Localization |
Name |
The localized name |
| Property |
int |
Value |
The value |
ComboStr
| Member |
(Return) Type |
Name |
Description |
| Constructor |
ComboStr |
ComboStr(name: str, type: FeatureType) |
Constructs the option |
| Method |
ComboStr |
click(callback(option: ComboStr): None) |
Sets a script thread callback for when the option is pressed |
| Method |
ComboStr |
click_dx(callback(option: ComboStr): None) |
Sets a DirectX thread callback for when the option is pressed |
| Method |
ComboStr |
hover(callback(option: ComboStr): None) |
Sets a DirectX thread callback for when the option is hovered |
| Method |
ComboStr |
enter(callback(option: ComboStr): None) |
Sets a script thread callback for when the option is entered |
| Method |
ComboStr |
leave(callback(option: ComboStr): None) |
Sets a script thread callback for when the option is left |
| Method |
ComboStr |
enter_dx(callback(option: ComboStr): None) |
Sets a DirectX thread callback for when the option is entered |
| Method |
ComboStr |
leave_dx(callback(option: ComboStr): None) |
Sets a DirectX thread callback for when the option is left |
| Method |
ComboStr |
update(callback(option: ComboStr): None) |
Sets a DirectX thread callback for when the option is being rendered |
| Method |
ComboStr |
tooltip(text: str) |
Sets the tooltip |
| Method |
ComboStr |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
ComboStr |
disable_requirement(callback: bool) |
Sets the requirement for the option to be usable |
| Method |
ComboStr |
scroll_at(offset: int) |
Sets the amount of options it'll render before scrolling |
| Method |
ComboStr |
add(var: Int, list: ComboListStr[]) |
Sets up the option data |
| Method |
ComboStr |
add_multi(list: ComboListStr[], state: ComboListMultiState) |
Sets up the option data for a multi toggle combo |
| Method |
ComboStr |
add_toggle(var: Bool) |
Sets the toggle if the type is Toggle |
| Method |
ComboStr |
ingame() |
Sets the option to only be usable when in game |
| Method |
bool |
state() |
Returns the state of the toggle if the type is Toggle |
| Method |
int |
value() |
Returns the index of the option selected |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
ComboFloat
| Member |
(Return) Type |
Name |
Description |
| Constructor |
ComboFloat |
ComboFloat(name: str, type: FeatureType) |
Constructs the option |
| Method |
ComboFloat |
click(callback(option: ComboFloat): None) |
Sets a script thread callback for when the option is pressed |
| Method |
ComboFloat |
click_dx(callback(option: ComboFloat): None) |
Sets a DirectX thread callback for when the option is pressed |
| Method |
ComboFloat |
hover(callback(option: ComboFloat): None) |
Sets a DirectX thread callback for when the option is hovered |
| Method |
ComboFloat |
enter(callback(option: ComboFloat): None) |
Sets a script thread callback for when the option is entered |
| Method |
ComboFloat |
leave(callback(option: ComboFloat): None) |
Sets a script thread callback for when the option is left |
| Method |
ComboFloat |
enter_dx(callback(option: ComboFloat): None) |
Sets a DirectX thread callback for when the option is entered |
| Method |
ComboFloat |
leave_dx(callback(option: ComboFloat): None) |
Sets a DirectX thread callback for when the option is left |
| Method |
ComboFloat |
update(callback(option: ComboFloat): None) |
Sets a DirectX thread callback for when the option is being rendered |
| Method |
ComboFloat |
tooltip(text: str) |
Sets the tooltip |
| Method |
ComboFloat |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
ComboFloat |
disable_requirement(callback: bool) |
Sets the requirement for the option to be usable |
| Method |
ComboFloat |
scroll_at(offset: int) |
Sets the amount of options it'll render before scrolling |
| Method |
ComboFloat |
add(var: Int, list: ComboListFloat[]) |
Sets up the option data |
| Method |
ComboFloat |
add_multi(list: ComboListFloat[], state: ComboListMultiState) |
Sets up the option data for a multi toggle combo |
| Method |
ComboFloat |
add_toggle(var: Bool) |
Sets the toggle if the type is Toggle |
| Method |
ComboFloat |
ingame() |
Sets the option to only be usable when in game |
| Method |
bool |
state() |
Returns the state of the toggle if the type is Toggle |
| Method |
int |
value() |
Returns the index of the option selected |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
ComboInt
| Member |
(Return) Type |
Name |
Description |
| Constructor |
ComboInt |
ComboInt(name: str, type: FeatureType) |
Constructs the option |
| Method |
ComboInt |
click(callback(option: ComboInt): None) |
Sets a script thread callback for when the option is pressed |
| Method |
ComboInt |
click_dx(callback(option: ComboInt): None) |
Sets a DirectX thread callback for when the option is pressed |
| Method |
ComboInt |
hover(callback(option: ComboInt): None) |
Sets a DirectX thread callback for when the option is hovered |
| Method |
ComboInt |
enter(callback(option: ComboInt): None) |
Sets a script thread callback for when the option is entered |
| Method |
ComboInt |
leave(callback(option: ComboInt): None) |
Sets a script thread callback for when the option is left |
| Method |
ComboInt |
enter_dx(callback(option: ComboInt): None) |
Sets a DirectX thread callback for when the option is entered |
| Method |
ComboInt |
leave_dx(callback(option: ComboInt): None) |
Sets a DirectX thread callback for when the option is left |
| Method |
ComboInt |
update(callback(option: ComboInt): None) |
Sets a DirectX thread callback for when the option is being rendered |
| Method |
ComboInt |
tooltip(text: str) |
Sets the tooltip |
| Method |
ComboInt |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
ComboInt |
disable_requirement(callback: bool) |
Sets the requirement for the option to be usable |
| Method |
ComboInt |
scroll_at(offset: int) |
Sets the amount of options it'll render before scrolling |
| Method |
ComboInt |
add(var: Int, list: ComboListInt[]) |
Sets up the option data |
| Method |
ComboInt |
add_multi(list: ComboListInt[], state: ComboListMultiState) |
Sets up the option data for a multi toggle combo |
| Method |
ComboInt |
add_toggle(var: Bool) |
Sets the toggle if the type is Toggle |
| Method |
ComboInt |
ingame() |
Sets the option to only be usable when in game |
| Method |
bool |
state() |
Returns the state of the toggle if the type is Toggle |
| Method |
int |
value() |
Returns the index of the option selected |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
NumberInt
| Member |
(Return) Type |
Name |
Description |
| Constructor |
NumberInt |
NumberInt(name: str, type: FeatureType) |
Constructs the option |
| Method |
NumberInt |
click(callback(option: NumberInt): None) |
Sets a script thread callback for when the option is pressed |
| Method |
NumberInt |
click_dx(callback(option: NumberInt): None) |
Sets a DirectX thread callback for when the option is pressed |
| Method |
NumberInt |
hover(callback(option: NumberInt): None) |
Sets a DirectX thread callback for when the option is hovered |
| Method |
NumberInt |
update(callback(option: NumberInt): None) |
Sets a DirectX thread callback for when the option is being rendered |
| Method |
NumberInt |
tooltip(text: str) |
Sets the tooltip |
| Method |
NumberInt |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
NumberInt |
disable_requirement(callback: bool) |
Sets the requirement for the option to be usable |
| Method |
NumberInt |
add_toggle(var: Bool) |
Sets the toggle if the type is Toggle |
| Method |
NumberInt |
min(value: int) |
Sets the min the value can go to |
| Method |
NumberInt |
max(value: int) |
Sets the max the value can go to |
| Method |
NumberInt |
input() |
Sets that the option can have a manual input (right click) |
| Method |
NumberInt |
ingame() |
Sets the option to only be usable when in game |
| Method |
NumberInt |
add(var: Int, format: str) |
Sets up the option data |
| Method |
bool |
state() |
Returns the state of the toggle if the type is Toggle |
| Method |
int |
value() |
Returns the value |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
NumberFloat
| Member |
(Return) Type |
Name |
Description |
| Constructor |
NumberFloat |
NumberFloat(name: str, type: FeatureType) |
Constructs the option |
| Method |
NumberFloat |
click(callback(option: NumberFloat): None) |
Sets a script thread callback for when the option is pressed |
| Method |
NumberFloat |
click_dx(callback(option: NumberFloat): None) |
Sets a DirectX thread callback for when the option is pressed |
| Method |
NumberFloat |
hover(callback(option: NumberFloat): None) |
Sets a DirectX thread callback for when the option is hovered |
| Method |
NumberFloat |
update(callback(option: NumberFloat): None) |
Sets a DirectX thread callback for when the option is being rendered |
| Method |
NumberFloat |
tooltip(text: str) |
Sets the tooltip |
| Method |
NumberFloat |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
NumberFloat |
disable_requirement(callback: bool) |
Sets the requirement for the option to be usable |
| Method |
NumberFloat |
add_toggle(var: Bool) |
Sets the toggle if the type is Toggle |
| Method |
NumberFloat |
min(value: float) |
Sets the min the value can go to |
| Method |
NumberFloat |
max(value: float) |
Sets the max the value can go to |
| Method |
NumberFloat |
input() |
Sets that the option can have a manual input (right click) |
| Method |
NumberFloat |
ingame() |
Sets the option to only be usable when in game |
| Method |
NumberFloat |
add(var: Float, format: str) |
Sets up the option data |
| Method |
bool |
state() |
Returns the state of the toggle if the type is Toggle |
| Method |
float |
value() |
Returns the value |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
Label
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Label |
Label(name: str) |
Constructs the option |
| Method |
Label |
tooltip(text: str) |
Sets the tooltip |
| Method |
Label |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
Label |
update(callback(option: Label): None) |
Sets a DirectX thread callback for when the option is being rendered |
| Method |
Label |
add_value(text: str) |
Sets the value |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
| Property |
str |
Value |
The value |
Breaker
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Breaker |
Breaker(name: str) |
Constructs the option |
| Method |
Breaker |
tooltip(text: str) |
Sets the tooltip |
| Method |
Breaker |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
Breaker |
update(callback(option: Breaker): None) |
Sets a DirectX thread callback for when the option is being rendered |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
Toggle
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Toggle |
Toggle(name: str) |
Constructs the option |
| Method |
Toggle |
click(callback(option: Toggle): None) |
Sets a script thread callback for when the option is pressed |
| Method |
Toggle |
click_dx(callback(option: Toggle): None) |
Sets a DirectX thread callback for when the option is pressed |
| Method |
Toggle |
hover(callback(option: Toggle): None) |
Sets a DirectX thread callback for when the option is hovered |
| Method |
Toggle |
update(callback(option: Toggle): None) |
Sets a DirectX thread callback for when the option is being rendered |
| Method |
Toggle |
tooltip(text: str) |
Sets the tooltip |
| Method |
Toggle |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
Toggle |
disable_requirement(callback: bool) |
Sets the requirement for the option to be usable |
| Method |
Toggle |
ingame() |
Sets the option to only be usable when in game |
| Method |
Toggle |
add(var: Bool) |
Sets the toggle |
| Method |
Toggle |
same_line() |
Puts the toggle on the same line as a previous toggle |
| Method |
bool |
state() |
Returns the state of the toggle |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Button |
Button(name: str) |
Constructs the option |
| Method |
Button |
click(callback(option: Button): None) |
Sets a script thread callback for when the option is pressed |
| Method |
Button |
click_dx(callback(option: Button): None) |
Sets a DirectX thread callback for when the option is pressed |
| Method |
Button |
hover(callback(option: Button): None) |
Sets a DirectX thread callback for when the option is hovered |
| Method |
Button |
enter(callback(option: Button): None) |
Sets a script thread callback for when the option is entered |
| Method |
Button |
leave(callback(option: Button): None) |
Sets a script thread callback for when the option is left |
| Method |
Button |
enter_dx(callback(option: Button): None) |
Sets a DirectX thread callback for when the option is entered |
| Method |
Button |
leave_dx(callback(option: Button): None) |
Sets a DirectX thread callback for when the option is left |
| Method |
Button |
update(callback(option: Button): None) |
Sets a DirectX thread callback for when the option is being rendered |
| Method |
Button |
tooltip(text: str) |
Sets the tooltip |
| Method |
Button |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
Button |
disable_requirement(callback: bool) |
Sets the requirement for the option to be usable |
| Method |
Button |
ingame() |
Sets the option to only be usable when in game |
| Method |
Button |
same_line() |
Puts the button on the same line as a previous button |
| Method |
Button |
full() |
Sets the button to take up the full length of the group |
| Method |
Button |
half_padding() |
Sets the button to have half the padding on the Y |
| Method |
Button |
no_padding() |
Sets the button to have no padding on the Y |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
Node
| Member |
(Return) Type |
Name |
Description |
| Constructor |
Node |
Node(name: str) |
Constructs the option |
| Method |
Node |
click(callback(option: Node): None) |
Sets a script thread callback for when the option is pressed |
| Method |
Node |
click_dx(callback(option: Node): None) |
Sets a DirectX thread callback for when the option is pressed |
| Method |
Node |
hover(callback(option: Node): None) |
Sets a DirectX thread callback for when the option is hovered |
| Method |
Node |
enter(callback(option: Node): None) |
Sets a script thread callback for when the option is entered |
| Method |
Node |
tooltip(text: str) |
Sets the tooltip |
| Method |
Node |
requirement(callback: bool) |
Sets the requirement for the option to be rendered |
| Method |
Node |
disable_requirement(callback: bool) |
Sets the requirement for the option to be usable |
| Method |
Node |
ingame() |
Sets the option to only be usable when in game |
| Method |
Button |
add_button(name: str) |
Adds a button |
| Method |
Node |
add_node(name: str) |
Adds a node |
| Method |
Toggle |
add_toggle(name: str) |
Adds a toggle |
| Method |
Breaker |
add_breaker(name: str) |
Adds a breaker |
| Method |
Label |
add_label(name: str) |
Adds a label |
| Method |
NumberInt |
add_number_int(name: str, type: FeatureType) |
Adds a number int |
| Method |
NumberFloat |
add_number_float(name: str, type: FeatureType) |
Adds a number float |
| Method |
ComboInt |
add_combo_int(name: str, type: FeatureType) |
Adds a combo int |
| Method |
ComboFloat |
add_combo_float(name: str, type: FeatureType) |
Adds a combo float |
| Method |
ComboStr |
add_combo_str(name: str, type: FeatureType) |
Adds a combo str |
| Property |
Localization |
Name |
The localized name |
| Property |
Localization |
Tooltip |
The tooltip |
| Property |
bool |
IsOpen |
If the node is open |
Example
import north.menu as menu
import north.notify as notify
import north.players as players
class Vars:
godmode = menu.Bool(False)
number = menu.Float(0.1)
name_combo = menu.Int(0)
name_combo_list = [
menu.ComboListInt('bitch', 1),
menu.ComboListInt('bitch tits', 23),
]
class Callbacks:
@staticmethod
def notify_click(button):
notify.msg(f'Notifying from button: {button.Name.get()}')
pass
@staticmethod
def player_notify_click(button):
string = ''
if players.Player.session():
string = 'Session'
else:
string = players.Player.selected().Name
notify.msg(f'Selected network player: {string}')
pass
@staticmethod
def godmode_click(toggle):
print(f'Godmode toggled inside a script thread: {toggle.state()}')
pass
@staticmethod
def number_bro_click(number):
print(f'Number: {number.value()}')
pass
@staticmethod
def tits_click(combo):
print(f'Selected: {Vars.name_combo_list[Vars.name_combo.Value].Name.get()}')
pass
group = menu.add_group('Scripts', 'Loot Script', 0)
group.add_toggle('Godmode') \
.add(Vars.godmode) \
.click(Callbacks.godmode_click)
group.add_breaker('Cool Buttons')
group.add_button('Notify').click_dx(Callbacks.notify_click)
group.add_number_float('Number Bro', menu.FeatureType.ScrollType) \
.add(Vars.number, '%.2f').min(0.0).max(123.23) \
.click_dx(Callbacks.number_bro_click)
group.add_combo_int('Tits?', menu.FeatureType.ScrollType) \
.add(Vars.name_combo, Vars.name_combo_list) \
.click_dx(Callbacks.tits_click)
player_group = menu.add_player_group('Scripts', 'Loot Script', 0)
player_group.add_button('Notify') \
.click_dx(Callbacks.player_notify_click)