Skip to main content

Module script

Module script 

Source
Expand description

Scripts: small programs, in Rhai, that log in to a BBS or find their way around it, as Telix’s SALT and Qodem’s scripts did.

A script runs on its own thread. It reads what the BBS sends (as text, without the ANSI codes) and asks the front end to send, show messages or hang up through channels; the front end wakes up for its requests.

if wait("Login:", 20) {          // seconds; false if it never came
    send(user() + "\r");
    wait("Password:");
    send(password() + "\r");
}
let which = wait_any(["[Y/n]", "Main Menu"], 30);
if which == 0 { send("n\r"); }
sleep(0.5);
notify("Logged in to " + bbs());

Besides those: screen() is the text on the screen, one line per row; hangup() ends the call; print(x) shows x on the status line.

Structs§

CallInfo
About the call, for user(), password() and bbs().
Script
A script running.

Enums§

FromScript
What a script asks of the front end.
ToScript
From the front end to the script.