The BlockCities x FOAM Scavenger Hunt is an interactive, virtual scavenger hunt that takes place weekly on the FOAM map.

For the hunt, BlockCities (with Cody Born) did some great work using Microsoft Azure to automate the interactive gameplay. This post breaks down how their solution using two bots works, hopefully inspiring you to build something similar with the FOAM API and Microsoft Azure (try here).

The Scavenger Hunt plays out on two platforms; Twitter and the FOAM Map. Location-specific clues are posted on twitter and participants enter their answers by entering a location as a point of interest via the FOAM Map.

This process is automated through two bots built using the Azure visual workflow and the Ethereum Blockchain connector. The Ethereum Blockchain Connector enables actions such as submitting transactions, reading contract state, and trigger flows on contract updates within Azure visual workflow. Using this, the two bots automatically check the map for accurate answers until someone guesses correctly, proceed to mint the digital collectible and then announce a winner on Twitter.

Clue Announcement Bot 📣🤖

The clue announcement bot is an Azure Function (serverless compute) that wakes up every minute and decides whether or not it needs to announce a clue on Twitter. It does this by accessing the hunt database to get the latest state and checking the current time. It then uses a simple formula to accelerate the rate of clue release until it runs out of clues for a given hunt or someone successfully identifies the Point of Interest corresponding to the correct clue answer.

Solution Checker Bot 📍🤖

This bot is triggered every 10 minutes during the duration of the scavenger hunt. To build this bot we’ve used Azure Logic Apps which handles the communication to the Ethereum smart contract, the FOAM API, and the database. The Ethereum Blockchain connector makes it easy to read and write state to a smart contract