Core Nodes

6 min read

Introduction #

Applets in Stream Hydra come pre-loaded with core nodes for you to use in conjunction with other nodes from 3rd party modules. These nodes allow you to have greater control over the functionality of your applets and provide a variety of different services. To understand more about the data types used, check out this article.

Applet Specific #

On Enable #

On Enable node
On Enable

This node will trigger your applet when it is enabled by you. No data is returned.

On Disable #

On Disable node
On Disable

This node will trigger your applet when it is disabled by you. No data is returned.

Label #

Label node
Label

This node does nothing other than display the value of the text that you input. You can place as many of these around your applet as you wish, to help you keep track of anything specific.

Comparison #

Comparison Node
Comparison

This node takes 2 inputs and compares them using the condition that you specify. You can connect nodes to either the “True” or “False” outputs of this node to trigger actions based on the outcome of the comparison. The following comparisons can be used:

  • Is Equal To – Will compare strings together to see if they are identical.
  • Is Not Equal To – Will compare strings together to see if they are not identical.,
  • Contains – Will check if the first value contains the second value within it. For example, if you checked if “Apple” contained “App”, this would return “True”.
  • Is Greater Than – Checks if the first number is greater than the second.
  • Is Greater Than Or Equal To – Checks if the first number is greater than or equal to the second.
  • Is Less Than – Checks if the first number is less than the second number.
  • Is Less Than Or Equal To – Checks if the first number is less than or equal to the second number.

Storing and Retrieving Data #

Store Data #

Store Data Node
Store Data

This node will save any data you pass it, under the given name, whenever you call it.

  • Name (string) – The name for the data you wish to store. You will need to use this name later when referencing the stored data so make sure it’s both memorable and unique. Non-unique names will override any previous data that
  • Value (any) – The actual data to store.

Load Data #

Load Data Node
Load Data

This node will load and return any data that was previously stored under a given name, whenever you call it.

Takes:

  • Name (string) – The name of the data that was stored, must exactly match the name you specified earlier in the “Store Data” node otherwise the data will not load.

Returns:

  • {data_value} (any) – The data that was stored.

Remove Data #

Remove Data Node
Remove Data

This node will remove any data that may have been previously stored under a given name, whenever you call it.

  • Name (string) – The name of the data that was stored, must exactly match the name you specified earlier in the “Store Data” node otherwise the data will not be removed.

Timers #

Start Timer #

Start Timer Node
Start Timer

This node will start a timer when called, with the given name, and will call any “On Timer” nodes with that same name every X minutes which you specify. The timer will continue to run until you either stop it manually (using the “End Timer” node) or when you disable the applet. The timer will not automatically restart when the applet is re-enabled, and must be started from this node.

  • Timer Name (string) – The name of the timer, so you can reference it later. Make sure to keep the name unique if you want to use multiple timers in the same applet.
  • Minutes (number) – Choose how often you want the timer to run, from 1 to 1440 minutes. (1440 minutes equals 1 day)

On Timer #

On Timer Node
On Timer

This node will trigger your applet every X minutes that you specified in the “Start Timer” node, after the timer has been started.

  • Timer Name (string) – The name of the timer that you specified in the “Start Timer” node, must exactly match.

End Timer #

End Timer Node
End Timer

This node will stop the timer with the given name when called. Alternatively, all timers will be stopped if the applet is disabled.

  • Timer Name (string) – The name of the timer that you specified in the “Start Timer” node, must exactly match.

Delay #

Delay Node
Delay Node

This node isn’t exactly a timer, but we thought it best to put it here. It will delay the execution of any nodes that are connected to the output by a specified amount of seconds.

  • Delay in seconds (number) – Choose a number between 1 and 3600 (1 hour) seconds for how long you want to delay for.

Extra #

Unique Filter #

Unique Filter Node
Unique Filter

This node will check and store the specified string that is passed through it to make sure it’s unique. If the string hasn’t been seen before, it will pass it on and execute the nodes attached to the output. If the value is not unique, the node will not continue. For example, this is useful if you want to send a message to thank new followers to your Twitch stream but prevent people from spamming unfollow and follow again to trigger the message. To do this, just pass the “user_id” field through this filter and the node will make sure each user is only called once! The filtered data will persist through applet enabling/disabling but can be deleted from within the node using the ‘Clear Data’ button.

  • Value (string) – The data to be checked for uniqueness.

Random Number #

Random Number Node
Random Number

This node will generate a random number when called, and pass this on.

  • Bottom Range (number) – The lowest value that could possibly be generated by the node.
  • Top Range (number) – The highest value that could possibly be generated by the node.

Random Hex colour #

Random Hex Colour Node
Random Hex Colour

This node will generate a random colour in hex format when called, and pass this on. No data is required,

Array Length #

Array Length Node
Array Length

This node will calculate the length of an array (how many items the array currently holds) and output that value.

Takes:

  • Array (array) – The array to calculate the length for.

Returns:

  • {length} (number) – The length of the array (how many items are in the array).

For Loop #

For Loop Node
For Loop

This node will run through an array, and return the index of each item to the nodes connected to the output. For example, if you have an array of 5 items and you wanted to perform logic or actions on each item, you could pass the array into this node and connect whatever outputs you want. Then when called, the For Loop will call the output nodes for every item in the array, and pass the current index to that node. To get the item, pass in the index into the variable like so: {myArray[{index}]}

Takes:

  • Array (array) – The array to loop through.

Returns:

  • {index} (number) – The index of each item

This page will be updated as we add more support for core triggers, actions and functions. If you have any questions please feel to free to contact us here via any method – except maybe carrier pigeon!