BBSML Tutorial
BBSML (BBS Markup Language) is a simplified BASIC-style language used to design your RetroBBS nodes. It is executed line by line in the browser's CRT engine.
Why BBSML?
It combines the nostalgia of 1980s BASIC programming with modern web capabilities. You write code that looks like it belongs on a Commodore 64, but it can read databases, chat with other nodes, and persist files on the cloud.
Basic Syntax
BBSML is built around line numbers, variables, and straightforward commands.
10 PRINT "HELLO" 20 PRINT "WORLD"
+ or ;.60 X = 10 70 Y$ = "SYSOP" 80 Z$ = Y$ + " ON LINE"
110 REM THIS IS A COMMENT
100 END
Input / Output
Commands to manipulate the screen and receive user input.
10 CLS
20 COLOR 1, 0 : PRINT "WHITE ON BLACK"
30 LOCATE 5, 10 : PRINT "CENTERED TEXT"
; at the end to suppress the newline.40 PRINT "ENTER NAME: ";
110 GET K$ : IF K$ = "" THEN 110 : REM Wait for key
115 INPUT "WHAT IS YOUR NAME? ", N$
120 SLOW : PRINT "DIAL-UP SPEED..." : NOSLOW
Logic & Loops
Control the flow of your program.
10 FOR D = 1 TO 500 : NEXT D : REM 1980s-style delay
AND, OR, and implied GOTO (just the line number).90 IF X = 10 OR Y = 5 THEN 200 : REM Implied GOTO 200 95 IF K$ = "M" AND X > 0 THEN GOSUB 3000
70 GOTO 10
100 ON X GOTO 500, 600, 700
80 GOSUB 500 : PRINT "BACK" : END 500 PRINT "IN SUB" : RETURN
CHR$(code), ASC(string), LEN(string), LEFT$(string, n).70 PRINT LEFT$(U$, 1) : L = LEN(U$)
Local File I/O
These commands allow you to read and write files directly in your node's storage area. This is a 100% Free CORE Feature.
10 FILES
20 TYPE "welcome.txt"
30 READ "scores.txt", S$ : PRINT "CURRENT SCORES: " ; S$
40 WRITE "log.txt", "USER LOGGED IN AT " + T$
50 DELETE "temp.tmp"
Database Commands
10 DBMAKE "users", "name,score"
20 DBINSERT "users", "Tim,500"
search_field matches search_value, and stores the data from return_field into the RESULT$ variable.30 DBGET "users", "name", "Tim", "score", S$
40 DBDROP "users"
Global Dropzone
The Global Dropzone is a shared public folder accessible by every node on RetroBBS.
10 GLOBALFILES
20 DROP "msg.txt", "HELLO ALL BBSES!"
30 GET "msg.txt", G$
Messaging & Chat
WHO shows everyone on RetroBBS, while WHONODE shows only users currently visiting your specific node.10 WHONODE
20 CHAT "WELCOME TO MY NODE, EVERYONE!"
30 MSG "Operator", "COULD YOU ASSIST ME WITH THIS CODE?"
M$ stores the message text, S$ stores the sender's alias, and P is 1 for private messages or 0 for node chat. If no message is waiting, M$ will be empty.40 POLL M$, S$, P : IF M$ = "" THEN GOTO 40 : REM WAIT LOOP
Special Control Codes
Use these with the CHR$() command to manipulate the terminal.
| Code | Function | Description |
|---|---|---|
CHR$(147) | CLR | Clears the CRT screen and resets cursor to top-left (same as CLS). |
CHR$(13) | CR | Carriage return (moves cursor to next line). |
CHR$(20) | DEL | Deletes the character before the cursor (Backspace). |
CHR$(7) | BEL | Simulates a system beep (Sysop alert). |
Color Palette (0-15)
Used with the COLOR fg, bg command.
| ID | Color | ID | Color |
|---|---|---|---|
| 0 | Black | 8 | Orange |
| 1 | White | 9 | Brown |
| 2 | Red | 10 | Light Red |
| 3 | Cyan | 11 | Dark Grey |
| 4 | Purple | 12 | Grey |
| 5 | Green | 13 | Light Green |
| 6 | Blue | 14 | Light Blue |
| 7 | Yellow | 15 | Light Grey |
Visual Studio Tips
- Visual Stamping: Use the GFX Studio to click or drag on the canvas and place characters visually. The engine will generate the BASIC code for you!
- Auto-Renumbering: When you paste generated code into the Main Editor, it will preserve your line numbers to ensure GOTO/GOSUB jumps remain intact.
- System Specific Glyphs: The Studio automatically loads the extended character set for your chosen BBS System (C64 PETSCII, Atari ATASCII, IBM CP437, Amiga ASCII).
- Live Preview: Use the iframe on the left pane to instantly test your BBS node without opening a new tab.