Docs · captcha

captcha

9 captcha commands, generated from the engine's own registry — signatures, parameters and a worked example each. A does something command acts on the game; a needs x() one answers a confident wrong answer when its client hooks are missing.

awaitSleepWord does something returns string?
awaitSleepWord(timeout: int) -> string?

Answers with the word for the captcha on screen, waiting up to the timeout for it if it has not been read yet, or none if it does not come. Blocks, and stops promptly when the script is stopped.

ParameterTypeWhat it does
timeoutrequired int how long to wait, in milliseconds
Example
let word = awaitSleepWord(15000)
if word != none { typeSleepWord(word) }
captchaOutOfCredits returns bool
captchaOutOfCredits() -> bool

Whether the service last refused for want of credits. Cleared by the next successful read, so it answers "can this account pay for a word right now" rather than "did it ever fail".

Example
if captchaOutOfCredits() { print("top up at botwith.me") stop }
captchaReady returns bool
captchaReady() -> bool

Whether a reading service is installed at all. False means sleep words are never sent and awaitSleepWord can only ever time out.

Example
if not captchaReady() { print("nothing can read a sleep word") }
captchaServer returns string
captchaServer() -> string

Which game server sleep words are being read for. The reader is trained per server and cannot be shared between them.

Example
print("reading words for", captchaServer())
captchasDropped returns int
captchasDropped() -> int

How many were thrown away because the service was already busy with two.

Example
if captchasDropped() > 0 { print("the reader is falling behind") }
captchasSent returns int
captchasSent() -> int

How many sleep words have been sent to be read.

Example
print("sent", captchasSent())
captchasSolved returns int
captchasSolved() -> int

How many came back with a word.

Example
print("solved", captchasSolved())
sleepWord returns string?
sleepWord() -> string?

The answer to the sleep captcha that is on screen right now, or none. It is none until that captcha has been read, none if reading it failed, and none again the moment the game draws a different one - so it is never the answer to the captcha before this one.

Example
if sleepWord() != none { print("the word is", str(sleepWord())) }
typeSleepWord does something
typeSleepWord(word: string)

Types a word into the sleep box and presses enter, one character at a time with human gaps. Answers nothing, because the client acknowledges nothing: follow it with 'wait until not isSleeping()' to find out whether it was right.

ParameterTypeWhat it does
wordrequired string the five characters
Example
typeSleepWord("crumb")