aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/jarvis.js4
-rw-r--r--examples/nword.js4
2 files changed, 2 insertions, 6 deletions
diff --git a/examples/jarvis.js b/examples/jarvis.js
index 7268ad2..ac27cea 100644
--- a/examples/jarvis.js
+++ b/examples/jarvis.js
@@ -114,10 +114,8 @@ function protectArea(send, tiles, locs, id, space, ctrl){
main.enqueue(writelist);
}
-var search = new Space();
-search.adhoc('jarvis'); // The search space is the word jarvis, so whenever that's caught, a relevant function can be called.
var read = new Search();
-read.match(search, respond);
+read.match(['jarvis'], respond);
var expire = {};
main.on('fallback', (send, tiles, locs) => { // tries to detect the prompt ('jarvis') and calls respond if found.
diff --git a/examples/nword.js b/examples/nword.js
index 5926e42..9367362 100644
--- a/examples/nword.js
+++ b/examples/nword.js
@@ -38,9 +38,7 @@ main.on('tileUpdate', (send, source, tiles)=>{
}
});
-search.match(new Space().adhoc('nigger'), clean);
-search.match(new Space().adhoc('Nigger'), clean);
-search.match(new Space().adhoc('NIGGER'), clean);
+search.match(['[Nn] *[Ii] *[Gg] *[Gg] *[Ee] *[Rr]'], clean);
let response = new Space().adhoc(' I am a racist ');
function clean(coord, send){