CREATING YOUR OWN INTRX SCRIPTS
If you can think of a way for IntRX to interact with your game of choice, you can most likely create your own scripts for it. Scripts are made with AutoHotkey, which is already easy to use, but we've gone ahead and made it even easier for you by creating templates in the UserScripts\Templates folder. The main tutorial will focus on Basic Send Command.ahk, as other templates will be easier to understand afterward.
We highly, highly recommend using Notepad++ to create or edit AHK scripts— we believe this is an essential program that everyone should have regardless, so go download it if you don't have it already. It will be extremely helpful in this guide, especially regarding line numbers.
Please note that you can do all sorts of amazing things with AutoHotkey, these templates only showcase a few possibilities. AutoHotkey has great documentation, and a forum full of people willing to help. So if you want to create a crazy command, do some Google searches, maybe ask some questions on the forum, and you'll likely find that it is possible.
We highly, highly recommend using Notepad++ to create or edit AHK scripts— we believe this is an essential program that everyone should have regardless, so go download it if you don't have it already. It will be extremely helpful in this guide, especially regarding line numbers.
Please note that you can do all sorts of amazing things with AutoHotkey, these templates only showcase a few possibilities. AutoHotkey has great documentation, and a forum full of people willing to help. So if you want to create a crazy command, do some Google searches, maybe ask some questions on the forum, and you'll likely find that it is possible.
BASIC SEND COMMAND
This is the "base" template. It will allow you to easily create a simple command output script, and all other templates provided are based on this template, so the better you understand this template, the more you'll understand all the others. There are notes in the template files themselves (all lines starting with a ; semicolon), but this page will go far more in-depth.
Lines 1-8 should not be messed with.
Line 13:
KeyList := "Shift|w|a|s|d|e|f|r|Space"
Any keys you use regularly in your game of choice should be added to this list, each key separated by a | character. So for example, if you use push-to-talk in your game, add your push-to-talk key to this list. For non-letter/number keys, consult AHK's key list.
Lines 16-19:
Loop, Parse, KeyList, |
{
Send % "{" A_Loopfield " Up}"
}
This is what the KeyList is for; if you're holding down a key in your KeyList, it will be released before the command is entered, to avoid breaking it.
Lines 22-25:
SendInput, {`` Down}
Sleep, 15
SendInput, {`` up}
Sleep, 15
Most games have a console or chat window to enter commands into, this section opens it. Most consoles are opened with the backtick (`) key, so that's what it's set to by default. To change it, replace `` with your key, or remove this section entirely if it's not needed.
Line 28:
Input = Something
This is the input, i.e. the command you want entered into the game. Replace Something with whatever you want typed into your game.
IMPORTANT NOTE: If, for whatever reason, your command has a percent sign in it, type `% instead of just %.
Lines 33-43:
{
toPrint = %A_LoopField%
if toPrint is space
{
toPrint = Space
}
SendInput, {%toPrint% down}
Sleep, 25
SendInput, {%toPrint% up}
Sleep, 25
}
SendInput sends your input to the game. Sleep is a delay between inputs, in milliseconds. So to put it simply, this code sends your input one character at a time, holding the key down for 25ms, then releasing it and waiting another 25ms before inputting the next character. We've found that a 25ms delay works in most games, but you can try to change it if you wish. Decrease it to see if your game can handle inputs being sent quicker, increase it if the command is being input too fast for the game to handle. Play around with it and see what works.
Lines 46-49:
SendInput, {Enter Down}
Sleep, 15
SendInput, {Enter up}
Sleep, 15
Once the command is entered into the game, it needs to be sent by the game. Usually via the Enter key, but if it's something else, change it.
Lines 52-55:
SendInput, {`` Down}
Sleep, 15
SendInput, {`` up}
Sleep, 15
Closes the console or chat window, the same way it was opened earlier. So, change or remove this section the same way you did earlier.
Line 58:
return
To put it simply, this ends your script and closes it.
And that's all for the base template! The next templates are for more advanced stuff, but are all based off of this base template. So I won't go over any sections of the code I went over already. And note that since I'm explaining what each line of code does, you can create your own script combining multiple features from these templates.
Lines 1-8 should not be messed with.
Line 13:
KeyList := "Shift|w|a|s|d|e|f|r|Space"
Any keys you use regularly in your game of choice should be added to this list, each key separated by a | character. So for example, if you use push-to-talk in your game, add your push-to-talk key to this list. For non-letter/number keys, consult AHK's key list.
Lines 16-19:
Loop, Parse, KeyList, |
{
Send % "{" A_Loopfield " Up}"
}
This is what the KeyList is for; if you're holding down a key in your KeyList, it will be released before the command is entered, to avoid breaking it.
Lines 22-25:
SendInput, {`` Down}
Sleep, 15
SendInput, {`` up}
Sleep, 15
Most games have a console or chat window to enter commands into, this section opens it. Most consoles are opened with the backtick (`) key, so that's what it's set to by default. To change it, replace `` with your key, or remove this section entirely if it's not needed.
Line 28:
Input = Something
This is the input, i.e. the command you want entered into the game. Replace Something with whatever you want typed into your game.
IMPORTANT NOTE: If, for whatever reason, your command has a percent sign in it, type `% instead of just %.
Lines 33-43:
{
toPrint = %A_LoopField%
if toPrint is space
{
toPrint = Space
}
SendInput, {%toPrint% down}
Sleep, 25
SendInput, {%toPrint% up}
Sleep, 25
}
SendInput sends your input to the game. Sleep is a delay between inputs, in milliseconds. So to put it simply, this code sends your input one character at a time, holding the key down for 25ms, then releasing it and waiting another 25ms before inputting the next character. We've found that a 25ms delay works in most games, but you can try to change it if you wish. Decrease it to see if your game can handle inputs being sent quicker, increase it if the command is being input too fast for the game to handle. Play around with it and see what works.
Lines 46-49:
SendInput, {Enter Down}
Sleep, 15
SendInput, {Enter up}
Sleep, 15
Once the command is entered into the game, it needs to be sent by the game. Usually via the Enter key, but if it's something else, change it.
Lines 52-55:
SendInput, {`` Down}
Sleep, 15
SendInput, {`` up}
Sleep, 15
Closes the console or chat window, the same way it was opened earlier. So, change or remove this section the same way you did earlier.
Line 58:
return
To put it simply, this ends your script and closes it.
And that's all for the base template! The next templates are for more advanced stuff, but are all based off of this base template. So I won't go over any sections of the code I went over already. And note that since I'm explaining what each line of code does, you can create your own script combining multiple features from these templates.
BASIC SEND KEYPRESS
Want to send one single keystroke instead of an entire command? With this template, it couldn't possibly be simpler.
Line 17:
Input = S
Replace S with whatever key you want sent, and that's it! For non-letter/number keys, consult AHK's key list.
Lines 20-23:
SendInput, {%Input% down}
Sleep, 45
SendInput, {%Input% up}
Sleep, 45
The Sleep lines determine how long, in milliseconds, the key is held down, and how long it waits after the key is released before the script ends. 45ms should be fine for most games, but you can change it if you wish. Decrease it to see if your game can handle inputs being sent quicker, increase it if the command is being input too fast for the game to handle. Play around with it and see what works.
Line 17:
Input = S
Replace S with whatever key you want sent, and that's it! For non-letter/number keys, consult AHK's key list.
Lines 20-23:
SendInput, {%Input% down}
Sleep, 45
SendInput, {%Input% up}
Sleep, 45
The Sleep lines determine how long, in milliseconds, the key is held down, and how long it waits after the key is released before the script ends. 45ms should be fine for most games, but you can change it if you wish. Decrease it to see if your game can handle inputs being sent quicker, increase it if the command is being input too fast for the game to handle. Play around with it and see what works.
COMMAND WITH ARGUMENTS
Whenever a user in your chat types a command, IntRX reads all the text written after the command, and saves it to the output.txt file in the UserScripts folder. You can have your script read this file, allowing viewers to add variables to their commands, or even type their own commands entirely. For example, if a user types !spawn bear, the word "bear" will be written to the output file.
Line 28:
FileRead, CommandVar, output.txt
This gets the text from output.txt in the UserScripts folder, and assigns it to the CommandVar variable.
Line 32:
Input = %CommandVar%
This is the same as the Input line in the base template, but now that the output text has been saved to the CommandVar variable, you can use that here by typing %CommandVar% in the input. You can type anything before and/or after it, if needed.
As a random example: If a user types !spawn bear in chat, and you have the input set to spawn %CommandVar% 5, this would create the command "spawn bear 5".
Line 28:
FileRead, CommandVar, output.txt
This gets the text from output.txt in the UserScripts folder, and assigns it to the CommandVar variable.
Line 32:
Input = %CommandVar%
This is the same as the Input line in the base template, but now that the output text has been saved to the CommandVar variable, you can use that here by typing %CommandVar% in the input. You can type anything before and/or after it, if needed.
As a random example: If a user types !spawn bear in chat, and you have the input set to spawn %CommandVar% 5, this would create the command "spawn bear 5".
COPY-PASTE COMMAND
Some games allow text to be pasted directly into the console/chat window. If that's the case, you can use this template instead of the base to enter your command instantaneously.
Line 27:
SavedClip := ClipboardAll
If you have anything currently copied to your clipboard, this will back it up, ensuring your command doesn't overwrite it.
Line 31:
Clipboard := "Something"
This copies whatever is in the quotes to your clipboard. Replace Something with your command (keep the quotes).
Line 34:
Send ^v
Presses Ctrl + V, pasting your command.
Lines 37-38:
Clipboard := SavedClip
SavedClip := ""
Restores the earlier backup to your clipboard.
Line 27:
SavedClip := ClipboardAll
If you have anything currently copied to your clipboard, this will back it up, ensuring your command doesn't overwrite it.
Line 31:
Clipboard := "Something"
This copies whatever is in the quotes to your clipboard. Replace Something with your command (keep the quotes).
Line 34:
Send ^v
Presses Ctrl + V, pasting your command.
Lines 37-38:
Clipboard := SavedClip
SavedClip := ""
Restores the earlier backup to your clipboard.
RANDOM COMMAND
With this template, you can write a list of commands, and the script will choose one of those commands at random to execute.
Lines 28-29:
command1=First command
command2=Second command
This is your list of commands. Replace the text after the equal sign to whatever you want your command to be, like you would normally do for the Input in other templates. You can add as many commands as you like. So to add a third command, that would be:
command3=Third command
And so on.
Lines 33-37:
Random, output, 1, 2
If output=1
Input = %command1%
else If output=2
Input = %command2%
This selects a random command from the list you created above. If you added more commands, replace the 2 in the first line with the number of commands you have listed. And each additional command will require you to add another else If and Input line. So if you added a third command to the list, you'd need to add these lines:
else If output=3
Input = %command3%
And so on.
Lines 28-29:
command1=First command
command2=Second command
This is your list of commands. Replace the text after the equal sign to whatever you want your command to be, like you would normally do for the Input in other templates. You can add as many commands as you like. So to add a third command, that would be:
command3=Third command
And so on.
Lines 33-37:
Random, output, 1, 2
If output=1
Input = %command1%
else If output=2
Input = %command2%
This selects a random command from the list you created above. If you added more commands, replace the 2 in the first line with the number of commands you have listed. And each additional command will require you to add another else If and Input line. So if you added a third command to the list, you'd need to add these lines:
else If output=3
Input = %command3%
And so on.
STREAM OVERLAY COMMAND
This "template" is a bit different in that it's not an actual template, it's simply two lines of code you can add to any script to output some text to a text file for a certain amount of time. This text file can be added to OBS (or your streaming program of choice) as a text source, letting viewers know that a command is active/has been activated even if they're not watching chat. Especially good for scripts with effects that last several seconds.
This is best for scripts with an effect that lasts several seconds, but can also be used with normal scripts by adding a Sleep at the end.
Line 7:
FileAppend, Your Text Here, OBS.txt
Creates a file in your UserScripts folder called OBS.txt, then writes some text to it. Replace Your Text Here with the text you want displayed on your stream. Add OBS.txt as a text source in your streaming program for your viewers to see. To add this to your own script, paste the line near the beginning, such as before KeyList.
Line 11:
FileDelete, OBS.txt
Deletes OBS.txt, therefore removing the text overlay from your stream. To add this to your own script, paste this line after everything else in your script, right before return.
Line 14:
Sleep 0
Change this from 0 if you want your text to stay on screen a few seconds longer.
IMPORTANT NOTE: For the best user experience, we recommend not letting your scripts run longer than your CD BETWEEN CMDS setting. Nothing will break if you do, just note that while a script is running, no other commands will run until it is finished.
This is best for scripts with an effect that lasts several seconds, but can also be used with normal scripts by adding a Sleep at the end.
Line 7:
FileAppend, Your Text Here, OBS.txt
Creates a file in your UserScripts folder called OBS.txt, then writes some text to it. Replace Your Text Here with the text you want displayed on your stream. Add OBS.txt as a text source in your streaming program for your viewers to see. To add this to your own script, paste the line near the beginning, such as before KeyList.
Line 11:
FileDelete, OBS.txt
Deletes OBS.txt, therefore removing the text overlay from your stream. To add this to your own script, paste this line after everything else in your script, right before return.
Line 14:
Sleep 0
Change this from 0 if you want your text to stay on screen a few seconds longer.
IMPORTANT NOTE: For the best user experience, we recommend not letting your scripts run longer than your CD BETWEEN CMDS setting. Nothing will break if you do, just note that while a script is running, no other commands will run until it is finished.
SHARING YOUR SCRIPTS
If you'd like to share your scripts with other IntRX users, or see what scripts other users have shared, join our Discord and have a look at the #scripts text channel. Please share your scripts as .ahk files, or a .zip file if you're sharing multiple scripts.