aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/helloworld.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/helloworld.js b/examples/helloworld.js
new file mode 100644
index 0000000..ec8ca3b
--- /dev/null
+++ b/examples/helloworld.js
@@ -0,0 +1,7 @@
+const ywot = require('../socket'); // Import direct library
+
+main = new ywot.Socket(''); // Open socket
+main.on('open',()=>{ // When socket opens
+ main.write([[[1,1],[0,0],'!']]); // Tell the server to put an exclamation mark at the topleft of the tile bottomright of the motd
+});
+