in my current program to see what would get printed (not in the native program lua) and it returned this:
The following is stated from the mod wiki on this specific command:
getEnergyRequiredToDial(symbols... or symbols:array)Gets the energy required to dial specified gate.From Aunis 1.9.6. Parameters: symbols...Symbols as subsequent parameters, symbols:arraySymbols as an array. Point of Origin is added automatically if not present Returns: not_mergedGate's not merged (duh), or address_malformed(No such gate, address contains less than 7 symbols), or energyMapMap (aka array in Lua) with 3 indexes: [open(open cost, in RF),keepAlive(sustain cost, in RF/t),canOpen(if the stored power is enough to open the wormhole, boolean)]
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Long story short i have no idea how to properly pull values from components
component:
component.stargate.getEnergyRequiredToDial(address)
This component is from another mod, but i just need to learn the principle to pull certain values.
Im trying to pull the boolean value (canOpen) and the value open from the return energyMap
When running the component command in lua i get in return:
{canOpen=true, keepAlive=11886, open=27386566}
As you can see it returns 3 values.
Now i want to run this same component command but only get the canOpen boolean in return
And another command that only gets the open value in return, nothing else.
I also run
print(component.stargate.getEnergyRequiredToDial(address))
in my current program to see what would get printed (not in the native program lua) and it returned this:
The following is stated from the mod wiki on this specific command:
getEnergyRequiredToDial(symbols... or symbols:array)
Gets the energy required to dial specified gate. From Aunis 1.9.6.Parameters:
symbols...
Symbols as subsequent parameters,symbols:array
Symbols as an array.Point of Origin is added automatically if not present
Returns:
not_merged
Gate's not merged (duh), oraddress_malformed
(No such gate, address contains less than 7 symbols), orenergyMap
Map (aka array in Lua) with 3 indexes: [open
(open cost, in RF),keepAlive
(sustain cost, in RF/t),canOpen
(if the stored power is enough to open the wormhole, boolean)]Link to post
Share on other sites