๐ŸŽ TENYO 2026
๐Ÿšš Shipping from 12 USD
๐Ÿ’ฐ DEALS OF THE DAY

Objects

Event - onEvent

To handle events in MagiScript, such as button presses, accelerometer data, or Bluetooth connections, simply implement the onEvent function. This function will automatically receive and manage all incoming events for you.

				
					function onEvent(event) {
  console.log(event.value, event.type, event.source, event.sourceId);
}
				
			

For more information, see our events documentation.

Device

Atom can connect to other devices, like PeekSmith or SB Watch. You can query the list of connected devices with the devices.list() function, or with device specific functions like ps.list() or sbwatch.list().

				
					const devs = devices.list();
for (let i = 0; i < devs.length; devs++) {
  console.log(dev.id, dev.type, dev.battery, dev.isActive);
}
				
			

We have some magic related JavaScript objects we support, like a time or card object. You will get them from functions, or pass them to functions. Expect more objects and functions coming.

Time - parseTime

Time has 4 properties: hours, minutes, seconds and text.

				
					let time = parseTime('714');
console.log(time.text, time.hours, time.minutes, time.seconds);
				
			

You can use the string representation to set the time on an SB Watch, for example:

				
					sbwatch.setTime(time.text);
				
			

Or display it on a PeekSmith:

				
					ps.print(time.text);
				
			

Card - parseCard

Card has many properties: pos, name, code, color, value.

				
					let card = parseCard('QH'); 
  console.log(card.pos); // 37 - pos in "simple" stack 
  console.log(card.code); // 37 - pos in "simple" stack 
  console.log(card.name); // QH 
  console.log(card.value); // 11 - Queen 
  console.log(card.color); // 2 - Hearts
				
			

The name property (‘4C’ in this case) can be sent to PeekSmith and it will recognize it as a poker card when Smart Text is ON. The code is the position of the card in the “simple” stack (color * 13 + value).

Devices & MagiScript

โš›๏ธ Atom Remote

๐Ÿ”ข Quantum Calculator

๐Ÿคนโ€โ™‚๏ธ MagiScript Language

๐Ÿคนโ€โ™‚๏ธ MagiScript Examples

๐Ÿคนโ€โ™‚๏ธ MagiScript Tutorials

General

๐Ÿ“ƒ First Steps

MagiScript Editor

๐Ÿ“ƒ Basics

๐Ÿ“ƒ Keyboard Shortcuts

๐Ÿ“ƒ Running Your First Program

๐Ÿ“ƒ App Store

๐Ÿ“ƒ Atom Settings (Editor)

๐Ÿ“ƒ Debugging Techniques

Input/Output

๐Ÿ“ƒ Buttons

๐Ÿ“ƒ Vibration Motor

๐Ÿ“ƒ RGB LED

๐Ÿ“ƒ Devices

๐Ÿ“ƒ PeekSmith

๐Ÿ“ƒ Quantum

๐Ÿ“ƒ Teleport

๐Ÿ“ƒ Spotted Dice

๐Ÿ“ƒ SB Watch

๐Ÿ“ƒ IARVEL Watch

๐Ÿ“ƒ Fossil Watch

๐Ÿ“ƒ Cosmos Printer

๐Ÿ“ƒ PeriPage Printer

๐Ÿ“ƒ ATC Remote

๐Ÿ“ƒ Labco Scrabble

๐Ÿ“ƒ Bluetooth Keyboard

๐Ÿ“ƒ Bluetooth Mouse

๐Ÿ“ƒ Timers

๐Ÿ“ƒ Database

๐Ÿ“ƒ Events

๐Ÿ“ƒ System (exit, sleep, rand)

๐Ÿ“ƒ Objects (card, time)

Language

๐Ÿ“ƒ Summary

๐Ÿ“ƒ Comments

๐Ÿ“ƒ Variable Declarations

๐Ÿ“ƒ Operators

๐Ÿ“ƒ Control Flow

๐Ÿ“ƒ Functions

๐Ÿ“ƒ Numbers

๐Ÿ“ƒ Strings

๐Ÿ“ƒ Arrays

๐Ÿ“ƒ Objects

๐Ÿ“ƒ Uint8Array