import { int, float } from '../types/NativeAliases'; export declare class Scripts { /** * @returns value */ static countPlayerBits(): [int, number]; /** * @returns playerBits */ static isAnyPlayerBitSet(): [boolean, number]; /** * goalContext: see in common/data/stats_and_challenges/goals_*.meta * * @param goalContext */ static activateGoalContext(goalContext: string | number): void; /** * @param scriptName * @param stackSize * @returns */ static startNewScript(scriptName: string, stackSize: int): int; /** * @param awardHash * @param itemIndex * @returns rpcGuid; outResultItem */ static awardsGetResultItem(awardHash: string | number, itemIndex: int): [any, number, number]; /** * Returns true if GtaThread+0x77C is equal to 1. Old name: _BG_EXITED_BECAUSE_BACKGROUND_THREAD_STOPPED * * @returns */ static bgIsExitflagSet(): boolean; /** * Starts a new iteration of the current threads. * Call this first, then SCRIPT_THREAD_ITERATOR_GET_NEXT_THREAD_ID (0x30B4FA1C82DD4B9F) */ static scriptThreadIteratorReset(): void; /** * @param threadId * @returns */ static isBackgroundScript(threadId: int): boolean; /** * @param dataIndex * @returns rpcGuid; outLootData */ static lootGetLootClaimData(dataIndex: int): [boolean, number, number]; /** * @param scriptHash * @returns */ static doesScriptWithNameHashExist(scriptHash: string | number): boolean; /** * @param p0 * @param p1 * @param p2 * @param gamemodeName * @param title * @param subtitle */ static displayLoadingScreens(p0: string | number, p1: string | number, p2: string | number, gamemodeName: string, title: string, subtitle: string): void; /** * @param bitIndex * @returns value */ static clearPlayerBitAtIndex(bitIndex: int): number; /** * @param p0 */ static N_0x6F700A4BF7C3331B(p0: boolean): void; /** * Inserts the given context into the background scripts context map. * * @param contextName */ static bgStartContext(contextName: string): void; /** * return : script thread id, 0 if failed * Pass pointer to struct of args in p1, size of struct goes into p2 * * @param scriptName * @param argCount * @param stackSize * @returns args */ static startNewScriptWithArgs(scriptName: string, argCount: int, stackSize: int): [int, number]; /** * @param threadId * @returns */ static doesThreadExist(threadId: int): boolean; /** * eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_ERRORS (CEventGroupScriptErrors) * * @param eventGroup * @returns */ static getNumberOfEvents(eventGroup: int): int; static shutdownLoadingScreen(): void; /** * @param p0 * @returns */ static N_0xE7282390542F570D(p0: any): any; /** * @param scriptIndex * @param p1 * @returns */ static bgGetLaunchParamValue(scriptIndex: int, p1: string): int; /** * @param p0 * @param p1 */ static N_0x1BDB5A07307F6929(p0: any, p1: any): void; /** * @param index * @returns */ static doesCompressedGlobalBlockBufferExist(index: int): boolean; /** * @param index * @param toggle */ static setGlobalBlockCanBeAccessed(index: int, toggle: boolean): void; /** * @param p0 * @returns */ static bgGetScriptIdFromNameHash(p0: string | number): int; /** * @returns */ static getNoLoadingScreen(): boolean; /** * @param p0 * @param p1 * @returns */ static N_0x0A79C81C418F5D38(p0: any, p1: any): any; /** * @param p0 * @returns */ static N_0xA88E1D7FA1E20080(p0: any): any; /** * @param params */ static bailWithPassThroughParams(params: string): void; /** * If the function returns 0, the end of the iteration has been reached. * * @returns */ static scriptThreadIteratorGetNextThreadId(): int; /** * @param scriptHash */ static setScriptWithNameHashAsNoLongerNeeded(scriptHash: string | number): void; /** * @param p1 * @returns value */ static getBlockOfPlayerBits(p1: int): [int, number]; /** * Deletes the given context from the background scripts context map. * * @param contextName */ static bgEndContext(contextName: string): void; /** * @param scriptHash * @returns */ static hasScriptWithNameHashLoaded(scriptHash: string | number): boolean; /** * @param p0 */ static N_0x5827BE85A87B073D(p0: any): void; /** * enum eThreadExitReason * { * THREAD_EXIT_REASON_NONE, * THREAD_EXIT_REASON_BACKGROUND_THREAD_STOPPED, * THREAD_EXIT_REASON_SESSION_MERGE, * THREAD_EXIT_REASON_SCENARIO_OUT_OF_SCOPE, * THREAD_EXIT_REASON_REQUESTED_BY_SCRIPT * }; * * @returns */ static getThreadExitReason(): int; /** * @param bitIndex * @returns value */ static setPlayerBitAtIndex(bitIndex: int): number; /** * @returns value */ static clearAllPlayerBits(): number; /** * @param itemIndex * @returns rpcGuid; outResultItem */ static lootGetResultItem(itemIndex: int): [any, number, number]; /** * Returns if a script has been loaded into the game. Used to see if a script was loaded after requesting. * * @param scriptName * @returns */ static hasScriptLoaded(scriptName: string): boolean; /** * @param toggle */ static setNoLoadingScreen(toggle: boolean): void; /** * @param scriptIndex * @param p1 * @returns */ static bgDoesLaunchParamExist(scriptIndex: int, p1: string): boolean; /** * @param threadId */ static requestThreadExit(threadId: int): void; /** * Hashed version of BG_END_CONTEXT * * @param contextHash */ static bgEndContextHash(contextHash: string | number): void; /** * @param scriptName * @returns */ static doesScriptExist(scriptName: string): boolean; /** * @returns */ static getHashOfThisScriptName(): number; static bgReloadAllBackgroundScripts(): void; /** * eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors) Note: eventDataSize is NOT the size in bytes, it is the size determined by the SIZE_OF operator (RAGE Script operator, not C/C++ sizeof). That is, the size in bytes divided by 8 (script variables are always 8-byte aligned!). playerBits (also known as playersToBroadcastTo) is a bitset that indicates which players this event should be sent to. In order to send the event to specific players only, use (1 << playerIndex). Set all bits if it should be broadcast to all players. * * @param eventGroup * @param eventDataSize * @param scriptMetadataIndex * @returns eventData; playerBits */ static triggerScriptEvent(eventGroup: int, eventDataSize: int, scriptMetadataIndex: int): [number, number]; /** * goalContext: see _ACTIVATE_GOAL_CONTEXT * * @param goalContext * @returns */ static isGoalContextActive(goalContext: string | number): boolean; /** * @param scriptName */ static setScriptAsNoLongerNeeded(scriptName: string): void; /** * @returns p0; p1; p2 */ static N_0x64F765D9A1F8F02C(): [number, number, number]; /** * @param scriptName */ static requestScript(scriptName: string): void; /** * @param toggle */ static setAllGlobalBlocksHaveBeenLoaded(toggle: boolean): void; /** * Returns "INVALID_NET_RPC_GUID" if netRpcGuid is invalid. * * @returns netRpcGuid */ static netRpcGuidToString(): [string, number]; /** * eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors) Returns event name hash: https://alloc8or.re/rdr3/doc/enums/eEventType.txt * * @param eventGroup * @param eventIndex * @returns */ static getEventAtIndex(eventGroup: int, eventIndex: int): number; /** * @param scriptHash * @param argCount * @param stackSize * @returns args */ static startNewScriptWithNameHashAndArgs(scriptHash: string | number, argCount: int, stackSize: int): [int, number]; /** * eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors) * * @param eventGroup * @param eventType * @returns */ static getEventExists(eventGroup: int, eventType: string | number): boolean; /** * @param index * @returns */ static getGlobalBlockCanBeAccessed(index: int): boolean; /** * @returns */ static isThreadExitRequested(): boolean; static terminateThisThread(): void; static N_0x76CBCD9EADC00955(): void; /** * @param p0 * @param p1 * @param p2 * @param p3 * @param p4 * @param p5 * @param p6 * @param p7 */ static N_0x29FB4CE89472C3CB(p0: any, p1: any, p2: float, p3: float, p4: string, p5: string, p6: string, p7: int): void; /** * @param threadId */ static terminateThread(threadId: int): void; /** * @param eventDataSize * @param scriptMetadataIndex * @param threadId * @returns eventData */ static triggerScriptEvent2(eventDataSize: int, scriptMetadataIndex: int, threadId: int): number; /** * Gets the number of instances of the specified script is currently running. Actually returns numRefs - 1. * if (program) * v3 = rage::scrProgram::GetNumRefs(program) - 1; * return v3; Old name: _GET_NUMBER_OF_REFERENCES_OF_SCRIPT_WITH_NAME_HASH * * @param scriptHash * @returns */ static getNumberOfThreadsRunningTheScriptWithThisHash(scriptHash: string | number): int; /** * Waiting for child scripts to terminate / waiting for collapse of child scripts * * @param p0 * @returns */ static haveAllChildScriptsTerminated(p0: int): any; /** * @param p0 * @param p1 * @param p2 */ static N_0xFFDDF802279BE128(p0: any, p1: any, p2: any): void; /** * @param bitIndex * @returns value */ static isPlayerBitSetAtIndex(bitIndex: int): [boolean, number]; /** * @returns value */ static setAllPlayerBits(): number; /** * Sets bit 0 in GtaThread+0x784 */ static bgSetExitflagResponse(): void; /** * @returns value */ static countParticipantBits(): [int, number]; /** * Same as GET_IS_LOADING_SCREEN_ACTIVE * * @returns */ static isLoadingScreenVisible(): boolean; /** * @param p0 * @param p1 * @param p2 */ static N_0xE4ABE20DCE7C7CFE(p0: any, p1: any, p2: any): void; /** * @param p1 * @param p2 * @returns value */ static setBlockOfPlayerBits(p1: int, p2: int): number; /** * Hashed version of BG_START_CONTEXT * * @param contextHash */ static bgStartContextHash(contextHash: string | number): void; /** * @param threadId * @returns */ static isThreadExitRequestedForThreadWithThisId(threadId: int): boolean; /** * @param index * @returns */ static restoreGlobalBlock(index: int): any; /** * @param eventGroup * @param eventIndex * @param p2 */ static setEventFlagForDeletion(eventGroup: int, eventIndex: int, p2: boolean): void; /** * @param threadId * @returns threadExists; hasScriptHandler */ static getThreadExistenceDetails(threadId: int): [boolean, boolean]; /** * @param p0 * @param p1 * @param p2 */ static N_0x42A429CDFED6D99D(p0: any, p1: any, p2: any): void; /** * @param p0 */ static stopDisplayingMpTransitionLoadingScreens(p0: any): void; /** * @param threadId * @param ignoreKilledState * @returns */ static isThreadActive(threadId: int, ignoreKilledState: boolean): boolean; /** * eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors) Note: eventDataSize is NOT the size in bytes, it is the size determined by the SIZE_OF operator (RAGE Script operator, not C/C++ sizeof). That is, the size in bytes divided by 8 (script variables are always 8-byte aligned!). https://github.com/femga/rdr3_discoveries/tree/master/AI/EVENTS * * @param eventGroup * @param eventIndex * @param eventDataSize * @returns eventData */ static getEventData(eventGroup: int, eventIndex: int, eventDataSize: int): [boolean, number]; /** * @param awardHash * @param dataIndex * @returns rpcGuid; outUnlockData */ static awardsGetUnlockClaimData(awardHash: string | number, dataIndex: int): [any, number, number]; /** * @param scriptHash */ static requestScriptWithNameHash(scriptHash: string | number): void; /** * Used in Script Function DISABLE_REGISTERED_WORLD_BRAINS * * @param p0 */ static N_0x11B0A0B282FA9B10(p0: boolean): void; /** * @param scriptHash * @param stackSize * @returns */ static startNewScriptWithNameHash(scriptHash: string | number, stackSize: int): int; /** * @param threadId * @returns */ static getHashOfThread(threadId: int): number; /** * @param nameHash */ static requestThreadExitForAllThreadsWithThisName(nameHash: string | number): void; /** * @param p0 * @param p1 */ static N_0x1C5EB3C27F7508CB(p0: any, p1: any): void; /** * goalContext: see _ACTIVATE_GOAL_CONTEXT * * @param goalContext */ static deactivateGoalContext(goalContext: string | number): void; /** * @param bailCode */ static bailToLandingPage(bailCode: int): void; /** * @param index * @returns */ static storeGlobalBlock(index: int): any; static N_0xF9E951A1E5517C06(): void; /** * @returns */ static getIdOfThisThread(): int; } //# sourceMappingURL=Scripts.d.ts.map