[MOD EXT] Empyrion Scripting - Scripts

Discussion in 'The Hangar Bay' started by Ephoie, Mar 22, 2020.

  1. Ephoie

    Ephoie Captain

    Joined:
    Jan 27, 2018
    Messages:
    329
    Likes Received:
    515
    This Thread is to post Scripts for the Empyrion Scripting Mod by @ASTIC .

    Please Follow the Format to keep consistent.
    Content that doesn't conform or is not relative will be removed. This includes discussion.
    _________________________________________________________________________
    Related Threads:

    [mod] Empyrion Scripting Mod
    https://empyriononline.com/threads/mod-empyrion-scripting-mod.49290/


    [script] ActiveRadar - Savegamescript

    https://empyriononline.com/threads/script-activeradar-savegamescript.92449/
    _________________________________________________________________________

    Functional Format Example:

    Name:
    Ship Stats Script

    Picture:
    [​IMG]

    LCD Input name:
    Script:ShipInfoStats*

    LCD output name:
    ShipInfoStats


    LCD OUTPUT DIMENSIONS
    WIDTH: 1.25
    HEIGHT: 2.25

    LCD Input Script:
    Code:
    {{#use E.S.FuelTank}} -Fuel-
    <color=blue>{{bar Content 0 Capacity 25 }}</color>
    {{ ~math Content '/' Capacity}}
    {{~format . '{0,8:P2}'}}
    {{~/math}} =
    {{~format Content '{0,7:0.0}'}} / {{format Capacity '{0,7:0.0}'}}
    {{/use}}</color>
    {{#use E.S.OxygenTank}} -O2-
    <color=white>{{bar Content 0 Capacity 25 }}</color>
    {{ ~math Content '/' Capacity}}
    {{~format . '{0,8:P2}'}}
    {{~/math}} =
    {{~format Content '{0,7:0.0}'}} / {{format Capacity '{0,7:0.0}'}}
    {{/use}}</color>
    {{#use E.S.PentaxidTank}} -Warp Fuel-
    <color=purple>{{bar Content 0 Capacity 25 }}</color>
    {{ ~math Content '/' Capacity}}
    {{~format . '{0,8:P2}'}}
    {{~/math}} =
    {{~format Content '{0,7:0.0}'}} /
    {{~format Capacity '{0,7:0.0}'}}
    {{/use}}</color>
    {{#use E.S.DamageLevel}} -Damage-
    <color=red>{{bar . 0 100 25 }}</color>
    {{ ~format . '{0,8:P2}'}}
    {{/use}}</color>
    
     

    Attached Files:

    #1
    Last edited: Mar 29, 2020
  2. Ephoie

    Ephoie Captain

    Joined:
    Jan 27, 2018
    Messages:
    329
    Likes Received:
    515
    Name:
    Docked Ships, Pilot & Passengers Script

    Picture:
    [​IMG]

    LCD Input name:
    Script:passengersAndShips*

    LCD output name:
    PassengersAndShips


    LCD OUTPUT DIMENSIONS
    WIDTH: 1.50
    HEIGHT: 3.00

    LCD Input Script:

    Code:
    <color=green>Docked:</color>
    {{#each E.S.DockedE}} {{Split}}
    {{Name}}
    {{Split}} {{~use S.FuelTank}} <color=purple>
    {{~math Content '/' Capacity}}
    {{~format . '-Fuel- {0,8:p2}'}}
    {{~/math}} </color>
    {{/use}} <color=blue>
    {{~use S.OxygenTank}}
    {{~math Content '/' Capacity}}
    {{~format . '-O2- {0,8:p2}' }}
    {{~/math}}</color>
    {{/use}}
    {{/each}}
    
    <color=white>Pilot:</color> {{E.S.Pilot.Name}}
    
    <color=green>Passengers:</color>
    {{#each E.S.Passengers}}
       {{Name}}
    {{/each}}
    
     
    #2
    Last edited: Apr 16, 2020
  3. Ephoie

    Ephoie Captain

    Joined:
    Jan 27, 2018
    Messages:
    329
    Likes Received:
    515
    - RESERVED -
     
    #3
  4. Ephoie

    Ephoie Captain

    Joined:
    Jan 27, 2018
    Messages:
    329
    Likes Received:
    515
    - RESERVED -
     
    #4
  5. amaus1209[DE][BRB]

    amaus1209[DE][BRB] Lieutenant

    Joined:
    Mar 20, 2017
    Messages:
    37
    Likes Received:
    5
    Werbetafel Fehler
    OA_2020_crea_2020-04-10_21-23-53.png
    OA_2020_crea_2020-04-10_21-23-55.png


    Script muß im Savegame liegen!!!!


    Code:
    Targets:Werbetafel_04;
    >>>>> Galaktik Bindoof [Version 156.48.421] <<<<<
    Copyright <C> 2056 Bindoof Coorp. Alle Rechte bei mir.
    
    C:\Users\empyrion-brb\>
    
    C:\Users\empyrion-brb\>E:
    
    E:\>cd empyrion-brb\Werbetafel
    
    E:\empyrion-brb\Werbetafel>Werbetafel_4.bat
    
    Kann Datei nicht finden. Suche danach
    
    E:\>dir E:\empyrion-brb\Werbetafel\Werbetafel_4.bat /s
    
                                      {{intervall 1}}\[^._.^]-{{else}}-[^._.^]/{{/intervall}}
    {{filelist @root.MainScriptScriptPath '1006\*.*'}}
    {{#scroll 5 1}}
    {{#each .}}
    E:\>empyrion-brb\Werbetafel{{substring . 111 130}}
    {{/each}}
    {{/scroll}}
    {{/filelist}}
     
    {{version}}

    Werbetafel
    OA_2020_crea_2020-04-10_21-26-50.png OA_2020_crea_2020-04-10_21-25-31.png
    Code:
    Targets:Werbetafel_3;
    {{#intervall 30}}
    -------------------------------------------------------
                Werbetafel 03 zu vermieten
    -------------------------------------------------------
              
              
                  "Das Weltall zerfällt
                  
                    in zwei Teile
              
                   - Ich und der Rest"
    
                
                 Giovanni Papini (1881-1956)
              
    --------------------------------------------------------
               Werbetafel 03 zu vermieten
    --------------------------------------------------------
    {{else}}
    -------------------------------------------------------
              Advertising Board 03 for rent
    -------------------------------------------------------
    
    
          "The Universe is falling apart
                  
                     in two parts
              
                    - me and the rest "
    
                  
                  Giovanni Papini (1881-1956)
    
    --------------------------------------------------------
               Advertising Board 03 for rent
    --------------------------------------------------------
    {{/intervall}}
    Eingang Besucher

    OA_2020_crea_2020-04-10_21-51-56.png

    Code:
    Targets:Eingang1,Eingang2,Eingang3,Eingang4;HH1-A
    Orbit: "{{P.Name}}"{{P.Type}}
    Einkaufszentrum: "{{E.Name}}"
    Position: {{E.Pos}}
    {{scroll 5 10}}
    Besucher:
    {{#each E.S.Players}}
     - {{Name}}
    {{/each}}
    {{/scroll}}
    
    Heute ist der: {{datetime "dd.MM."}}2468
    Es ist jetzt  {{datetime "HH:mm:ss"}} Uhr.
     
    #5
    Last edited: Apr 10, 2020
    StyxAnnihilator and Ephoie like this.
  6. shadowiviper

    shadowiviper Commander

    Joined:
    Apr 13, 2020
    Messages:
    89
    Likes Received:
    144
    Name: Universal Container Display
    Description: Display contents of a chest with current/max volume graph. Current volume isn't directly accessible so has 2 additional screens of all item volumes to act as a database named Volumes1 + Volumes2 (2 screens to avoid the 2,000 character limit without needing external scripts).

    Title changes to Locked when crate is accessed.

    Note: only works with the default vanilla item volumes, if volumes aren't default then the calculation will be wrong

    Picture:
    upload_2020-4-13_15-23-47.png
    upload_2020-4-13_16-14-16.png
    LCD Input Name
    : Script:Containers, Volumes1, Volumes2
    LCD Output Name: N/A - Any number of output screens that match the name of a container with 'Dsp-' added as a prefix. Screenshot has 3 LCD's named "Dsp-Iron", "Dsp-Copper" and "Dsp-Silicon" the same as the container they are attached to.
    LCD Dimensions: >= 0.5x0.5
    LCD Input Script:
    Script:Containers
    Code:
    {{~set 'W' (bar 1 0 1 28 '═')}}
    {{~devices @root.E.S 'Volumes*'}}{{#each .}}{{~gettext .}}
    {{#split . ','}}{{set 'X' (concat @root.Data.X . '\n')}}{{/split}}
    {{~/gettext}}{{/each}}{{~/devices}}
    {{~#devicesoftype @root.E.S 'Container'}}
    {{~#each .}}{{~devices @root.E.S (concat 'Dsp-' CustomName)}}{{~#each .}}{{set 'N' ../../CustomName}}
    {{~settextblock .}}<color=#FFF><size=3><align=center>╔{{@root.Data.W}}╗
    {{islocked @root.E.S ../../../}}<color=red>⛔⛔ {{~#intervall 1}}Locked{{~else}}{{@root.data.N}}{{/intervall}} ⛔⛔ </color>
    {{else}}
    {{@root.data.N}}
    {{/islocked}}
    ╚{{@root.Data.W}}╝
    {{~#items @root.E.S @root.data.N}}
    {{setblock 'V'}}{{~#selectlines 1 (calc Id '-' 257) 1}}{{@root.Data.X}}{{/selectlines}}{{/setblock}}
    {{~#math @root.Data.T '+' (calc @root.Data.V '*' Count)}}{{~set 'T' .}}{{~/math}}
    {{~setblock 'D'}}{{@root.Data.D}}
    ◉ {{substring Name 0 24}} {{format Count '<indent=70%>➢ {0,0:N0}</indent>'}}{{/setblock}}
    {{~/items}}
    {{~#math (calc @root.Data.T '/' ../../../Device.VolumeCapacity) '*' 100}}{{~set 'P' .}}{{/math}}
    {{~#test @root.Data.P leq '10'}}{{set 'c1' '1D1'}}{{set 'c2' '030'}}{{/test}}
    {{~#test @root.Data.P in '11-50'}}{{set 'c1' '11D'}}{{set 'c2' '003'}}{{/test}}
    {{~#test @root.Data.P in '50-75'}}{{set 'c1' 'DA1'}}{{set 'c2' '220'}}{{/test}}
    {{~#test @root.Data.P in '75-90'}}{{set 'c1' 'B40'}}{{set 'c2' '310'}}{{/test}}
    {{~#test @root.Data.P geq '90'}}{{set 'c1' 'D11'}}{{set 'c2' '300'}}{{/test}}
    <size=2><line-height=8>Vol :╴  {{concat '<color=#' @root.Data.c1 '>'}}{{~bar @root.Data.T 0 ../../../Device.VolumeCapacity 7 '▒' (concat '<color=#' @root.Data.c2 '>░</color>')}} [{{~format @root.Data.T '{0,0:N0}'}} / {{format ../../../Device.VolumeCapacity '{0,0:N0}'}}]</color></line-height></align>
    {{scroll 9 2}}{{@root.Data.D}}{{~/scroll}}
    {{set 'T' 0}}{{set 'D' ''}}
    </size></color>{{/settextblock}}{{/each}}{{/devices}}{{/each}}{{/devicesoftype}}
    
    Script:Volumes1
    Code:
    500,,60,100,500,1500,100,,,30,1000,,,1000,,40,100,,,,,350,0.2,2,,9000,,,,,4500,4500,160,,100,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9000,9000,,,,,1500,0,,250,,,,,200,300,,,0.5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,,,,,,4,,,3,,,10,,,15,,,30,,,100,,,60,,,,,,,180,20,120,,20,10,,,,,120,80,80,100,150,,,,,,,,,,,,,300,,,,45,,,,220,,,30,120,1200,,,,15,,,,,,30,550,10,100,,,,,,,,,,,,,,,,,,200,,4500,,,,,,,250,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100,45,,,,,500,,,,12,55,60,70,,,,,,1500,4500,,,17,,135,,,,0.6,90,90,90,,1,,,,,,,,,,,,,,500,,,,,8,30,45,,,,,,,,,,,,,40,40,,,,,,,,,,,,,,,,,,,,,,,,,10,,,,,,250,1000,500,250,,,,,,,,600,550,400,460,450,,1,0.1,,,,,500,,,,,,,,,,,200,,,,,,,,,,,,,,120,130,4500,500,,,,,,,,320,400,460,40,160,,4500,4500,4500,,,,,,,,,5,20,,800,10,800,60,,,3000,35,,,75,,,500,95,,10,,150,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,7500,,,220,,,,,,1200,,,50,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2000,1,1,,7,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,40,65,0.5,,,,,200,,,,,,,,,,,,,,,,100,,,,,,,,,,600,,100,,2,,,,,,,,,,2,,2.6,,,,,,,,,,,,,,,,,,,,,,,,,,20,,,,,,550,,,,,,,,60,,,,15,,,300,400,1000,2000,50,70,100,400,80,,,1500,180,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,7.5,,,,,,,,,,,,,,,,,,40,,0.5,,,,,,,,,130,,,45,200,250,300,600,40,,,,,,30,60,300,,,,,,,45,7.5,10,100,450,1000,12,10,15,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0.1,800,,,,,120,,10,5,,,,,,,,,,,,,,65,,,,0.2,,,,,,,,,,,,,,,,,,,,,0.3,,,65,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,36,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,35,700,300,,,8,,,,,20,,,,,,,,,,,,,,,45,,,,,,,,,,35,,,,,,,,,,,,72,,,,,,,,,,,,,,,,,,800,250,100,,,9,,,1.5,,,200,150,,,,,,,,,,,,,,,,,,0,0,,,,,,,,,,,,0.8,,,6,,,30,3,600,,,,65,,,,25,100,,,,,10,,,,,,,,,20,,,,15,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,35,,,,,,,,,,,,,,,,,,,,,,65,,,,35,,,,,,,500,40,35,,,,30,,,,,,8,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,15,20,200,,,,,,,,,400,1000,800,500,1600,35,,,,,,400,800,600,1600
    
    Script:Volumes2
    Code:
    ,,,,,,,,160,220,240,400,180,,,,,,,,,,60,,,70,300,25,,,,70,30,25,10,25,,25,,1,6,120,30,,,,,,,,,,,,,450,,,,,50,20,,,,,,,25,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,55,60,70,,,,,,,,,,,,,,,,,,,,,,,,80,,,,,,,,800,600,300,600,800,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,300,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,35,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,60,90,120,60,90,120,100,180,200,100,180,200,,,,,,,,,,,,,,,,0.02,0.5,1.5,5,2,4,3,1.5,6,1,,,0.6,2,3,8,4,2,,0.4,0.4,,,,,,,,,,0.08,,,,,,,0.5,,0.4,,,,,,,,,,0.1,0.01,0.01,0.01,0.03,0.1,0.06,0.02,,0.05,0.06,0.06,1,0.1,0.1,,,,,,,,,,,,,,0.1,3,1,,,,,,,,,0.5,175,80,300,150,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0.4,0.3,1,0.15,0.3,1.5,12,2,6,1.5,0.4,1,4,2,1.5,0.8,,10,2,8,4,2,,,0.8,1.5,,1.5,,,,,,,,,,,,,,,,,,,,0.5,20,10,2,2,2,2,3,2,2,0.4,0.08,9,2,2.3,0.8,9,2.2,0.3,3,0.1,2,0.8,,4,6,0.75,0.8,0.75,0.8,1.3,0.8,0.2,1.4,1.5,2,0.4,8,0.05,4,1.6,21,8,,1,5,0.2,0.75,3,5,0.8,0,4,6,1.2,2.3,,10,0.3,1,2,1,2.5,1.5,0.6,,,,,,,,,,,,,,,,,3,15,2,0.02,10,15,15,25,,,,,,,,,,,,,,,,,,,,0.45,,,,,,,,,,,0.1,,,,,,,,,15,,,,,,,1,0.1,,,,,,,,,,,,,,,10,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,3,6,,,8,,,,,,,,,,,,,,,1,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0.3,0.2,0.3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2
    
     
    #6
    Last edited: Apr 23, 2020
  7. shadowiviper

    shadowiviper Commander

    Joined:
    Apr 13, 2020
    Messages:
    89
    Likes Received:
    144
    Name: Ammo Counter
    Description: Requires both Volume screens from 1 post up. Input the current weapon loadout and calculate the optimal amount of ammo per weapon per volume. So a setup with 4x Gatling and 2x Rockets displays the number of 15mm bullets to take up 66% (4 / (2+4)) of capacity and 33% rockets.

    Currently generates a list of available weapons for current ship to a 2nd screen (WeaponConfig) on first run, which can be edited to enter the number of each weapon type
    Picture:
    Final Output
    upload_2020-4-13_15-29-42.png

    WeaponConfig screen for inputting weapon types
    upload_2020-4-13_15-34-0.png

    LCD Input Name: Script:AmmoOverview, WeaponConfig
    LCD Output Name: AmmoOverview
    LCD Dimensions: 0.5x0.5
    LCD Input Script:
    This is for a BA
    Code:
    {{~set 'Z' 'Ammo'}}{{fontsize 2}}
    {{~set 'F' '428,2199;429,2104;430,2202;431,2198;432,2200;489,2213;'}}
    {{~devices @root.E.S 'Volume*'}}{{#each .}}{{gettext .}}{{#split . ','}}{{set 'X' (concat @root.Data.X . '\n')}}{{/split}}{{/gettext}}{{/each}}{{/devices}}
    {{~devices E.S 'WeaponConfig'}}{{~gettext .0}}{{~#if .}}{{~devices @root.E.S @root.Data.Z}}{{set 'O' .0/Device/VolumeCapacity}}{{/devices}}{{#split . '\n' true}}{{#each .}}{{#split (substring . 19) ': '}}{{set 'T' (calc @root.Data.T '+' .1)}}{{/split}}{{/each}}{{/split}}
    {{~#split . '\n' true}}{{#each .}}
    {{~set 'A' (substring . 8 4)}}{{#split (substring . 19) ': '}}{{~set 'C' .1}}{{/split}}
    {{~#test (calc @root.Data.C '*' 1) ge 0}}{{set 'i' (calc @root.data.i '+' 1)}}
    {{~setblock 'V'}}{{~#selectlines 1 (calc @root.Data.A '-' 257) 1}}{{@root.Data.X}}{{/selectlines}}{{/setblock}}
    {{~#math (calc (calc @root.Data.O '/' @root.Data.T) '*' @root.Data.C) '/' @root.Data.V}}{{set 'M' .}}{{/math}}
    {{~set 'R' 0}}{{#items @root.E.S @root.Data.Z}}{{#test @root.Data.A eq Id}}{{set 'R' (format Count '{0,0:N0}')}}{{/test}}{{/items}}
    {{~math @root.Data.R '/' @root.Data.M}}{{set 'P' .}}{{/math}}
    {{~concat '<size=150%><sprite=' (calc @root.data.i '+' 46) '></size> ' ~}}
    {{~i18n @root.Data.A 'English'}} <indent=30%><color=#{{~#test @root.Data.P leq '0.15'}}611{{else}}{{~#test @root.Data.P leq '0.60'}}440{{else}}161{{/test}}{{/test}}>{{bar @root.Data.R 0 @root.Data.M 16}}</color>{{~format @root.Data.P '<indent=45%><size=1><b><color=#FFF>{0,8:P2}</color></b></size></indent>'}}{{~/math}}</indent> <indent=73%>[{{@root.Data.R}}/{{format @root.Data.M '{0,0:N0}'}}]</indent>
    <align=center>{{bar 1 0 1  20 '╾╼'}}</align>
    {{/test}}{{/each}}{{/split}}{{else}}
    {{settextblock ../.0~}}{{~#split @root.Data.F ';' true}}{{#each .}}{{#split . ','}}
    <size=0>{{.1}}</size>{{i18n .0 'English'}}: 0
    {{/split}}{{/each}}{{/split}}{{/settextblock}}
    {{/if}}{{/gettext}}{{/devices}}
    
    Alt condig for SV Weapons, replace {{set 'F' on line 2
    Code:
    {{~set 'F' '428,2199;429,2104;430,2202;431,2198;432,2200;489,2213;'}}
    
     
    #7
  8. shadowiviper

    shadowiviper Commander

    Joined:
    Apr 13, 2020
    Messages:
    89
    Likes Received:
    144
    Name: ShipList
    Description: List of closeby faction ships, not limited to just docked ships, with info display (Fuel,O2,Pentaxid,Powered,Docked & Distance). Concept for bordered display and absolute positioning of icons
    Picture:
    upload_2020-4-13_15-43-2.png

    LCD Input Name: Script:ShipList
    LCD Output Name: ShipList
    LCD Dimensions: 0.5x0.5
    LCD Input Script:
    Code:
    {{~set 'LimitToType' 'SV,HV'}}
    {{~fontsize 3}}
    {{~set 'E' '<indent=44.5>║</indent>'}}
    {{~set 'L' (concat '║' @root.data.E)}}
    {{~#each E.S.DockedE}}{{~set 'D' (concat @root.Data.D Id ',')}}{{/each}}<line-height=1><color=#FFF>{{~#scroll 51 2 4}}{{~#entitiesbyname '*'}}{{~#sortedeach . 'Distance'}}{{~#test Id neq @root.E.Id}}{{~#test EntityType in @root.Data.LimitToType}}
    ╔{{~bar 1 0 1  45 '═'}}╗
    {{@root.data.L}}
    ║ {{Name}} <indent=85%>[<color=#{{~#test EntityType eq 'BA'}}F00{{/test}}{{~#test EntityType eq 'CV'}}F0F{{/test}}{{~#test EntityType eq 'SV'}}FA0{{/test}}{{~#test EntityType eq 'HV'}}00F{{/test}}>{{EntityType}}</color>]</indent>{{@root.data.E}}
    ╟{{bar 1 0 1  20 '─'}}{{@root.data.E}}
    {{@root.data.L}}{{@root.data.L}}
    ║ <color=#{{#if S.IsPowerd}}1F1{{else}}00220060{{/if}}>Powered</color> {{@root.data.E}}
    {{~use S.FuelTank}}
    <indent=50%><color=#F11>☢ {{bar Content 0 Capacity 10 '▒' '<color=#300>░</color>'}}<indent=80%><size=1><b><color=#FFF>{{~math Content '/' Capacity}}{{~format . '{0,8:P2}'}}{{~/math}}</color></b></size></indent></color></indent>
    {{/use}}{{@root.data.L}}
    ║ <color=#{{#test Id in @root.data.D}}1F1{{else}}00220060{{/test}}>Docked</color> {{@root.data.E}}
    {{~use S.OxygenTank}}
    <indent=50%><color=#11F>✇ {{bar  Content 0 Capacity 10 '▒' '<color=#003>░</color>'}}<indent=80%><size=1><b><color=#FFF>{{~math Content '/' Capacity}}{{~format . '{0,8:P2}'}}{{~/math}}</color></b></size></indent></color></indent>
    {{/use}}{{@root.data.L}}
    ║ {{format (distance Pos @root.E.Pos) '{0,0:N0}m'}} {{@root.data.E}}
    {{~use S.PentaxidTank}}
    <indent=50%><color=#F1F>⚛ {{bar  Content 0 Capacity 10 '▒' '<color=#303>░</color>'}}<indent=80%><size=1><b><color=#FFF>{{~math Content '/' Capacity}}{{~format . '{0,8:P2}'}}{{~/math}}</color></b></size></indent></color></indent>
    {{/use}}{{@root.data.L}}
    ╚{{bar 1 0 1  45 '═'}}╝
    {{/test}}{{/test}}{{~/sortedeach}}{{~/entitiesbyname}}{{/scroll}}
    </color></line-height> 
    
     

    Attached Files:

    #8
  9. shadowiviper

    shadowiviper Commander

    Joined:
    Apr 13, 2020
    Messages:
    89
    Likes Received:
    144
    Name: Item Overview
    Description: Sorted / colour coded list of items on ship/base with zero-count items listed as well. Concept for dynamic display on different screen sizes (Dont use more than 1 display of different sizes from 1 script input).

    Change constants at the top to alter display:
    H: Heading to be displayed at the top
    T: Target goal for item count, above this items are in green and less shows through different colours (75%, 50%, 25% and 0)
    #split - 6 colours listed for >100%, 100-75%, 75-50%, 50-25%, <25% and 0. Last element is used for any items in Id list but not found in ship
    IDs: List of items to check for

    Picture:
    upload_2020-4-13_15-47-4.png
    upload_2020-4-13_15-48-23.png

    LCD Input Name: Script:ItemOverview
    LCD Output Name: ItemOverview
    LCD Dimensions: 0.5x0.5, 1x1, 1x2 1x1 framed, 1x2 framed
    LCD Input Script:
    Code:
    {{~set 'H' 'Materials'}}
    {{~set 'T' '1000'}}
    {{~#split '#15FC05,#8FF904,#F4DC04,#F99C04,#FC6305,#CE1818' ','}}{{set 'C' .}}{{/split}}
    {{~set 'IDs' '2265,2295,2255-2264,2267,2282,2283,2286,2290-2292,2326,2327,2309,2329-2333'}}
    {{~#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 'Count' true}}{{~#test Id in @root.Data.IDs}}{{set 'X' (concat @root.Data.X Id ',')}}{{setblock 'D' ~}}
    {{@root.Data.D}}{{Name}}:{{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 Name ':' (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'}}{{else}}{{~#test (calc @Index '%' 3) eq 1}}{{set 'P' '32,56'}}{{else}}
    {{set 'P' '0,20'}}{{/test}}{{/test}}{{else}}
    {{~#test @root.Data.SS eq '1x1'}}{{~fontsize 4}}{{~#test (calc @Index '%' 2) eq 1}}{{set 'P' '52,85'}}{{else}}
    {{set 'P' '0,34'}}{{/test}}{{else}}{{fontsize 3}}
    {{set 'P' '0,80'}}{{/test}}{{/test}}
    {{~#split @root.Data.P ','}}{{~concat '<color=' ../.2 '><indent=' .0 '%>◉ ' ../.0 '</indent> <indent=' .1 '%>' ../.1 '</indent></color>' ~}}{{/split}}
    {{~/split}}{{~/each}}{{~/split}}
    
     

    Attached Files:

    #9
    Last edited: Apr 17, 2020
    Slam Jones, jharyl, TK85 and 4 others like this.
  10. shadowiviper

    shadowiviper Commander

    Joined:
    Apr 13, 2020
    Messages:
    89
    Likes Received:
    144
    Name: Dynamic Transfer/Sorting System
    Description: Takes items from an input crate and moves to the correct location. Placing an item into a crate logs its ID to a separate screen after which that item will always move to that location, even if it is no longer there. Any items not yet logged are moved to an "Unsorted" location to be manually moved the first time (only need to move 1 of at item and the rest will follow).

    Optionally has a variable for 'Constructor Input' which will move only 50 of each item found, and is able to pull from any storage not just Input/Unsorted

    Output logs time of transfer and what was moved and where.

    Example:
    • Place 900 Iron into crate 'Input'
    • 900 Iron moved to 'Unsorted'
    • Take 1 Iron and place in crate 'Ingots'
    • Iron ID logged to SorterDB screen
    • 899 Iron moved from 'Unsorted' to 'Ingots'
    • ---
    • Take 1 Iron and place in crate 'Constructor Input'
    • 49 Iron moved from 'Ingots' to 'Constructor Input'
    • ---
    • Remove remaining 850 Iron from 'Ingots' and discard. Ingots is now empty
    • Place 500 Iron into 'Input'
    • 500 Iron moved from Input to Ingots, remembering where it should go even though Ingots is now empty
    Respects Volume/Mass. If a crate is overflowing will check for any crates with the same name and a hypenated number afterwards, in order. In the above example if 'Ingots' was full the iron would try to move to 'Ingots-2', 'Ingots-3' and so on, otherwise it is retained in 'Input' and not moved

    Manually moving items is possible - only Input and Unsorted are used as a source so manually moving between crates A and B is possible and will not immediately try to move the item back. To reset, open the screen 'SorterDB' and wipe contents after placing all items in the correct place. All items will instantly repopulate with where they are currently in the DB and any future inputs go to the right place

    Crate names can be manually entered on line 2 of code

    Picture:
    Output log
    upload_2020-4-13_16-5-53.png

    "SorterDB" being generated from placed items
    upload_2020-4-13_16-6-22.png
    LCD Input Name: Script:[+30]Sorter, SorterDB
    LCD Output Name: Sorter
    LCD Dimensions: >=0.5x0.5
    LCD Input Script:
    Code:
    {{fontsize 2}}{{~set 'F' '1'}}
    {{~set 'I' 'Input'}}{{set 'CI' 'Constructor Input'}}{{set 'O' 'Constructor Output'}}{{set 'U' 'Unsorted'}}
    {{~devices @root.E.S 'SorterDB'}}{{set 'DB' .0}}{{gettext .0}}{{split . '\n'}}{{set 'C' .}}{{/split}}{{/gettext}}{{/devices}}
    {{~#devicesoftype @root.E.S 'Container'}}{{#each .}}{{set 'T' ''}}{{set 'M' 0}}
    {{#split CustomName '-'}}{{set 'n' .}}{{/split}}
    {{~#test @root.data.n.0 in (concat @root.Data.I ',' @root.Data.O ',' @root.Data.U)}}
    {{~#items @root.E.S CustomName}}{{set 'G' @root.data.U}}
    {{#each @root.data.C}}{{#split . ':'}}{{~#test ../../Id in .1}}{{~#test @root.data.CI neq .0}}{{set 'G' .0}}{{/test}}{{/test}}{{/split}}{{/each}}
    {{~#test ../CustomName neq @root.Data.G}}
    {{~move this @root.E.S (concat @root.Data.G '*')}}{{set 'M' 1}}
    {{set 'T' (concat @root.data.T '
    ' ../Name ' - '  Count '<indent=55%>❲' Source ' ➤ ' Destination '❳</indent>')}}
    {{/move}}{{/test}}{{/items}}{{else}}{{set 'x' ''}}
    {{~#each @root.Data.C}}{{#split . ':'}}{{#test @root.data.n.0 eq .0}}{{set 'x' .1}}{{/test}}{{/split}}{{/each}}
    {{~items @root.E.S CustomName}}{{#test Id in @root.data.x}}{{else}}{{set 'x' (concat @root.data.x Id ',')}}{{/test}}
    {{~#test Id in @root.data.CID}}
    {{~move this @root.E.S (concat @root.Data.CI '*') 50}}{{set 'M' 1}}
    {{set 'T' (concat @root.data.T '
    ' ../Name ' - '  Count '<indent=55%>❲' Source ' ➤ ' Destination '❳</indent>')}}
    {{/move}}{{/test}}{{/test}}{{/items}}
    {{~#if @root.data.x}}{{#if @root.data.n.1}}{{else}}{{set 'D' (concat @root.data.D @root.data.n.0 ':' @root.data.x "
    ")}}{{/if}}{{/if}}{{#test @root.data.n.0 eq @root.data.CI}}{{set 'CID' @root.data.x}}{{/test}}{{/test}}
    {{#if @root.data.M}}
    <align=center><color=#FFD><size=120%>Transfer - {{datetime 'HH:mm'}}</size></color></align>
    {{@root.data.T}}
    <align=center><color=#FFD><size=4>{{bar 1 0 1 10 '╼╾'}}</size></color></align>
    {{/if}}{{/each}}{{/devicesoftype}}
    {{settext @root.Data.DB @root.Data.D}}
    
     
    #10
  11. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    991
    Likes Received:
    707
    Cool stuff here I'm impressed - great and keep it up :)
     
    #11
  12. Apan Loon

    Apan Loon Lieutenant

    Joined:
    Jun 7, 2018
    Messages:
    91
    Likes Received:
    52
    Wow, I am also very impressed by these scripts. You made a great mod here ASTIC, allowing for these artistic and useful impressions into the game.
     
    #12
    Ephoie likes this.
  13. shadowiviper

    shadowiviper Commander

    Joined:
    Apr 13, 2020
    Messages:
    89
    Likes Received:
    144
    Thanks @ASTIC , I'm having a lot of fun with the mod and learning something new, the documentation & demos are a big help so thanks for that.

    If you've got any suggestions or feedback for better ways to do some of the things I'm attempting I'd love to hear them - particularly anything for accessing an array by a variable key. For example
    Code:
    {{#split 'First',Second,Third ','}}{{set 'Array' .}}{{/split}}
    
    {{@root.Data.Array[1]}} //Returns "Second"
    
    {{set 'i' 2}}
    {{@root.Data.Array[@root.Data.i]}} //Returns false
    {{@root.Data.Array/@root.Data.i}} //Returns false
    
    
    My workaround currently is to use {{selectlines}} which i found browsing the source code (not in the documentation yet I think?), so splitting an array by newline and then using selectlines which accepts a variable for the line number

    Code:
    {{#split 'First',Second,Third ','}}{{set 'ArrayNewLine' (concat @root.Data.X . '\n')}}{{/split}}
    {{set 'i' 2}}
    
    {{setblock 'Result'}}
    {{#selectlines 1 @root.Data.i  1}}
    {{@root.Data.ArrayNewLine}}
    {{/selectlines}
    
    {{@root.Data.Result}} //Returns "Third"
    
    I'm sure there's an easier way to do it which would help save on character limit (2000 chars per screen doesn't go far) but the only thing I could find in the handlebar docs was a {{lookup}} function which just seems to give a "doesn't exist" error.

    I've been using the selectlines method to (very badly) interpret the current volume of a chest by having a separate screen with all the volumes per item and then adding commas to place that value at a specific position, so if the volume for item ID 1095 is '2', having 1,095 commas at the start of the screen and then a 2, then using {{selectlines}} with the item ID to get the volume amount for the current item by ID, add it all up and compare to the Device.VolumeCapacity to give a current/total figure, but thought you may know a better way to do this?

    Again many thanks for the excellent mod, it's a lot of fun. I should be back with the next batch of scripts in a couple of days when I come up with some new ideas :D
     
    #13
    Ephoie likes this.
  14. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    991
    Likes Received:
    707
    Code:
    {{split "first,second,third" ","}}
    {{set "list" .}}
    {{/split}}
    
    FirstItem: {{@root.Data.list.0}}
    Secondtem: {{@root.Data.list.1}}
    ThirdItem: {{@root.Data.list.2}}
    
    {{set "select" 1}}
    Secondtem: {{lookup @root.Data.list @root.Data.select}}
    
    {{#lookupblock @root.Data.list @root.Data.select}}
    Object: {{.}}
    {{/lookupblock}}
    
    Note: The "lookup" and "lookupblock" need the version 4.8.11 of the EmpyrionScriptingMod
     
    #14
    Ephoie likes this.
  15. shadowiviper

    shadowiviper Commander

    Joined:
    Apr 13, 2020
    Messages:
    89
    Likes Received:
    144
    Amazing! Thanks so much for adding that, i'll download the new version to have a play and hopefully post some revised versions over the weekend
     
    #15
    Ephoie likes this.
  16. Jenago

    Jenago Ensign

    Joined:
    Apr 29, 2018
    Messages:
    8
    Likes Received:
    5
    I want to use your Scripts on a Server without volume or mass. Which Syntax i have to Change für delete the volume Controlling ??
     
    #16
  17. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    991
    Likes Received:
    707
    The number of Max items in the move command limits. You have to remove this in the scripts or increase the number.
     
    #17
    Ephoie likes this.
  18. shadowiviper

    shadowiviper Commander

    Joined:
    Apr 13, 2020
    Messages:
    89
    Likes Received:
    144
    If you're asking about the sorting system, there shouldn't be any need to change anything with regards to volume if you're not using it. The way ASTIC's code for the mod works (I think) is it will always try to move an item, and if the count of that item in the target container doesn't increase then it will try to re-add that item back into its original container. If you use godmode to overfill both the source and destination containers then the script throws an error where it tries to move an item from A to B, can't add to B due to it being full but also can't add it back to A as that is also full (shouldn't come up much in normal gameplay tho)

    If you were just looking to use the container displays without the volume charting on it, you just need to take out the block loading "@root.E.S 'Volumes*'", starting from {{devices}} up to {{/devices}}, the entirety of {{setblock 'V'}} and the following {{math}} block and finally the math/test/bar blocks for the display.

    Should end up something like this (I've not checked this in game yet so if it doesn't work let me know)

    Code:
    {{~set 'W' (bar 1 0 1 28 '═')}}
    {{~#devicesoftype @root.E.S 'Container'}}
    {{~#each .}}{{~devices @root.E.S (concat 'Dsp-' CustomName)}}{{~#each .}}{{set 'N' ../../CustomName}}
    {{~settextblock .}}<color=#FFF><size=3><align=center>╔{{@root.Data.W}}╗
    {{islocked @root.E.S ../../../}}<color=red>⛔⛔ {{~#intervall 1}}Locked{{~else}}{{@root.data.N}}{{/intervall}} ⛔⛔ </color>
    {{else}}
    {{@root.data.N}}
    {{/islocked}}
    ╚{{@root.Data.W}}╝
    {{~#items @root.E.S @root.data.N}}
    {{~setblock 'D'}}{{@root.Data.D}}
    ◉ {{substring Name 0 24}} {{format Count '<indent=70%>➢ {0,0:N0}</indent>'}}{{/setblock}}
    {{~/items}}
    {{scroll 9 2}}{{@root.Data.D}}{{~/scroll}}
    {{set 'T' 0}}{{set 'D' ''}}
    </size></color>{{/settextblock}}{{/each}}{{/devices}}{{/each}}{{/devicesoftype}}
    
    This could probably be made a lot more efficient if you're removing the volume, as it should no longer be needed to store the items/counts for later display - whereas the original needed to loop all items to tally up the total volume and store the actual counts to display after the volume graph, but the above should be close enough by just taking out the unneeded parts
     
    #18
    Ephoie and ASTIC like this.
  19. shadowiviper

    shadowiviper Commander

    Joined:
    Apr 13, 2020
    Messages:
    89
    Likes Received:
    144
    Sneak peak for next project, working out the final few bugs this week

    upload_2020-4-23_10-25-47.png
     
    #19
    Sephrajin and Ephoie like this.
  20. ASTIC

    ASTIC Captain

    Joined:
    Dec 11, 2016
    Messages:
    991
    Likes Received:
    707
    #20

Share This Page