I am working on having a single script that both refuels vessels tanks that dock to my carrier but also refills predefined reserve container on the docked vessels as well. I keep getting Reached end of template before the expression was closed. Can someone help? EDIT: I think I solved my problem, I believe it wasn't recalling the RST-FillRes amounts. I am no longer getting any kind of a error but the script only fills tanks. It wont transfer any items to the docked ships, any suggestions? Code updated. Code: <align=center><color=yellow><size=4>{{!Auto Fuel}}</size></color> <size=60%><color=#444444>{{!Docked}}</size></align> <size=30%><color=white> {{#getswitch @root.E.S 'RST-AutoFuelDocked'}} {{#if SwitchState}} {{!Tanks}} {{~set 'IDs' '4421,4342,4176,4177,4314,4335'}} {{~#each @root.E.S.DockedE}} {{#if S.IsPowerd}} {{else}} {{#items @root.E.S 'RSTCE1*'}} {{~#math (configattr Id 'StackSize') '/' 500}} {{~set 'Stacks' (int (max 100 .))}} {{~/math}} {{~#test Count ge @root.Data.Stacks}} {{~#test Id in @root.Data.IDs}} {{~#fill ../this ../../../S 'Oxygen' 100}}{{/fill}} {{~#fill ../this ../../../S 'Fuel' 100}}{{/fill}} {{~#fill ../this ../../../S 'Pentaxid' 100}}{{/fill}} {{~/test}} {{/test}} {{/items}} {{!Reserves}} {{~set 'RST-FillRes-Fuel' 25}} {{~set 'RST-FillRes-Oxygen' 25}} {{~set 'RST-FillRes-Pentaxid' 125}} {{~set 'LimitToType' 'CV'}} {{~#test EntityType in @root.Data.LimitToType}} {{~set 'RST-FillRes-Fuel' 200}} {{~set 'RST-FillRes-Oxygen' 200}} {{~set 'RST-FillRes-Pentaxid' 1000}} {{/test}} {{~#items @root.E.S 'RSTCE1*'}} {{~#test Id in '4421'}} {{~#test Count ge @root.Data.RST-FillRes-Fuel}} {{~#move ../this ../../../S '*CE11-[1AA5DD][c]Fuel' @root.Data.RST-FillRes-Fuel}} {{/move}} {{/test}} {{/test}} {{~#test Id in '4176'}} {{~#test Count ge @root.Data.RST-FillRes-Oxygen}} {{~#move ../this ../../../S '*CE12-[2EE8DE][c]Oxygen' @root.Data.RST-FillRes-Oxygen}} {{/move}} {{/test}} {{/test}} {{~#test Id in '4342'}} {{~#test Count ge @root.Data.RST-FillRes-Pentaxid}} {{~#move ../this ../../../S '*CE13-[FF33C2][c]Pentaxid' @root.Data.RST-FillRes-Pentaxid}} {{/move}} {{/test}} {{/test}} {{/items}} {{/if}} {{/each}} {{/if}} {{/getswitch}} </size>
I was able to finally figure out how to transfer items from my carrier to docked vessels. My new issue is that because my reserve containers are different sizes depending on the ship some of them will fill while others wont. I have figured out that if the container doesnt have enough room for the amount set it wont transfer any items. Is it possible to have it transfer as many items as it can fit up to a maximum amount? Code: <align=center><color=yellow><size=4>{{!Auto Fuel}}</size></color> <size=60%><color=#444444>{{!Docked}}</size></align> <size=30%><color=white> {{#getswitch @root.E.S 'RST-AutoFuelDocked'}} {{#if SwitchState}} {{!Tanks}} {{~set 'IDs' '4421,4342,4176,4177,4314,4335'}} {{~#each @root.E.S.DockedE}} {{#if S.IsPowerd}} {{else}} {{#items @root.E.S 'RSTCE1*'}} {{~#math (configattr Id 'StackSize') '/' 500}} {{~set 'Stacks' (int (max 100 .))}} {{~/math}} {{~#test Count ge @root.Data.Stacks}} {{~#test Id in @root.Data.IDs}} {{~#fill ../this ../../../S 'Oxygen' 100}}{{/fill}} {{~#fill ../this ../../../S 'Fuel' 100}}{{/fill}} {{~#fill ../this ../../../S 'Pentaxid' 100}}{{/fill}} {{~/test}} {{/test}} {{/items}} {{!Reserves}} {{~set 'RST-FillRes-Fuel' 200}} {{~set 'RST-FillRes-Oxygen' 200}} {{~set 'RST-FillRes-Pentaxid' 1000}} {{~#items @root.E.S 'RSTCE1*'}} {{~#test Id in '4421'}} {{~#test Count ge 400}} {{~#move . ../../../S '*CE11-[1AA5DD][c]Fuel' @root.Data.RST-FillRes-Fuel}} {{/move}} {{/test}} {{/test}} {{~#test Id in '4176'}} {{~#test Count ge 500}} {{~#move . ../../../S '*CE12-[2EE8DE][c]Oxygen' @root.Data.RST-FillRes-Oxygen}} {{/move}} {{/test}} {{/test}} {{~#test Id in '4342'}} {{~#test Count ge 500}} {{~#move . ../../../S '*CE13-[FF33C2][c]Pentaxid' @root.Data.RST-FillRes-Pentaxid}} {{/move}} {{/test}} {{/test}} {{/items}} {{/if}} {{/each}} {{/if}} {{/getswitch}} </size>
So we have a server using the scripts. I was wondering if there is a way to use the scripts without it requiring credits to work. Specifically the recycle script. Unless you put credits in the container it doesn't do anything.
I have a good bit of credits to give you for the scripts. I also created a Faction Bank with a few Mil in there.
If you are the admin, just edit the Mods\EmpyrionScripting\Configuration.json within the save folder. Change DeconstructSalary and RecycleSalary Amounts to 0, and it's back to the way it was.
Release added ToId & ToName · GitHub-TC/EmpyrionScripting 13.3.1 https://github.com/GitHub-TC/EmpyrionScripting/releases/download/13.3.1/EmpyrionScripting.zip Added "toid" and "toname" functions. (C# CsRoot.ToId(string) & CsRoot.ToName(string))
@ASTIC I am using a modified version of the ore/ingot/components display. Is there a way to get the script to sort the items in the order they are given instead of always changing to ascending? For example in this code I have Graphite (4292) at the end of the IDs but it always shows it first. Note: I do realize the section sortedeach is set to ids, but even when I take that section of the code out I noticed that the script always seems to sort by id number ascending by default. Left it in because if there is a chance of sorting the way I am asking I figured I would need it left in. Code: {{~set 'H' 'Ores'}} {{~set 'T' '4000'}} {{~#split '#15FC05,#8FF904,#F4DC04,#F99C04,#FC6305,#CE1818' ','}}{{set 'C' .}}{{/split}} {{~set 'IDs' '4296-4302,4317-4318,4328,4332,4338,4345,4359,4362,4365,7300,7342,7344,4358,4292,'}} {{~#split @root.ScriptId ':'}} {{~#devices @root.E.S .1}} {{~#split (substring (i18n .0/Id 'English') 4) ' '}}{{set 'SS' .0}}{{/split}} {{~/devices}} {{~/split}} {{~concat '<color=#FFF><align=center><size=200%>' @root.Data.H '</size></align>'}} <align=center>{{bar 1 0 1 45 '═'}}</align> {{#sortedeach @root.E.S.Items 'Id' false}}{{~#test Id in @root.Data.IDs}}{{set 'X' (concat @root.Data.X Id ',')}}{{setblock 'D' ~}} {{@root.Data.D}}{{i18n Id}}:{{format Count '{0,6:N0}'}}: {{~#test Count geq @root.Data.T}}{{@root.Data.C.0}}{{else}} {{~#test Count ge (calc @root.Data.T '*' '0.75')}}{{@root.Data.C.1}}{{else}} {{~#test Count ge (calc @root.Data.T '*' '0.50')}}{{@root.Data.C.2}}{{else}} {{~#test Count ge (calc @root.Data.T '*' '0.25')}}{{@root.Data.C.3}}{{else}}{{@root.Data.C.4}}{{/test}}{{/test}}{{/test}}{{/test}};{{~/setblock}} {{~/test}}{{~/sortedeach}} {{~#itemlist @root.E.S.Items @root.Data.IDs}}{{#test Id in @root.Data.X}}{{else}}{{set 'D' (concat @root.Data.D (i18n Id) ':' (format 0 '{0,6:N0}') ':' @root.Data.C.5 ';')}}{{/test}}{{/itemlist}} {{~#split @root.Data.D ';' true}}{{#each .}}{{#split . ':'}} {{~#test @root.Data.SS eq '1x2'}}{{~fontsize 6}}{{~#test (calc @Index '%' 3) eq 2}}{{set 'P' '67,90'}}1x2A{{else}}{{~#test (calc @Index '%' 3) eq 1}}{{set 'P' '32,56'}}1x2B{{else}} {{set 'P' '0,20'}}1x2C{{/test}}{{/test}}{{else}} {{~#test @root.Data.SS eq '1x1'}}{{~fontsize 4}}{{~#test (calc @Index '%' 2) eq 1}}{{set 'P' '52,85'}}1x1A{{else}} {{set 'P' '0,34'}}1x1B{{/test}}{{else}}{{fontsize 3}} {{set 'P' '8,74'}}{{/test}}{{/test}} {{~#split @root.Data.P ','}}{{~concat '<color=' ../.2 '><indent=' .0 '%>◉ ' ../.0 '</indent> <indent=' .1 '%>' ../.1 '</indent></color>' ~}}{{/split}} {{~/split}}{{~/each}}{{~/split}}
13.3.2 https://github.com/GitHub-TC/EmpyrionScripting/releases/download/13.3.2/EmpyrionScripting.zip @BloodAngel099 added 'orderbylist'