aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2019-12-17 22:24:25 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2019-12-17 22:24:25 -0500
commitc37754420359c9c7f9336e149697ccff7ae8e095 (patch)
treea299d2523781409db4f8821ceeb48bd16f0af817 /examples
parent345b07af1434abefbb1c037c6d407a6671f8ae75 (diff)
added example
Diffstat (limited to 'examples')
-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
+});
+