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+"!"); +});