Stargate Interface
- Rotating Stargate functions
- Milky Way Stargate functions
- Pegasus Stargate functions
- Stargate functions
- Iris control
Functions
Unless there is a label with specific interface types displayed, the function can be used by any interface.
If there is a label, the function is only available for the specified interfaces.This also applies to return values. Some return values might be only available for crystal or advanced crystal interface.
Rotating Stargate functions
Functions available for an interface connected to a Stargate that can be rotated – Classic, Universe and Milky Way Stargates.



encodeChevron()
source Encodes the current symbol under the top chevron.
Milky Way stargate requires the chevron to be open, otherwise returns -35 (chevron_not_raised).
Returns
numberThe recent Stargate Feedback[int]string
A description of the feedback
See also
Usage
- Encode chevron
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local feedbackCode, message = interface.encodeChevron() -- The message is not available for basic interface print(feedbackCode, message)
endRotation()
source Stops the inner ring rotation if it was started by a computer.
Does nothing if the ring is rotating due to a redstone signal.
Returns
numberThe recent Stargate Feedback[int]string
A description of the feedback
See also
Usage
- End the ring rotation
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local feedbackCode, message = interface.endRotation() -- The message is not available for basic interface print(feedbackCode, message)
getCurrentSymbol()
source Returns the current symbol under the top chevron. The symbol is allowed to not be exactly centered.
Returns
numberThe symbol under the top chevron or-1(e.g. when no symbol is at the top on the universe Stargate)
See also
Usage
- Print the current symbol
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local symbol = interface.getCurrentSymbol() print(symbol)
getRotation()
source Returns the current Stargate’s ring rotation.
For Classic and Milky Way Stargates:
0 - 155
0when the Point of Origin is centered under the top chevron.
Plus4for each symbol to the right centered under the top chevron,
152for the last symbol (38) centered under the top chevron.For Universe Stargate:
0 - 322
0when the chevron to the left from the Point of Origin is centered at the top,
9when the Point of Origin is centered at the top.
Returns
numberThe current ring rotation based on the Stargate type.
See also
Usage
- Check current ring rotation
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: while true do local rotation = interface.getRotation() print(rotation, "Hold Ctrl+T to stop the loop") sleep(0) end
getRotationDegrees()
source Returns the current Stargate’s ring rotation in degrees.
Returns
numberThe current ring rotation in degrees [0 - 360]
See also
Usage
-- find any interface connected to the computer
local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface")
if interface == nil then
error("The interface is not connected")
end
-- use the interface:
while true do
local rotationDegrees = interface.getRotationDegrees()
print(rotationDegrees, "Hold Ctrl+T to stop the loop")
sleep(0)
end
isCurrentSymbol(symbol)
source Returns true when the current symbol is centered under the top chevron, and it is the desired symbol specified as the parameter. Returns false otherwise.
Parameters
symbol:numberThe desired symbol
Returns
booleanWhether the current symbol is centered under the top chevron and matches the desired symbol.
See also
Usage
- Await the rotation completion
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local symbol = 15 interface.rotateClockwise(symbol) -- wait for the rotation until the desired symbol is reached while not interface.isCurrentSymbol(symbol) do sleep(0) end -- rotation complete print("The current symbol is "..symbol)
rotateAntiClockwise(symbol)
source Rotates the Stargate’s ring anticlockwise, positioning the specified symbol centered under the top chevron.
The method does not block the execution for the whole rotation.
The rotation is stopped when the interface is destroyed.
Parameters
symbol:numberThe desired symbol, or-1for infinite rotation.
Returns
numberThe recent Stargate Feedback[int]string
A description of the feedback
Throws
- When the chevron is open or the symbol is not available on the Stargate.
See also
Usage
- Rotate the ring anticlockwise to the symbol
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local symbol = 15 -- start the rotation interface.rotateAntiClockwise(symbol) -- await the completion while not interface.isCurrentSymbol(symbol) do sleep(0) end -- rotation complete print("The current symbol is "..symbol)
rotateClockwise(symbol)
source Rotates the Stargate’s ring clockwise, positioning the specified symbol centered under the top chevron.
The method does not block the execution for the whole rotation.
The rotation is stopped when the interface is destroyed.
Parameters
symbol:numberThe desired symbol (from0to38inclusive), or-1for infinite rotation
Returns
numberThe recent Stargate Feedback[int]string
A description of the feedback
Throws
- When the chevron is open or the symbol is out of range (lower than
-1or higher than38).
See also
Usage
- Rotate the ring clockwise to the symbol
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local symbol = 15 -- start the rotation interface.rotateClockwise(symbol) -- await the completion while not interface.isCurrentSymbol(symbol) do sleep(0) end -- rotation complete print("The current symbol is "..symbol)
Milky Way Stargate functions
Functions exclusive to Milky Way stargate.

closeChevron()
source Closes the upper chevron if it is open, encoding the current symbol.
If the symbol is already encoded, returns -2 (symbol_in_address).
Returns
numberThe recent Stargate Feedback[int]string
A description of the feedback
See also
Usage
- Close chevron
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local feedbackCode, message = interface.closeChevron() -- The message is not available for basic interface print(feedbackCode, message)
isChevronOpen()
source Returns true when the top chevron is open, false otherwise.
Returns
booleanWhether the top chevron is open
See also
Usage
- Check whether the top chevron is open
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local isOpen = interface.isChevronOpen() if isOpen then print("The chevron is open") else print("The chevron is closed") end
openChevron()
source Opens the top chevron in preparation for encoding the current symbol.
Returns
numberThe recent Stargate Feedback[int]string
A description of the feedback
See also
Usage
- Open the top chevron
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local feedbackCode, message = interface.openChevron() -- The message is not available for basic interface print(feedbackCode, message)
Pegasus Stargate functions
Functions exclusive for an interface connected to a Pegasus Stargate.

dynamicSymbols(enabled)
source Controls the Stargate’s ability to dynamically switch symbols based on its location. The Stargate will keep this value when picked up.
When disabled, the symbols and the Point of Origin used by the Stargate can be overriden.
Parameters
enabled:booleanWhether the Stargate should dynamically change symbols.
See also
Usage
- Disables dynamically changing symbols
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: interface.dynamicSymbols(false)
overrideSymbols(symbols)
source Overrides the symbols used by the Stargate. This change is only a visual effect. The Stargate will reset its symbols based on its location when the chunk is unloaded. To keep the overridden symbols, disable dynamic symbols with dynamicSymbols(false).
All symbol options in the base mod are available on GitHub / data directory. Their textures are available in a different folder. More symbols can be added with datapacks and resourcepacks.
Note that unique symbols for solar systems can be seen only by players with unique_symbols config option enabled. By default, the rendered symbols will fall back to respective symbol set. See Stargate Technology / Stargate / Symbols / Symbols and Symbol sets for explanation.
Parameters
symbols:stringThe resource location of the symbols.
Examples:"sgjourney:galaxy_pegasus","sgjourney:galaxy_milky_way"
See also
Usage
- Overrides symbols to Milky Way galaxy
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: interface.overrideSymbols("sgjourney:galaxy_milky_way")
overridePointOfOrigin(pointOfOrigin)
source Overrides the Point Of Origin used by the Stargate. This change is only a visual effect. The Stargate will reset its Point Of Origin based on its location when the chunk is unloaded. To keep the overridden symbols, disable dynamic symbols with dynamicSymbols(false).
All Point Of Origin options in the base mod (more can be added by datapacks) are available in GitHub / data directory. Their textures are available in a different folder, look for subfolders with points of origins.
Parameters
pointOfOrigin:stringThe resource location of the Point Of Origin. Examples:"sgjourney:terra","sgjourney:tauri","sgjourney:subido"
See also
Usage
- Overrides the Point Of Origin to universal
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: interface.overridePointOfOrigin("sgjourney:universal")
Stargate functions
Functions available for an interface connected to any Stargate.





disconnectStargate()
source Disconnects the Stargate if there is an active connection. The Stargate will be reset if it isn’t connected (encoded chevrons will be deactivated).
The Stargate won’t disconnect/reset if the connection is currently forming (after the final chevron is encoded and before the kawoosh finishes).
Returns
booleantrueif the connection was closed,falseif there was no connection or the Stargate failed to disconnect (e.g. function was called during kawoosh).
See also
Usage
- Disconnect the Stargate
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local result = interface.disconnectStargate() if result then print("Stargate disconnected") else print("Stargate is not open / Can not disconnect") end
engageStargate()
source Confirms the encoded address and instructs the Stargate to initiate the connection. If the address is correct and the Stargate was able to connect to the destination Stargate, a wormhole will be established.
Returns
numberThe recent Stargate Feedback[int]string
A description of the feedback
See also
Usage
The following example encodes an address for Abydos, waits until the Stargate encodes all the symbols and then engages the Stargate with a 3 second delay.
-- find any interface connected to the computer
-- this example requires at least crystal interface to work with engageSymbol method and any Stargate type
local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface")
if interface == nil then
error("The interface is not connected")
end
-- use the interface:
-- encode an address
local address = {26, 6, 14, 31, 11, 29, 0}
local engageDirectly = false
local canEngageStargate = false
for index, symbol in pairs(address) do
print(interface.engageSymbol(symbol, engageDirectly, canEngageStargate))
end
-- requested engaging all symbols waiting for Stargate to finish
while #interface.getDialedAddress() < #address do
sleep(1)
end
-- because canEngageStargate is false, the Stargate will not activate by engaging point of origin
print("Address encoded, sleeping for 3s")
sleep(3)
print("Engaging Stargate now")
local feedbackCode, message = interface.engageStargate()
-- The message is not available for basic interface
print(feedbackCode, message)
getChevronsEngaged()
source Returns a number from 0 to 9 which represents the number of chevrons that are engaged on the Stargate.
Returns
numberThe number of chevrons that have been engaged (0 - 9).
Usage
- Print the number of engaged chevrons
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local engaged = interface.getChevronsEngaged() print("Stargate has "..engaged.."/9 chevrons engaged")
getOpenTime()
source Returns the number of ticks for which the Stargate has been active.
Returns
numberThe number of ticks the Stargate has been active for, returns0if it’s inactive.
See also
Usage
- Print the number of seconds for which the Stargate has been active
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local openTimeInTicks = interface.getOpenTime() -- each second has 20 ticks if the Stargate is not lagging local openTimeInSeconds = math.floor(openTimeInTicks / 20) print("Stargate has been open for "..openTimeInSeconds.." seconds")
getPointOfOrigin()
source Returns a string of the resource location of the Point Of Origin.
Returns
stringThe resource location of the Point Of Origin.
See also
Usage
- Print the Point of Origin
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local PoO = interface.getPointOfOrigin() -- print the Point of Origin print("Stargate has Point of Origin: "..PoO)
getPublicBlacklist()
source 
Returns a table with publicly visible addresses on the blacklist. Only addresses that were added to blacklist as public will be listed. Private blacklist cannot be listed.
Returns
number[][]The table (array) of blacklisted addresses, each address is a table (array) of numbers (symbols).
For example:{ { 1, 2, 3, 4, 5, 6 }, { 8, 7, 6, 5, 4, 3, 2, 1 } }
See also
Usage
- Print public address on blacklist
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local publicBlacklist = interface.getPublicBlacklist() -- Print each address for _,address in pairs(publicBlacklist) do local text = interface.addressToString(address) print(text) end
getPublicWhitelist()
source 
Returns a table with publicly visible addresses on the whitelist. Only addresses that were added to whitelist as public will be listed. Private whitelist cannot be listed.
Returns
number[][]The table (array) of whitelisted addresses, each address is a table (array) of numbers (symbols).
For example:{ { 1, 2, 3, 4, 5, 6 }, { 8, 7, 6, 5, 4, 3, 2, 1 } }
See also
Usage
- Print public addresses on the whitelist
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local publicWhitelist = interface.getPublicWhitelist() -- Print each address for _,address in pairs(publicWhitelist) do local text = interface.addressToString(address) print(text) end
getRecentFeedback()
source Returns information about the Stargate state.
For Crystal interfaces; this also returns a second string value with a status description.
Returns
numberThe most recent Stargate Feedback[int]string
A description of the feedback
See also
- Because the wiki can quickly become outdated,
you can check the feedback codes in the mod source code.
Usage
- Print the recent feedback
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local feedbackCode, feedbackMessage = interface.getRecentFeedback() print("Feedback code: "..feedbackCode) if feedbackMessage then print(feedbackMessage) else print("No description - advanced crystal interface required") end
getStargateEnergy()
source Returns the amount of energy currently stored in the Stargate.
Returns
numberThe energy [FE] stored within the Stargate
See also
Usage
- Print the current amount of energy in the Stargate
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local energy = interface.getStargateEnergy() print("There is "..energy.." FE in the Stargate")
getStargateGeneration()
source Returns the Stargate generation identifier.
0- Classic Stargate
1- Universe Stargate
2- Milky Way Stargate, Tollan Stargate
3- Pegasus
Returns
numberThe generation of the Stargate
See also
Usage
- Print the Stargate generation
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local generation = interface.getStargateGeneration() print("The Stargate is "..generation..". generation")
getStargateType()
source Returns the Minecraft resource identifier for the Stargate.
Returns
stringThe resource identifier of the Stargate
Possible values:sgjourney:classic_stargate
sgjourney:universe_stargate
sgjourney:milky_way_stargate
sgjourney:tollan_stargate
sgjourney:pegasus_stargate
See also
Usage
- Print the Stargate type
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local type = interface.getStargateType() print("The Stargate identifier: "..type)
getStargateVariant()
source Returns the Minecraft resource identifier for the Stargate variant.
Returns
stringThe Stargate variant resource identifier (e.g.sgjourney:milky_way_movie)
orsgjourney:emptyfor the default Stargate variant
See also
Usage
- Print the Stargate variant
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local variant = interface.getStargateVariant() print("The Stargate variant: "..variant)
getSymbols()
source Returns a string of the resource location of the Symbols.
Returns
stringThe resource location of the Symbols, e.g.sgjourney:terra
See also
Usage
- Print the Symbols
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local symbols = interface.getSymbols() -- print the Symbols print("Stargate has Symbols: "..symbols)
isStargateConnected()
source Check whether the Stargate is connected to another Stargate.
The function returns true even before kawoosh.
The Stargate is connected when it establishes a connection.
Once the Point of Origin is successfully encoded or the first chevron is being locked for an incoming connection.
Returns
booleanWhether the Stargate has an active connection
See also
Usage
- Check whether the Stargate is connected
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local isConnected = interface.isStargateConnected() if isConnected then print("Stargate is connected") else print("Stargate is not connected") end
isStargateDialingOut()
source Returns true when there is an active outgoing connection (this Stargate dialed the other Stargate).
Returns
booleanWhether the Stargate is currently connected and the connection is outgoing. Returnsfalseotherwise (the Stargate is not connected or the connection is incoming).
See also
Usage
- Check whether the active connection is outgoing
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local isDialingOut = interface.isStargateDialingOut() if isDialingOut then print("Stargate is dialing out") else print("The connection is incoming, or the Stargate is not active") end
isWormholeOpen()
source Returns true if there is an active wormhole, after the kawoosh finishes, and it is safe to enter the wormhole, false otherwise.
Returns
booleanWhether the wormhole has formed
See also
Usage
- Check whether the wormhole has formed
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local isOpen = interface.isWormholeOpen() if isOpen then print("Wormhole is open") else print("Wormhole is not open") end - Check whether the wormhole is active and it is safe to enter
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: -- assuming the config uses default values (the reverse wormhole kills) local isConnected = interface.isStargateConnected() local isOpen = interface.isWormholeOpen() local isOutgoing = interface.isStargateDialingOut() if not isConnected then print("The Stargate is not connected") elseif not isOpen then -- The Stargate is connected, but the wormhole has not yet formed. print("The wormhole is forming") elseif isOutgoing then print("The wormhole is safe to enter") else print("The connection is incoming, do not enter the wormhole!") end
sendStargateMessage(message)
source Sends the message through the current Stargate connection, which can be received by a computer on the other side as an event stargate_message_received.
Basic and Crystal interfaces can only send messages after the wormhole has fully formed (isWormholeOpen returns true).
The Advanced Crystal interface can send a message once the Stargate is connected (isStargateConnected returns true).
Any interface can receive the message.
Parameters
message:stringThe message to send
Returns
booleanWhether the message was sent successfully
See also
Usage
- Send a message
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local message = "Hello from the other side" local wasSent = interface.sendStargateMessage(message) if wasSent then print("Message sent successfully") else print("The message could not be sent") end - Receive a message from the Stargate
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local message = os.pullEvent("stargate_message_received") print("Received a message from the Stargate:") print(message)
engageSymbol(symbol, engageDirectly, canEngageStargate)
source 

Directly encodes the symbol. This method can encode symbols on any Stargate.
Using this method matches dialing with DHD.
For example, the Milky Way Stargate does not need to spin the ring; it just encodes chevrons directly.
Parameters
symbol:numberA symbol to encode. The symbol must be in a supported range by the Stargate type.engageDirectly:boolean(Optional, default:false) Whether to engage the symbol directly. Skips the rotation on Pegasus or Universe Stargates.canEngageStargate:boolean(Optional, default:true) Whether engaging the symbol can engage the Stargate and initiate a new connection.
Returns
numberThe recent Stargate Feedback[int]string
A description of the feedback
See also
Usage
- Dial the address
-- find crystal or advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local address = { 26, 6, 14, 31, 11, 29, 0 } -- Abydos -- don't forgot the zero (Point of Origin) at the end! for _, symbol in pairs(address) do interface.engageSymbol(symbol) sleep(1) end
getDialedAddress()
source 

Returns the address dialed by the Stargate.
If the currently active connection is incoming or there is no active connection, the address will be empty.
Returns
number[]: The dialed address
See also
Usage
- Print the dialed address
-- find crystal or advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local address = interface.getDialedAddress() print("The dialed address: " .. interface.addressToString(address))
getMappedSymbol(symbol)
source 

Returns the mapped symbol for the given symbol. If the symbol was not mapped, returns the same symbol.
Parameters
symbol:numberThe symbol to lookup.
Returns
number: The mapped symbol, or the requested symbol if not mapped.
See also
Usage
-- find crystal or advanced crystal interface connected to the computer
local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface")
if interface == nil then
error("The interface is not connected")
end
-- use the interface:
local symbol = 1
local mappedSymbol = interface.getMappedSymbol(symbol)
if symbol == mappedSymbol then
print("Symbol "..symbol.." is not mapped")
else
print("Symbol "..symbol.." is mapped to "..mappedSymbol)
end
hasDHD()
source 

Checks whether there is a DHD connected to the Stargate.
Returns
boolean:trueif there is a DHD connected to the Stargate,falseotherwise.
Usage
-- find crystal or advanced crystal interface connected to the computer
local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface")
if interface == nil then
error("The interface is not connected")
end
-- use the interface:
-- TODO: example usage
local hasDHD = interface.hasDHD()
print(hasDHD)
remapSymbol(originalSymbol, newSymbol)
source 

Remaps a symbol so that the newSymbol is represented by the originalSymbol.
After mapping, encoding originalSymbol physically encodes originalSymbol on the Stargate, but adds the newSymbol to the dialed address.
The point of origin (symbol 0) cannot be used in remapping.
originalSymbol → newSymbol
Parameters
originalSymbol:numberThe original symbol that will represent thenewSymbol.
Must not be0or symbol already physically encoded on the Stargate.newSymbol:numberThe new symbol that will be added to the dialed address instead of theoriginalSymbol
Must not be0or symbol already in the dialed address.
Returns
boolean:trueif the symbol was remapped successfully,falseotherwise.
See also
Usage
-- find crystal or advanced crystal interface connected to the computer
local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface")
if interface == nil then
error("The interface is not connected")
end
-- use the interface:
local originalSymbol = 1
local newSymbol = 38
interface.remapSymbol(originalSymbol, newSymbol)
interface.engageSymbol(originalSymbol)
-- original symbol physically encoded on the Stargate
local address = interface.getDialedAddress()
print(interface.addressToString(address))
-- newSymbol was appended to the address
setChevronConfiguration(configuration)
source 

Causes the chevrons to encode in the order specified by configuration. This configuration resets every time a Stargate is reset.
Parameters
configuration:number[]An array of length 8 representing the order of chevrons.
Possible chevron numbers are1, 2, 3, 4, 5, 6, 7, 8. The top chevron is always encoded as the last one, this can’t be changed.
Chevron numbers

Returns
stringThe message"Chevron configuration set successfully"
Throws
- When specified configuration is invalid. The configuration must be an array of exact length 8 with numbers from 1 to 8 without duplicates.
See also
- disconnectStargate Resets the Stargate
Usage
- Set the default chevron order
-- find crystal or advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: interface.setChevronConfiguration({1, 2, 3, 6, 7, 8, 4, 5}) - Set clockwise chevron order (e.g. when encoding 9-chevron address).
-- find crystal or advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: interface.setChevronConfiguration({1, 2, 3, 4, 5, 6, 7, 8})
addNetwork(network)
source 

Adds the Stargate to the given network.
Parameters
network:numberThe number of the network to which the Stargate should be added.
Returns
boolean:trueif the Stargate was added to the network and wasn’t in it already,falseotherwise.
See also
Usage
-- find an advanced crystal interface connected to the computer
local interface = peripheral.find("advanced_crystal_interface")
if interface == nil then
error("The interface is not connected")
end
-- use the interface:
local network = 415252 -- could be any number
local added = interface.addNetwork(network)
if added then
print("Stargate was added to network "..network)
else
print("Failed to add Stargate to network")
end
addToBlacklist(address, isPublic)
source 
Adds the address to the blacklist. When the filter is set to the blacklist type, the Stargate will not be able to form a connection with the address on the blacklist. That being said, the Stargate can’t dial the address or accept a connection from the blacklisted address.
The added address can be either private or public. By default, the address is added as private. Private addresses cannot be listed, but they are still being blacklisted and can be removed with removeFromBlacklist(address). If an address is already listed and an attempt to add it again is made, with a different visibility, the specified visibility is applied and updated in the blacklist. The method returns false in such case, since the address was already on the blacklist.
Blacklisting a 9-chevron address will block all 9-chevron address connections from/to that specific Stargate. However, a connection using a 7/8-chevron address could still be made from/to the Stargate with a blacklisted 9-chevron address. Similarly, blacklisting a 7/8-chevron address will block all 7/8-chevron connections from/to the Stargate. However, it will not block 9-chevron connections from/to such Stargates.
Parameters
address:number[]The 7, 8 or 9-chevron address to be added to the blacklist (without the trailing zero - Point of Origin).isPublic:boolean(Optional, default:false) Whether the address should be added as public. The public blacklist contents are accessible with getPublicBlacklist(). The contents of the private blacklist cannot be listed.
Returns
boolean:trueif the address was added to the blacklist and was not present before,falseif the address was already on the blacklist.
Throws
- When the specified address is invalid (the only allowed lengths are 6, 7 and 8).
See also
Usage
- Blacklist a 9-chevron address
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local address = { 16, 25, 4, 21, 6, 19, 33, 22 } interface.clearBlacklist() interface.setFilterType(-1) -- set filter to blacklist mode interface.addToBlacklist(address) -- now the Stargate will not be able to dial the specified address -- or accept a 9-chevron connection from the other Stargate.
addToWhitelist(address, isPublic)
source 
Adds the address to the whitelist. When the filter is set to the whitelist type, the Stargate will not be able to form a connection with the address that is not on the whitelist. That being said, the Stargate can’t dial the address or accept a connection from an address that is not on the whitelist.
The added address can be either private or public. By default, the address is added as private. Private addresses cannot be listed, but they are still being whitelisted and can be removed with removeFromWhitelist(address). If an address is already listed and an attempt to add it again is made, with a different visibility, the specified visibility is applied and updated in the whitelist. The method returns false since the address was already on the whitelist.
Whitelisting a 9-chevron address will allow all 9-chevron address connections from/to that specific Stargate. However, a connection using a 7/8-chevron address will not be possible from/to the Stargate with a blacklisted 9-chevron address. Similarly, whitelisting a 7/8-chevron address will allow all 7/8-chevron connections from/to the Stargate. However, it will not allow 9-chevron connections from/to such Stargates.
Parameters
address:number[]The 7, 8 or 9-chevron address to be added to the whitelist.isPublic:boolean(Optional, default:false) Whether the address should be added to the public whitelist.
Returns
boolean:trueif the address was added to the whitelist and was not present before,falseif the address was already on the whitelist.
Throws
- When the specified address is invalid (the only allowed lengths are 6, 7 and 8).
See also
Usage
- Whitelist the Abydos 7-chevron address
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local address = { 26, 6, 14, 31, 11, 29 } interface.clearWhitelist() interface.setFilterType(1) -- set filter to whitelist mode interface.addToWhitelist(address) -- now the Stargate can only estabilish a connection with a Stargate -- on Abydos using the 7-chevron address -- all 8-chevron and 9-chevron connections are blocked -- including such connections with Stargates on Abydos -- only 7-chevron connection from/to Abydos is possible
clearBlacklist()
source 
Removes all addresses from the blacklist. Including all public and all private addresses.
Returns
string: A message"Blacklist cleared"source
See also
Usage
- Remove all addresses from the blacklist
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: interface.clearBlacklist() -- blacklist is now empty
clearWhitelist()
source 
Removes all addresses from the whitelist. Including all public and all private addresses.
Returns
string: A message"Whitelist cleared"source.
See also
Usage
- Remove all addresses from the whitelist
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: interface.clearWhitelist() -- whitelist is now empty
getConnectedAddress()
source 
Returns the address to which the Stargate is connected (the address on the other side of the connection).
Returns
number[]: The remote 7, 8 or 9-chevron address of the connection
The address is partially filled when a connection is forming and the Stargate is locking the chevrons for an incoming connection.
To ensure the address has full length, the
isWormholeOpen()must return true.For an outgoing connection, the address is always either empty or full-length.
See also
Usage
- Print the remote address
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: if interface.isWormholeOpen() then local address = interface.getConnectedAddress() print("The remote address is "..interface.addressToString(address)) else print("Wormhole not formed") end
getFilterType()
source 
Returns the numeric identifier of the filter type.
0 None
1 Whitelist
-1 Blacklist
Returns
number: The filter type identifier
See also
Usage
- Print the current filter type
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local type = interface.getFilterType() if type == 0 then print("Filter is disabled") elseif type == 1 then print("Filter is in whitelist mode") elseif type == -1 then print("Filter is in blacklist mode") end
getLocalAddress()
source
Returns the 9-chevron address of this (local) Stargate.
Returns
number[]: The 9-chevron address
See also
Usage
- Print the local address
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local localAddress = interface.getLocalAddress() print(interface.addressToString(localAddress))
getNetworks()
source 

Returns the list of networks to which the Stargate has been assigned.
Returns
number[]The list of Stargate’s networks
See also
Usage
-- find an advanced crystal interface connected to the computer
local interface = peripheral.find("advanced_crystal_interface")
if interface == nil then
error("The interface is not connected")
end
-- use the interface:
-- TODO: example usage
local networks = interface.getNetworks()
for _,network in pairs(networks) do
print(network)
end
isNetworkRestricted()
source 

Checks for the network restrictions of the Stargate.
Returns
boolean: Whether are the network restrictions active
See also
Usage
- Print whether the Stargate is network restricted
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local isRestricted = interface.isNetworkRestricted() if isRestricted then print("Network restriction is active") else print("Network restriction is not active") end
removeFromBlacklist(address)
source 
Removes the specified address from the blacklist.
Parameters
address:number[]The address to remove from blacklist
Returns
boolean:trueif the address was on blacklist and was successfully removed,falseotherwise.
Throws
- When the specified address is invalid.
See also
Usage
- Remove the address from the blacklist
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local address = { 16, 25, 4, 21, 6, 19, 33, 22 } interface.removeFromBlacklist(address)
removeFromWhitelist(address)
source 
Removes the specified address from the whitelist.
Parameters
address:number[]The address to remove from whitelist
Returns
boolean:trueif the address was on whitelist and was successfully removed,falseotherwise.
Throws
- When the specified address is invalid.
See also
Usage
-- find an advanced crystal interface connected to the computer
local interface = peripheral.find("advanced_crystal_interface")
if interface == nil then
error("The interface is not connected")
end
-- use the interface:
local address = { 26, 6, 14, 31, 11, 29 }
interface.removeFromWhitelist(address)
removeNetwork(network)
source 
Removes the Stargate from the given network.
Each Stargate has its default network based on its generation. If the Stargate is not in any other network, it is always in its default network from which it can not be removed.
Parameters
network:numberThe network from which the Stargate should be removed.
Returns
boolean:trueif the Stargate was in the network and was successfully removed,falseotherwise.
See also
Usage
-- find an advanced crystal interface connected to the computer
local interface = peripheral.find("advanced_crystal_interface")
if interface == nil then
error("The interface is not connected")
end
-- use the interface:
local network = 415252 -- could be any number
interface.removeNetwork(network)
restrictNetwork(restrict)
source 
Sets the status of Network Restrictions of the Stargate.
Parameters
restrict:numberWhether the network restriction should be enabled, disabled or respect the DHD.number < 0Network restrictions will be disabled
number = 0Network restrictions will respect the DHD
number > 0Network restrictions will be enabled
See also
Usage
- Enable network restriction
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: interface.restrictNetwork(1)
setFilterType(type)
source
Sets the filter type for the Stargate.
Only one filter type can be active, either whitelist, or blacklist (or none to disable the filter).
Parameters
type:numberThe identifier of the filter type0 None
1 Whitelist
-1 Blacklist
Returns
number: the filter type identifier that was set
See also
Usage
- Set the filter type to blacklist
-- find an advanced crystal interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local FilterType = { None = 0, Whitelist = 1, Blacklist = -1 } interface.setFilterType(FilterType.Blacklist)
Iris control
Iris related methods are available even when the Stargate does not have an iris installed. However, they are not available for the Tollan Stargate which can’t have an iris.

getIris()
source Retrieves the identifier of the currently installed iris on the Stargate.
Returns
string: The identifier of the iris (e.g.sgjourney:naquadah_alloy_iris)
Returnsnilif there is no iris installed
Usage
- Check the installed iris
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local iris = interface.getIris() if iris then print("The Stargate has an iris installed: "..iris) else print("The Stargate does not have an iris installed") end
closeIris()
source Instruct the Iris to start closing. The function does not wait for the iris to close.
Returns
boolean:falsewhen the iris is already being closed (in motion) by a computer,trueotherwise.trueif no iris is installed on the Stargate.
See also
Usage
- Close the iris
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local closing = interface.closeIris() if closing then print("Closing the iris...") else print("The iris is already being closed by a computer...") end
openIris()
source Instruct the Iris to start opening. The function does not wait for the iris to open.
Returns
boolean:falsewhen the iris is already being opened (in motion) by a computer,trueotherwise.trueif no iris is installed on the Stargate.
See also
Usage
- Open the iris
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local opening = interface.openIris() if opening then print("Opening the iris...") else print("The iris is already being opened by a computer...") end
stopIris()
source Instruct the Iris to stop. The function does not wait for the iris to stop.
Returns
boolean:falsewhen the iris is already being stopped by a computer,trueotherwise.trueif no iris is installed on the Stargate.
See also
Usage
- Stop the iris
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local stopped = interface.stopIris() if stopped then print("Stopped the iris...") else print("The iris is already being stopped by a computer...") end
getIrisProgress()
source Retrieves the internal iris closing progress.
This progress is internally used for blocking the Stargate by the iris.
Returns
number: The internal iris closing progress
0when the iris is fully opened or not installed on the Stargate
58when the iris is fully closed.
See also
getIrisProgressPercentage()
source Retrieves the percentage of the iris closing progress.
Returns
number: The percentage (decimal) of the iris closing progress
0when the iris is fully opened or not installed on the Stargate
100when the iris is fully closed
See also
Usage
- Get the iris closing percentage
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local progress = interface.getIrisProgressPercentage() if progress == 0 then print("Iris is open") elseif progress == 100 then print("The iris is fully closed") else print("The iris is "..math.floor(progress).."% closed") end
getIrisDurability()
source Retrieves the iris’ remaining durability.
Returns
number: The remaining durability of the iris
See also
Usage
- Get the iris durability
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local durability = interface.getIrisDurability() local maxDurability = interface.getIrisMaxDurability() print("The iris durability: "..durability.."/"..maxDurability.." "..math.floor(durability/maxDurability*100).."%")
getIrisMaxDurability()
source Retrieves the iris’ maximum durability.
Returns
number: The maximum iris durability
See also
Usage
- Get the iris durability
-- find any interface connected to the computer local interface = peripheral.find("advanced_crystal_interface") or peripheral.find("crystal_interface") or peripheral.find("basic_interface") if interface == nil then error("The interface is not connected") end -- use the interface: local durability = interface.getIrisDurability() local maxDurability = interface.getIrisMaxDurability() print("The iris durability: "..durability.."/"..maxDurability.." "..math.floor(durability/maxDurability*100).."%")