Axiom QuickServe Scripting Reference (Discontinued)IntroductionCreate your own dial-up servers with ease using Axiom QuickServe, the number one tool for customized remote access systems!
NOTE: Axiom QuickServe has been discontinued. Contact your Axiom account manager for more information about EXA-based server solutions. Server Configuration ScriptsA custom server is defined by a configuration script. For a configuration script to be valid it must contain and implement the following four functions: getName() => String This function should return a string that will be used as the server's name. It must be short enough to fit in the NETronics Connect! menu. onConnect() This function will be called when a user connects to the server. onUpdate() This function will be called approximately 30 times a second while a user is connected to the server. onInput(Integer key) This function will be called every time the connected user presses a key. The value of Server Configuration APIThe following functions may be called from anywhere in your server configuration script: clearScreen() Clear the screen. drawText(String text, Integer color, Integer x, Integer y) Draw the specified text. The drawTextWrapped(String text, Integer color, Integer x, Integer y, Integer width) Draw the specified text, wrapping it so that it is no more than drawBox(Integer color, Integer x, Integer y, Integer width, Integer height) Draw a box using the built-in box drawing characters. fillArea(String symbol, Integer color, Integer x, Integer y, Integer width, Integer height) Fill an area using the specified symbol. saveData(String data) Write this server's persisted data string. You can convert a JavaScript object to a JSON string using loadData() => String Read this server's persisted data string. You can convert a JSON string to a JavaScript object using Example Serverlet lastKey; let keyBuffer; function getName() { return 'Test Server'; } function onConnect() { // Reset the server variables when a new user connects: lastKey = ''; keyBuffer = loadData(); } function onUpdate() { // It is safe to completely redraw the screen during every update: clearScreen(); // Draw the full color palette: drawText('COLOR REFERENCE', 14, 21, 2); drawBox(10, 1, 3, 54, 3); for (let i = 1; i <= 17; i++) { const text = (i < 10) ? ('0' + i) : i; drawText(text, i, i * 3, 4); } // Show the most recently pressed key: drawText('INPUT', 14, 2, 7); drawBox(10, 1, 8, 7, 5); drawText('000', 5, 3, 10); drawText(lastKey, 17, 6 - lastKey.length, 10); // Draw the full set of font characters: drawText('FONT REFERENCE', 14, 25, 7); drawBox(10, 9, 8, 46, 5); drawText('AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUu', 17, 11, 9); drawText('VvWwXxYyZz.,:;!?/\\%\'"0123456789+-*()[]^`', 17, 11, 10); drawText('█▟▙▜▛▀▄▐▌▝▘▗▖─═║╔╗╚╝╠╣╦╩╬><▲▼☺☻⚉ ™ ♦ ♣ ♠ ♥', 17, 11, 11); // Draw a persisted and editable text field: drawText('PERSISTENCE TEST', 14, 20, 14); drawBox(10, 1, 15, 54, 3); drawText(keyBuffer + '█', 17, 3, 16); } function onInput(key) { // Remember the last key pressed: lastKey = key.toString(); // Update the persisted text field: if (key == 8 && keyBuffer.length > 0) { keyBuffer = keyBuffer.substring(0, keyBuffer.length - 1); saveData(keyBuffer); } else if (key >= 32 && key < 127 && keyBuffer.length < 49) { keyBuffer = keyBuffer + String.fromCharCode(key); saveData(keyBuffer); } } |
|
© AXIOM 1997 | ALL RIGHTS RESERVED |