I just recently got the Elgato Stream Deck and was immediately interested in putting it to development use. I was looking around a couple days ago and saw a conversation about triggering an event (globally) through the stream deck without even being in the game. At first this seemed relatively impossible, but with some research, I was able to figure out a way. Anyway, enough with the talking and more with the information. (Throughout this tutorial please refer to the red squares/circles for guidance)
Before starting this tutorial please make sure you have an account with Glitch, IFTTT, and Elgato.
Downloading the StreamDeck Software
Ok, to start off we will need to download the Elgato Stream Deck Software if you have not already. In order to do so, you should be able to head over to https://www.elgato.com/downloads. You will then need to click “Select your product” and select which type of Stream Deck you own. It should automatically default to your system type, but if it is incorrect please also remember to click the right one located next to the “Select your product” drop-down.
After this you should see correct software for your system, and can click the download button right below it. You will then need to open the installer downloaded onto your device and complete installation. You may keep open the Stream Deck Software after it downloads, we will need it later.
Downloading the IFTTT(If This Then That) Plugin
Next we will need to get a plugin for the Stream Deck. We will be getting IFTTT for this tutorial. IFTTT is normally used for controlling security products, sending emails, and making automated phone calls, but we will be using it for something much different. IFTTT also comes with something called webhooks… yes, we have to use webhooks, but don’t worry they will be easier then thought.
After proceeding to the IFTTT plugin located in the Elgato Marketplace, you may click the blue “Get” button. You may be prompted to open the Elgato Software, please do so to allow the plugin to install. If you get an error please attempt to install again (open the plugin in the Elgato software).
Setting up IFTTT in Stream Deck
After getting the IFTTT plugin, you will see something kind of like this on the right side of your screen.
You will then need to drag IFTTT into one of the available squares. After doing so you should see this on the bottom of your screen. (If you do not see it, please click the IFTTT square)
First we will want to get our maker key. This will be used to prevent people from abusing their app. To do this we will need to head over to the Webhook Integration Page and click connect.
We will then go back to the Webhook Integration Page and click Documentation.
The very first header should be your key, please then paste that into the space labeled “Maker Key” in our IFTTT square in the Stream Deck Software.
Next we will go over to Explore all Services and click the create button or go to https://ifttt.com/create
After words you should see this, the If This Then That part of IFTTT.
Click add and then search for “Webhooks”. You will then click “Receive a web request”, name it (a normal name, it will help you later), and click create trigger. You will then go back to the Elgato Stream Deck Software and fill “Event Name” with the name you put for the trigger. We will finish the “Then That” section later, do NOT close that tab, you will be forced to restart if you do.
Setting up the middleman (Glitch)
Unfortunately, IFTTT and Roblox cannot directly communicate with each other, so we have to use a “middle man”. This middleman will be Glitch, a free hosting server. To make things easier, I created a project for you to remix. ( server.js – sand-determined-reaper (glitch.com)).
Make sure to save your project! Next we will go to share and copy the live site link. Now its time to go back to our IFTTT project. Go ahead and click “Then That” and search for another Webhook. This time click “Make a web request”. In the URL section, you are going to paste your live site link and add “/ifttt” to the end of it. Set the method to POST, the content type to “application/jason”, and most importantly set your additional header to “User-Agent: IFTTT” this will give IFTTT access to your project. You can then go ahead and click create (or update). Now for the Roblox part!
The Roblox Part
Next we will need to go over to serverscriptservice and create a server script (or a “script”). Paste this script in and replace LIVE_SITE_LINK_HERE with your live site link. (Please note you will have to make your own action where “Action here” is.)
local HttpService = game:GetService("HttpService")
local livelink = "LIVE_SITE_LINK_HERE"
while wait(5) do -- wait for 5 seconds
local success, result = pcall(function()
return HttpService:GetAsync(livelink.."check-updates")
end)
if success then
local data = HttpService:JSONDecode(result)
if data.updateAvailable then
-Action here
end
else
warn("Failed to check for updates: " .. result)
end
end
Make sure to save your script and then you will have it working!