Skip to main content

Quests, Achievements & Daily Gift

Daily gift

client:claimDailyGift()

FieldType
Signature(self: Client) → string?
Returnsstring?nil on success
Asyncyes

Sends RqWG (WorldGiftRequest). Server replies with the calendar slot, timestamp, and gift contents. No-op if already claimed today.

Achievements

client:getAchievements()

FieldType
Signature(self: Client) → {table}
Returns1-indexed table of {id, name, description, current, completed_level, claimed_level, max_level, requirements, rewards, final_target, reward} rows
Asyncyes

client:getAchievement(id)

FieldType
Signature(self: Client, id: number) → table?
ReturnsSingle achievement row, or nil for an unknown id
Asyncyes

client:claimAchievement(id, level)

FieldType
Signature(self: Client, id: number, level: number) → string?
Returnsstring?nil on success
Common errorsErrors.CANCELLED, Errors.DISCONNECTED
Asyncyes
local list = client:getAchievements()
local one = client:getAchievement(id)
client:claimAchievement(id, level)

Quests

client:getQuests()

FieldType
Signature(self: Client) → {table}
Returns1-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")
Asyncyes

client:acceptQuest(questId?)

FieldType
Signature(self: Client, questId: number?) → (string, string?)
Returns(id, err) — resolved quest id string and optional Errors.* code
Common errorsErrors.CANCELLED, Errors.DISCONNECTED, Errors.OTHER
Asyncyes

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)

FieldType
Signature(self: Client, questId: string) → string?
Returnsstring?nil on success
Common errorsErrors.CANCELLED, Errors.DISCONNECTED
Asyncyes

Pass the full string id ("DailyQuest127" / "Tutorial10"). Auto-routes CdQ vs CtQ by prefix.

client:discardQuest(slotIndex)

FieldType
Signature(self: Client, slotIndex: number) → string?
Returnsstring?nil on success
Common errorsErrors.CANCELLED, Errors.DISCONNECTED
Asyncyes

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)