Quests, Achievements & Daily Gift
Daily gift
client:claimDailyGift()
| Field | Type |
|---|---|
| Signature | (self: Client) → string? |
| Returns | string? — nil on success |
| Async | yes |
Sends RqWG (WorldGiftRequest). Server replies with the calendar slot, timestamp, and gift contents. No-op if already claimed today.
Achievements
client:getAchievements()
| Field | Type |
|---|---|
| Signature | (self: Client) → {table} |
| Returns | 1-indexed table of {id, name, description, current, completed_level, claimed_level, max_level, requirements, rewards, final_target, reward} rows |
| Async | yes |
client:getAchievement(id)
| Field | Type |
|---|---|
| Signature | (self: Client, id: number) → table? |
| Returns | Single achievement row, or nil for an unknown id |
| Async | yes |
client:claimAchievement(id, level)
| Field | Type |
|---|---|
| Signature | (self: Client, id: number, level: number) → string? |
| Returns | string? — nil on success |
| Common errors | Errors.CANCELLED, Errors.DISCONNECTED |
| Async | yes |
local list = client:getAchievements()
local one = client:getAchievement(id)
client:claimAchievement(id, level)
Quests
client:getQuests()
| Field | Type |
|---|---|
| Signature | (self: Client) → {table} |
| Returns | 1-indexed table of {id, title, description, quest_type, current_step, step_progress, amount, reward_gems, reward_xp, reward_extra, slot} rows. id is the FULL string (e.g. "DailyQuest127") |
| Async | yes |
client:acceptQuest(questId?)
| Field | Type |
|---|---|
| Signature | (self: Client, questId: number?) → (string, string?) |
| Returns | (id, err) — resolved quest id string and optional Errors.* code |
| Common errors | Errors.CANCELLED, Errors.DISCONNECTED, Errors.OTHER |
| Async | yes |
No arg picks an eligible quest based on bundled pool metadata + bot level. Pass a numeric id to force one (e.g. 127 for DailyQuest127).
client:claimQuest(questId)
| Field | Type |
|---|---|
| Signature | (self: Client, questId: string) → string? |
| Returns | string? — nil on success |
| Common errors | Errors.CANCELLED, Errors.DISCONNECTED |
| Async | yes |
Pass the full string id ("DailyQuest127" / "Tutorial10"). Auto-routes CdQ vs CtQ by prefix.
client:discardQuest(slotIndex)
| Field | Type |
|---|---|
| Signature | (self: Client, slotIndex: number) → string? |
| Returns | string? — nil on success |
| Common errors | Errors.CANCELLED, Errors.DISCONNECTED |
| Async | yes |
Discards the daily quest at slot index (0 or 1). Tutorial quests cannot be discarded.
local quests = client:getQuests()
client:acceptQuest() -- accept the next available quest
client:acceptQuest(questId) -- … or a specific id
client:claimQuest(quest_id_str)
client:discardQuest(slot_index)