Multi-game Facebook Instant Games Bot (free code)

So, I decided to post the code to my Facebook Instant Games Bot to save other devs a lot of research and time. The bot is written using node.js, you will need to set up a hosting service that will run your bot. I chose Digital Ocean to host mine because Droplets are super simple to set up and cheap as chips. I service 5 games with the single bot and I never go over my $5 per month limit. If you do sign up with them then please use my referral link, you get $10 of free credit.

This bot server can handle many games at once, simply add new games to the pages.js source file. Click this link to download the bot.

Files in this archive include:

  • bot.js – The main bot which accepts requests and creates new players
  • bot_none_cluster.js – None cluster version of bot.js (can be used with pm2 -i option)
  • crawler – Crawls through the database checking for players that need to be messaged and messages them, also removes players that do not respond from the database
  • messaging.js – Sends messages out to players
  • pages.js – Stores page data

Usage:

  • node bot.js – Runs the bot which listens for connections and adds players to the database
  • node crawler.js – Periodically crawls through the database finding players that need to be messaged and sends them a message

Note that you will need to set up both node and redis on your server in order for the bot to work. Performance wise the bot is incredibly fast. I am servicing 5 games with mine and using only 1% CPU.

To help get you started see my other blogs:
Installing and running Node.js on a VPS
Installing Redis to Windows / Linux

Facebook Instant Games Category Breakdowns

I track all things Facebook Instant Games related, its a new little obsession of mine. I went ahead and calculated how many games are in each genre out of the current crop of just under 3000 available games. Below is a list of Facebook game genres along with how many games are in each:

  • Action – 577 games
  • Puzzle – 1035 games
  • Trivia & Word – 118 games
  • Simulation – 150 games
  • Board – 98 games
  • Sports – 282 games
  • Match 3 – 100 games
  • Card – 64 games
  • Slots – 43 games
  • Runner – 260 games
  • Strategy – 73 games
  • Role Playing – 91 games
  • MOBA – 4 games
  • Builders – 15 games
  • Bingo – 9 games
  • Poker & Table – 34 games
  • Card Battle – 4 games

Lets take a look at the list sorted by total MAU in those categories:

  • Puzzle – 1035 games (49116400 total MAU – avarage per game is 47455)
  • Sports – 282 games (44689600 total MAU – avarage per game is 158473)
  • Trivia & Word – 118 games (41406500 total MAU – avarage per game is 350902)
  • Action – 577 games (38617000 total MAU – avarage per game is 66927)
  • Board – 98 games (17343200 total MAU – avarage per game is 176971)
  • Simulation – 150 games (16033700 total MAU – avarage per game is 106891)
  • Runner – 260 games (14430399 total MAU – avarage per game is 55501)
  • Card – 64 games (10803200 total MAU – avarage per game is 168800)
  • Match 3 – 100 games (6334800 total MAU – avarage per game is 63348)
  • Role Playing – 91 games (4992400 total MAU – avarage per game is 54861)
  • Strategy – 73 games (4511700 total MAU – avarage per game is 61804)
  • Slots – 43 games (1562100 total MAU – avarage per game is 36327)
  • Bingo – 9 games (1474800 total MAU – avarage per game is 163866)
  • Poker & Table – 34 games (1464900 total MAU – avarage per game is 43085)
  • Card Battle – 4 games (924500 total MAU – avarage per game is 231125)
  • MOBA – 4 games (322000 total MAU – avarage per game is 80500)
  • Builders – 15 games (193300 total MAU – avarage per game is 12886)

What can we ascertain from these figures? Well, Puzzle games seem to be the most popular amongst developers, unfortunately users do not share that view with a very low average MAU per game. Trivia & Word is the leading category in terms of of average MAU per game whilst having far fewer games has an average MAU many times greater.