Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ interface BotWorldState {
skills: SkillState[];
inventory: InventoryItem[];
equipment: InventoryItem[];
varps?: number[]; // Raw varps (player variables) indexed by varp ID
nearbyNpcs: NearbyNpc[];
nearbyPlayers: NearbyPlayer[];
nearbyLocs: NearbyLoc[];
Expand Down
4 changes: 4 additions & 0 deletions sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type {
BotStatus
} from './types';
import * as pathfinding from './pathfinding';
import { QuestSDK } from './quests';

interface SyncToSDKMessage {
type: 'sdk_connected' | 'sdk_state' | 'sdk_action_result' | 'sdk_error' | 'sdk_screenshot_response';
Expand Down Expand Up @@ -46,6 +47,7 @@ interface PendingScreenshot {

export class BotSDK {
readonly config: Required<SDKConfig>;
readonly quest: QuestSDK;
private ws: WebSocket | null = null;
private state: BotWorldState | null = null;
private stateReceivedAt: number = 0;
Expand Down Expand Up @@ -82,6 +84,7 @@ export class BotSDK {
showChat: config.showChat ?? false
};
this.sdkClientId = `sdk-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
this.quest = new QuestSDK(this);
}

// ============ Connection ============
Expand Down Expand Up @@ -1232,3 +1235,4 @@ export class BotSDK {

// Re-export types for convenience
export * from './types';
export * from './quests';
Loading