SilverIO

A tool that communicates with a tech mod to bring a new way to interact with your game.

Built for .NET Framework 4.5!

Installation

Unsafe scripts

Before running the mod, unsafe scripts have to be allowed in the starbound.config file. This is to allow interaction with third party applications through writing to and reading files. You can find this file in the storage folder for your current version of the game (eg. giraffe_storage).
Set the value of the property safeScripts in this configuration file to false:

"safeScripts" : false,

You may need to repeat this process every update.

Stand-alone

You don't have any other blink tech mods installed? Great!
Install the downloaded mod by dragging the folder SilverIO from the downloaded file into your mods folder. You can confirm the mod is loaded by looking at the asset sources in the bottom right of the title screen. If you had a previous version of the mod installed, it is recommended to first delete this version before updating.
Next, locate the silverIO.lua file (in ../SilverIO/tech/blink/), and open the file in a text editor.

Combined

Already have a blink tech mod installed? No worries, you can most likely combine the mods!
First, install the mod like described above. After that, locate the blink.lua file of your other blink mod and open it. You'll have to insert the following pieces of code at the given locations.

At the very top:
require "/tech/blink/silverIO.lua"
Inside function init():
silverIO.init()
Inside function uninit():
silverIO.uninit()
Inside function input(args), before other code:
silverIO.input(args)
Inside function update(args), before other code:
silverIO.update(args)

After this is done, you can remove the blink.lua file included with this mod, and check if the mod loads without issues.

Controller

Next, it's time to see if you can run the controller application. The controller is used to tell the tech what it should be doing. Since the controller comes packed with the mod, you should be able to find it in ../SilverIO/Controller/.
Shortly after running the application, it should show up in the bottom right corner of your screen. If it does not, make sure you have .NET Framework 4.5 installed on your computer.

Controller Interface

Setting up this tool (other than adding actions, described in another chapter), requires two paths being set. Select the three dots on the main window of the application, which opens the configuration window.
Set the action config file and action write file by selecting the corresponding option. Make sure you read the warning messages, as you get the option to load, overwrite or forget the file paths.

Configuration Window

Action Config File: Used to save the configured data of the application. The default file (controller.config) can be found in the same folder as the controller.
Action Write File: Used to tell the tech script what to do. The default file (actions.txt) can be found in the SilverIO mod folder. This file matches the 'filePath' as defined in silverIO.lua.

Usage

Settting up the mod is the most difficult or most time consuming task. Using the mod on the other hand, is very simple.
With both the game and the controller running, simply select a function in the controller to execute it. Make sure you've actually got the blink tech active on your character, though!
If the included functions don't work, check if you've set the mod up correctly. If they do, you'll most likely want to check out the chapter on adding features.

Configuration Window

Adding Features

Adding features is done in two steps. First, you have to define a function in the tech script. After that, you have to bind the function in the controller. Both steps will be described below.

Script

Locate the silverIO.lua file (in ../SilverIO/tech/blink/), and open the file in a text editor. Look for 'Additional functions' (ctrl+f), and write your own function below this comment. There's no need to put the function in this specific place, but I recommend keeping all custom functions in one place.
To make the function recognizable, add 'silverIO.' in front of of the name of the function:

function silverIO.test()

Reserved functions, which should not be used, are: init, input, update, clearActionFile, readFile, uninit, writeTempFile, runCode, logInfo, spawnItem, textParticle, setUpdateTicks, offsetTeleport, setRotation.

You may define parameters for your function, but it is recommended to set default values. Assigning values to these parameters in the controller is explained in the next paragraph.

Example

In the example below, we can see that the parameter degrees is being set to the given value. This allows direct calls to the function.
If no value is given directly to the function, the actionParameters are checked. This value is set by the controller. If the actionParameters value matches the expected type (in this case a number), that value will be used.
If there's no parameter given and no valid actionParameters present, the default value will be used (in this case zero).

function silverIO.setRotation(degrees)
  // The line below allows direct function calls and calls from the controller, but also ensures that a default value is set.
  degrees = degrees or type(silverIO.actionParameters) == "number" and silverIO.actionParameters or 0

  mcontroller.setRotation(math.rad(degrees))
end

Controller

Now that you've set up your function in the script, it's time to bind it in the controller. Open the controller, and select the three dots on the left side of the application. This will open the configuration window.
Add the following in the text fields at the bottom of the window, then select 'Add' to add the function to the main window.

Name
The name that will be displayed in the controller. Can be any value.
Action
The name of the fuction, without the 'silverIO.' part. Do not include the brackets or parameters '(args)'.
Parameter
The parameters for your action. Should be a valid Lua value.

Number:
5
String:
"value"
Table:
{ name = "Silver", score = 20 }
Add Feature

Additional Features

Importing Items

Please note that the controller only checks if your selected file is formatted correctly, and not if you've selected a valid item that Starbound knows of.

To import an item file, select the plus symbol on the left side of the controller. This will prompt you to select an item file. After selecting a valid file, it will spawn automatically in-game (granted you have the script and controller set up properly, and have selected a valid item file).
This feature works best using StarCheat exports.

Directly Running Code

By selecting the forward slash icon, you can enter and execute pieces of code directly from the controller.
Here, you have access to all tables available in the blink tech (tech, mcontroller, entity, etc.). Keep in mind that just like modifying scripts, a syntax error will crash your game!
Code you want to run should be entered directly in the text field, and not inside a function.

Code Window