Scripting:Installing a Portal

From STNE Wiki

Jump to: navigation, search


Main | Syntax | Operators | Interfaces | FAQ | Contents | API Reference | Index

This tutorial shows you how to use a portal on a ship. For example a Deuterium Tanker Control portal, this does not show you how to install extension scripts like an alliance infobar. The Tutorial assumes you already have the code for a script you want to install.

Saving the script

A portal is basically a script that generates a viewable page. Therefore, you need to have that script available on your account first.

To do so, you first have to create a new script. Go to "Help" -> "Scripting" -> "Script Editor" -> "Create a new script". Select "Custom script without input wizard" and click "Create". The script will be named something along the lines of "Script 187". Not very descriptive, so give it a more appropriate name. I would recommend using the name provided by the original script author. Write a new name and click the little image next to it to save the name.

Now, click "Edit Source". Copy the script you got and paste it all in the field. Then click "Save". If everything went as it should, the script is now be saved.


Note: If you are installing a script from the Script Libary you just go to copy script. This section of the tutorial is for if you only have to code for a portal which is not in the script libary.


Installing the portal on a ship

Now that you have the script available on you account, you have to assign it to one or more ships. Go the the ship you want to set up the portal for. Click "Preferences" -> "Set up a portal" -> "Manage portal"

Now click "Choose web script" and click the image next to the script you just created. You'll be back at the "Manage portal" screen. Type a public announcement. It's not really important, but I recommend typing the name of the script again. Now make sure "Activate portal" is ticked and click "Save".

Step 2 is now done, the portal is set up for this ship. You can repeat this process for as many ships as you like with the same script.

Entering and using the portal

So the portal is set up, now how do you use it? Every portal is different of course, but you always enter them the same way. There are 3 possibilities. Enter the portal trough another ship. There will be a button add.gif on the SRS interaction bar. Shown below is a portion of a SRS report. Three of the shown ships have a portal. The buttons to enter those portals are highlighted. Note that the SRS has to be turned on to see the button.

Space stations have a similar button next to the "dock" or "undock" button. As opposed to option 1, the SRS does not have to be activated to see this button.

You can also enter the portal from the ship itself. To do so, go to the ship's bridge -> preferences -> set up a portal. You will have entered the portal now.

Some portals may take immediate action when you enter the portal, such as the Deuterium Tanker control. Others may present you with an interact-able page, and yet others might simply show information.

Updating portals to newer versions

This is very easy to do if you already completed step 1 once. If you haven't there is no portal to update so you're reading the wrong section. Anyway, to update a portal, all you have to do is overwrite the old script. You will NOT have to reinstall the portal on every ship. So what you need to do is edit the script. That's all. Go to Help -> Scripting -> Script editor. Now click the edit image next to the script you want to update. If you aren't at the source code tab already, click "Source code". Now click "Edit source code" and copy the new code over the old code.

Personal tools