From 23264d77d4b03a37b6b34c6f148553367a808651 Mon Sep 17 00:00:00 2001 From: Kaan Soral Date: Sat, 3 Feb 2018 20:47:00 +0300 Subject: [PATCH] Create how_to_handle_game_events.js --- examples/how_to_handle_game_events.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/how_to_handle_game_events.js diff --git a/examples/how_to_handle_game_events.js b/examples/how_to_handle_game_events.js new file mode 100644 index 0000000..bb65fd4 --- /dev/null +++ b/examples/how_to_handle_game_events.js @@ -0,0 +1,9 @@ +game.all(function(event,args){ + game_log(event,"orange"); + game_log(JSON.stringify(args)); +}); + +game.on("trade",function(args){ + if(args.buyer!=character.name && args.seller!=character.name) + say("Check out my goods too "+args.buyer+"!"); +});