ChipmonkeyLua

About

ChipmonkeyLua (for short: CMLua) is an interactive Lua interpreter in the spirit of vintage BASIC interpreters. It’s available for Windows, Linux 64 bit and Linux 32 bit operating systems and is a full Lua 5.2 interpreter. You can do most things as you can do with the original stand-alone Lua interpreter. However, CMLua comes with a lot of built-in features like a default graphical mode, easy file and input handling and mouse input. Bear in mind that CMLua uses a 16 bit colour mode. Colour values are valid from 0 to 65535. You can, however, use the built-in function hrgb (red, green, blue) to get a colour close to its 24 bit value.

Download

There are three packages available according to your operating system:

Installation

CMLua needn’t to be installed, just unzip to a folder and double click. On Linux you might need to install “liblua5.2”. It is also possible to start CMLua from the console adding a few command line parameters, which are:

Add a second parameter as a default script which will be executed right after the start of CMLua.

Load and execute a script

You can load the scripts right in the interpreter with

load ("scriptname.lua")

After loading you can have a look at the listing with

list()

Use ESC to break the listing or SPACE to pause and any other key to resume. Then try

run()

to execute the loaded script.

Edit scripts

For longer scripts I recommend using an external editor, e.g. Geany. For smaller and/or for testing purposes just type

edit()

Now you can enter your script. To quit edit mode leave a line empty and press return. If you have some longer algorithms to enter try switching in the hires mode for more characters per line with

hires()

Functions

There are a few built-in functions which you can see by typing

help()

You can get more help by typing the function with empty brackets, e.g.

sleep()

The answer will be

Usage: sleep (ms)

German special characters

Since the keys are’nt accessable within CMLua, I mapped the German special characters (a.k.a. as “Umlauts”) onto the function keys.

The functions keys are still readable through getkey()

Screen Shots

This is the start screen (in mode 800 x 600)

The result of the infamous plasma script

The plasma.lua script in hires mode

The yahtzee example (in German)

Handling images in CMLua format

Support forum

There is a support forum on retrogamecoding.org

Release notes

Version 1.3.8 published 2015-04-05

This is a very simple implementation. On Linux it tries to use an installed media player, on Windows it uses the mmsystem (which means that one can play only one wav at one time).

Version 1.3.6 published 2015-03-26

Version 1.3.4 published 2014-09-11

Version 1.3.1 published 2014-05-18

Version 1.3 published 2014-03-16

Version 1.2 published 2014-03-02

added:

You can now pause the display of listings or files by pressing “Space”. Any other key continues.

Version 1.1 published 2014-02-01

Version 1.0 published 2013-12-29