[MOD EXT] Empyrion Scripting - Scripts

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

  1. Homunk

    Homunk Lieutenant

    Joined:
    Mar 22, 2020
    Messages:
    74
    Likes Received:
    26
    Replace the Ids in this line with the Ids of the items you want to have listed.
    {{~set 'IDs' '2265,2295,2255-2264,2267,2282,2283,2286,2290-2292,2326,2327,2309,2329-2333'}

    More information you can get from the Empyrion Scripting ReadMe.txt file.
     
    #521
  2. GATTO

    GATTO Ensign

    Joined:
    Feb 25, 2022
    Messages:
    15
    Likes Received:
    4
    Thank you, i managed to get the id in a different way (for the extra resouces not vanilla) but now i'm seeing a weird thing
    The script breaks randomly when i change playfield, works smoothly on bases but on CVs works when i place it then i warp or i leave the planet and stops working... i'm playing on a friend server, did we screwed up something?
     
    #522
  3. Homunk

    Homunk Lieutenant

    Joined:
    Mar 22, 2020
    Messages:
    74
    Likes Received:
    26
    If you play SP or coop, that's what happens, but it should not happen on a dedicated server play.
     
    #523
  4. GATTO

    GATTO Ensign

    Joined:
    Feb 25, 2022
    Messages:
    15
    Likes Received:
    4
    we're on dedicated.
    I eve tried the priority thing (1Script:*** 2Script:** and so on) but it still stops when switching playfield

    --------------------

    SCRATCH that. the script was working and not working because it was running LOCALLY lol, my friend failed to upload the mod (the file host is paranoid about dll) so it was kinda running only when i was around.
    We've put a ticket in to upload the damn thing on the server xD
     
    #524
    Last edited: Jul 29, 2022
  5. GATTO

    GATTO Ensign

    Joined:
    Feb 25, 2022
    Messages:
    15
    Likes Received:
    4
    ok, no, script is on the server, still having the same issue, as soon as i change playfield, everything stops working
     
    #525
  6. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    When the Script is run on the server - turn the EAC on - so your local mod is blocked, running both doesn't work.
     
    #526
  7. GATTO

    GATTO Ensign

    Joined:
    Feb 25, 2022
    Messages:
    15
    Likes Received:
    4
    trying now, i did removed the mod from the client thinking it was overlapping or something but i had the same issue. on the planet when i'm running other scripts (if i turn off and on my lcd) the cv scripts start running again, as soon as i hit space. ded.

    tested without the mod on my client and with EAC on. same issue.

    they start working only when i'm back on Haven (where i have some other scripts running on base) after i access the script lcd and close it.

    if i go in space everything stops and the previous workaround does nothing Q_Q
    Also deleted the cache
     
    #527
  8. GATTO

    GATTO Ensign

    Joined:
    Feb 25, 2022
    Messages:
    15
    Likes Received:
    4
    #528
  9. GATTO

    GATTO Ensign

    Joined:
    Feb 25, 2022
    Messages:
    15
    Likes Received:
    4
    I may have found out what's going on, i attached a ship info script (fuel, oxy, position, docked ships etc) and NOW everything seems to work when switching playfields

    i need to know what's enabling that script to work anywhere and why the others dont lol
     
    #529
  10. Sephrajin

    Sephrajin Rear Admiral

    Joined:
    Dec 22, 2017
    Messages:
    916
    Likes Received:
    2,918
    Something like this?
    Best used with CultureInfo as described in the ReadMe by Astic.
    [​IMG]

    Save to a lua file and edit with notepad++ for syntax highlighting.
    HTML:
    -- -------------------------------------
    -- Status information and item counts
    -- Written by Sephrajin 2019-2022
    -- ------------------------------------
    -- List Ingots & Ores, red on low or missing -- the 'plain ids' are Eden related and sadly do not work for the 0 check...
    -- Requires:
    -- LCD: Script:StatusIO
    -- Output:
    -- Projector: StatusIO
    -- Fontsize: 12
    -- Projector w:2.75 x h:3
    -- ------------------------------------
    {{~set 'limitLow' 1000}}
    {{~set 'limitMedium' 1000}}
    {{~set 'limitGood' 100000}}
    <align=center><size=+7>Ingots & Ores</size>
    {{bar 1 0 1 30 '═'}}</align>
    {{scroll 32 1}}
    {{#sortedeach E.S.Items 'Count' true}}
    {{~#test Id 'in' (concat @Ids.Ingot @Ids.Ore '7300,7301,7342-7344,4365')}}
    <color={{~#test Count geq @root.Data.limitGood}}green>{{~else}}{{~#test Count le @root.Data.limitMedium}}{{~#test Count le @root.Data.limitLow}}red>{{else}}orange>{{/test}}{{~else}}yellow>{{/test}}{{/test}}◉ {{i18n Key}} <pos=420>{{format Count '{0,6:N0}'}}</pos></color>
    {{/test}}
    {{/sortedeach}}
    {{#itemlist E.S.Items (concat @Ids.Ingot @Ids.Ore '7300,7301,7342-7344,4365')}}{{~#test Count geq 1}}{{~else}}<color=red>○ {{i18n Key}} <pos=420><size=+1> ⚠</size></pos></color>
    {{/test}}
    {{/itemlist}}
    {{/scroll}}
    -- ------------------------------------
    -- List Components, red on low or missing
    -- Requires:
    -- LCD: Script:StatusComponents
    -- Output:
    -- Projector: StatusComponents
    -- Font Size: 12
    -- Projector w:2.75 x h:3
    -- ------------------------------------
    {{~set 'limitLow' 500}}
    {{~set 'limitMedium' 1000}}
    {{~set 'limitGood' 5000}}
    <align=center><size=+7>Components</size>
    {{bar 1 0 1 30 '═'}}</align>
    {{scroll 32 1}}
    {{#sortedeach E.S.Items 'Count' true}}
    {{~#test Id 'in' '4375,4374,4357,4401,4340,4338,4339,4331,4314,4307,4308,4315,4303,4304,4311,4360,4361,4363,4364,4306,4310,4312,4343,4313,4305,4330,4309,4334,4337,4366,4367,4350-4356,4378-4381,5097,5108,5706-5708,7298,7299,7302,7303,7310,7312,7313,7320,7330,7341,4444,4358,4377'}}
    <color={{~#test Count geq @root.Data.limitGood}}green>{{~else}}{{~#test Count le @root.Data.limitMedium}}{{~#test Count le @root.Data.limitLow}}red>{{else}}orange>{{/test}}{{~else}}yellow>{{/test}}{{/test}}◉ {{i18n Key}} <pos=420>{{format Count '{0,6:N0}'}}</pos></color>
    {{/test}}
    {{/sortedeach}}
    {{#itemlist E.S.Items '4375,4374,4357,4401,4340,4338,4339,4331,4314,4307,4308,4315,4303,4304,4311,4360,4361,4363,4364,4306,4310,4312,4343,4313,4305,4330,4309,4334,4337,4366,4367,4350-4356,4378-4381,5097,5108,5706-5708,7298,7299,7302,7303,7310,7312,7313,7320,7330,7341,4444,4358,4377'}}{{~#test Count geq 1}}{{~else}}<color=red>○ {{i18n Key}} <pos=420><size=+1> ⚠</size></pos></color>
    {{/test}}
    {{/itemlist}}
    {{/scroll}}
    
     
    #530
  11. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    #531
  12. Daimonicon

    Daimonicon Lieutenant

    Joined:
    Nov 4, 2019
    Messages:
    69
    Likes Received:
    15
    Hallo,

    ich hänge irgenwie mit der Formatierung. Dieser Schnipsel ist aus dem ShipInfo Script ich glaube von ASTIC.
    Diesen Teil wollte ich gerne auf einem zweiten Display darstellen aber ich kriege keinen Zeilenumbruch hin :-(
    Das Script an sich funktioniert soweit ich das sehen kann aber ich hätte die Ausgabe gern wie folgt:

    Docked:
    -HV Small Tank 79,30% Fuel 0,00% O2
    -SV Loot Lifter 400 98,02% Fuel 93,75% O2
    -HS3 - Salvager 44,83% Fuel 0,00% O2

    Mir angezeigt wird aber (komplett fortlaufender Text):

    [​IMG]

    Kann mir einer helfen gibt es vieleicht sogar beispiele weil meine "." für Leerzeilen sicher auch nicht korrekt sind ?

    Code:
    .
    Docked:
    .
    {{#each E.S.DockedE}}
    - {{~Name}}
    {{~use S.FuelTank}}
    {{~math Content '/' Capacity}}
    {{~format . '{0,8:P2} Fuel'}}
    {{~/math}}
    {{/use}}
    {{~use S.OxygenTank}}
    {{~math Content '/' Capacity}}
    {{~format . '{0,8:P2} O2'}}
    {{~/math}}
    {{/use}}
    {{/each}}
    
     
    #532
  13. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    @Daimonicon Try to remove the '~' from the {{~Name}} because ~ means that the line is concat with the previous line
     
    #533
  14. Daimonicon

    Daimonicon Lieutenant

    Joined:
    Nov 4, 2019
    Messages:
    69
    Likes Received:
    15
    I couldn't test it right away because my savegame was broken but taking away this "~" unfortunately doesn't help.
     
    #534
  15. Dorimanx

    Dorimanx Ensign

    Joined:
    Mar 27, 2019
    Messages:
    7
    Likes Received:
    0
    Script : Auto Fill Advanced AMMO to docked Ship!

    LCD Name : Script:AmmoAutoFill
    Output LCD : AmmoAutoFill

    SV + BA/CV Cargo : Ammunition 1 or any other like Ammunition BOX

    Switch with Name : sw_autoammo


    Code:
    {{~set 'LimitToType' 'SV,HV'}}<pos=0>◜</pos><pos=188>◝</pos>
    <align=center><i><size=150%>Autoammo docked vessels</size></i>
    </align><pos=0>◟</pos><pos=188>◞</pos>
    {{~#getswitch @root.E.S 'sw_autoammo'}}{{#if SwitchState}}
    {{#each @root.E.S.DockedE}}
    {{#test EntityType in @root.Data.LimitToType}}
    {{~set 'IDs' '4152,4261,4258,5728,5730,4247,4256,5848'}}
    {{~devices S 'Ammunition*'}}{{#each .}}
    {{~set 'IDs' (concat @root.Data.IDs ',' (substring (replace CustomName '#' ',') 8))}}
    {{~/each}}{{/devices}}
    {{#items @root.E.S 'Ammunition*'}}
    {{~#test Id in @root.Data.IDs}}
    {{~#math (configattr Id 'StackSize') '/' 8}}
    {{~set 'Stacks' (int (max '30' .))}}
    {{~/math}}
    {{~#test Count ge @root.Data.Stacks}}
    {{~#move . ../../../S 'Ammunition*' @root.Data.Stacks}}{{/move}}
    {{~/test}}{{/test}}{{/items}}{{/test}}{{/each}}
    {{else}}
    
    <align=center><size=80%>
    <color=red>Switch sw_autoammo lever to automatically
    ammo up your docked vessels.
    </color></size></align>
    {{/if}}{{/getswitch}}
    
    <size=50%>
    {{~set 'IDs' '4152,4261,4258,5728,5730,4247,4256,5848'}}
    {{~#each @root.E.S.DockedE}}
    {{#test EntityType in @root.Data.LimitToType}}
    {{~devices S 'Ammunition*'}}{{#each .}}
    {{~set 'IDs' (concat @root.Data.IDs ',' (substring (replace CustomName '#' ',') 8))}}
    {{~/each}}{{/devices}}{{/test}}{{/each}}
    {{~#getitems @root.E.S 'Ammunition*'}}
    {{~#itemlist . @root.Data.IDs}}
    {{~#math (configattr Id 'StackSize') '/' 8}}
    {{~set 'Stacks' (int (max '30' .))}}
    {{~/math}}
    {{#test Count 'le' @root.Data.Stacks}}
    <indent=6>◉ <color=red>
    {{~x}}Not Enough: <color=#00cccc>
    {{~i18n Id}}</color> (<color=orange>{{Count}} ➠ #{{@root.Data.Stacks}}</color>)</color></indent>
    {{else}}
    <indent=6>◉ <color=green>
    {{~x}}Plenty:</color> <color=#00cccc>
    {{~i18n Id}}</color> (<color=orange>{{Count}} ➠ #{{@root.Data.Stacks}}</color>)</indent>
    {{/test}}
    {{/itemlist}}{{/getitems}}
    </size>
    
     
    #535
    Last edited: Aug 26, 2022
  16. Dorimanx

    Dorimanx Ensign

    Joined:
    Mar 27, 2019
    Messages:
    7
    Likes Received:
    0
    Script! Auto move items from harvester controller from docked ship!

    LCD Name : Script:OreAutoMove

    Output LCD : OreAutoMove

    SV Cargo : Harvest 1 ( or any Harvest NAME)
    CV/BA Cargo : Harvest 1 ( or any Harvest NAME)

    Code:
    <pos=0>◜</pos><pos=188>◝</pos>
    <align=center><i><size=150%>Automove cargo</size></i>
    </align><pos=0>◟</pos><pos=188>◞</pos>
    <color=green>Scanning for boxes starting with 'Harvest*' in docked vessels.</color>
    
    Scanning:
    {{scroll 5 1}}
    {{#each @root.E.S.DockedE}}
    <indent=6>◉ <color=grey>{{Name}}</color></indent>
    {{#items S 'Harvest*'}}
    {{move . @root.E.S 'Harvest*'}}
    {{SourceE.Name}}:{{Source}}->
    {{~DestinationE.Name}}:{{Destination}}
    {{format Count '{0,5}'}} : {{i18n Id 'English'}}
    {{/move}}
    {{/items}}
    {{/each}}
    {{/scroll}}
     
    #536
  17. me777

    me777 Commander

    Joined:
    Aug 18, 2020
    Messages:
    406
    Likes Received:
    138
    Does the @root.E.S.DockedE now work for BA? (it used to NOT work back when I tryed to build some move stuff script in handlebars...)
     
    #537
  18. bigbubbajager

    bigbubbajager Ensign

    Joined:
    May 1, 2022
    Messages:
    1
    Likes Received:
    0
    Not sure what the problem is but I cant seem to get sorting script to work. I just tried the resent one that was posted here not long ago. I am able to get every other script to work . I have tried all the different BPs that have the script predone and in everyone all but the sorting script work. Does anyone have any ideas what I might be doing wrong.

    {{fontsize 3}}
    {{#items E.S 'SubStorage'}}
    {{#devices @root.E.S 'Box-*'}}
    {{#each .}}
    {{#split CustomName '-'}}
    {{#test Length eq '3'}}
    {{#split .2 '/'}}
    {{set 'Ids' (concat . ',')}}
    {{/split}}
    {{#test ../../../../Id 'in' @root.Data.Ids}}
    {{#move ../../../../../.
    @root.E.S ../../../CustomName}}
    From {{Source}}
    to {{Destination}}
    at {{datetime 'dd. u\m HH:mm:ss'}}:
    - {{format Count '{0,5}'}} :
    {{~Name}}
    {{/move}}
    {{/test}}
    {{/test}}
    {{/split}}
    {{/each}}
    {{/devices}}
    {{/items}}
     
    #538
    Last edited: Aug 29, 2022
  19. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    Gutes Video zu den deconstruct & recycle Scriptbefehlen von Sephrajin
     
    #539
  20. ASTIC

    ASTIC Rear Admiral

    Joined:
    Dec 11, 2016
    Messages:
    1,085
    Likes Received:
    731
    #540
    Last edited: Sep 11, 2022

Share This Page