GitHub-TC / EmpyrionScripting

Displays various informations directly and live on LCD screens and will support conveyor and construction control
GNU General Public License v3.0
34 stars 5 forks source link

Add devicecontents as a workaround for containers with no custom name. #21

Closed antihax closed 11 months ago

antihax commented 1 year ago

Add devicecontents HandlebarTag as a means to get the inventory of all devices including ones which do not have CustomName set. Resolves #20

i.e.

{{#devicesoftype @root.E.S 'Container;Fridge;HarvestCntr;AmmoCntr;WarpDriveTank'}}
{{#each .}}
{{#devicecontents .}}
{{Name}}{{move . @root.E.S 'sort'}}{{/move}}
{{/devicecontents}}
{{/each}}
{{/devicesoftype}}

image

antihax commented 1 year ago

Fixed spacing inconsistencies from tabs/spaces...

GitHub-TC commented 11 months ago

Without "CustomName" many things do not work correctly so I did not implement that.

PS: Also it would be possible to automatically loot POIs with all containers which would be considered by many as "cheating" and leads to the scripting on the servers being switched off.

shiribailem commented 11 months ago

Maybe this could be modified to make it optional, maybe even default off. That way those who want it and don't have issues with it can turn it on, but otherwise no surprises to servers.

GitHub-TC commented 11 months ago

Thanks for the input but I won't include this in the standard at the moment for the following reasons.