Space Engineers

Space Engineers

评价数不足
Current Volume (Miner Assist)
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
66.589 KB
2017 年 11 月 30 日 上午 11:28
2019 年 8 月 9 日 下午 2:04
4 项改动说明 ( 查看 )

订阅以下载
Current Volume (Miner Assist)

描述
About:
Simple script to write the percentage of cargo space used on individual terminal blocks, antenna and/or lcd display.
Originally written for my remote miner Stakhanovite and cleaned up to work with other miners.

Not only does it read from the cargo containers but it will scan drills, connectors and cockpits. Just playing around with some new routines for detection of broken/destroyed/missing blocks with auto list replacement based on block types, ini style configurations with custom data, argument handling and lcd display formatting, running scripts without timer blocks.

Setup
  • Add a timer block with "stop" somewhere in its name. Configure the timer block to stop your drills, play a sound, turn on some lights or anything else you'd like your ship/drone to do when it's inventory has been reached or the drills have reached the "FullPercent" capacity.
  • Add a programmable block and load the script from the workshop.
  • Add CV to the name of the LCD/Textpanel you want the cargo usage bar to display on. E.g. "Text Panel CV" "LCD CV" "Corner LCD CV". Additional configuration in CustomData to work with surface displays such as cockpits, see below.
  • Recompile the script after you've made changes to the configurations in the custom data field.

Configurable Settings in the Custom Data Window
  • Display = CV - Adjust the string your display block reports to. E.g. Config "Display = [Miner]", LCD = "LCD [Miner]"
  • LocalGrid = true/false - true will only check and modify names on the local grid, false will scan remote connected grids
  • AppendPercent = true/false - toggle the block name mangling, if you only want to use the lcd set it to false
  • Verbose = true/false - This will provide updates in the detailed information section of the programmable block
  • Debug = true/false - Debugging information, outputs tons of garbage you don't want in the detailed information section of the programmable block.
  • FullTimer = stop - The lowercase string your timer block name contains, e.g. "Timer Block Stop". If found this timer block will be triggered by the script when the container/drill percentage has been hit.
  • FullPercent = 90 - How full the containers or an individual drill must be before the script triggers a stop.
  • CV-Surface = - the name of the surface if displaying to cockpit, programmable block, or any other LCD surface. Beginning of string may vary depending on your (MyBlock-Surface instead of CV-Surface) E.g. 'CV-Surface = Large Display' or 'CV-Surface = Top Left Screen'

Script Variables
  • The constants WRAPSTART and WRAPEND will change the "wrapper" for the percentage appended to the terminal block, by default percentages will show up like [0%], [100%] you can change this to something unique in the block name like gt/lt signs <> squiggly brackets {}, etc.
  • Note most of the other variables that seem editable are configured by the CustomData field as noted in the code.

Arguments:
  • init - reruns the init, will scan for blocks and reload the config without needing to recompile the script.
  • settings - Displays current settings in detailed information section of the programmable block.
  • help - Lists arguments in the detailed information section of the programmable block.


Additional Comments:
Check out my workshop for other nifty creations!
See it in action on the Stakhanovite.
7 条留言
Judgernaut 2019 年 7 月 30 日 上午 4:05 
Thanks!
the-phil  [作者] 2019 年 7 月 30 日 上午 3:49 
@Judgernaut try http://www.hilands.com/files/code/se/currentvolume-2018082502.cs it will run a trigger, not start, on a timer that has "Stop" in its name. You may need to clear the custom data field and recompile for a fresh config so you can change the "FullTimer" config variable doodad in the custom data field. I think that's what you're asking for.

The linked version still has the warning on compile, need to integrate the changes on the LCD display formatter class the script uses. Should work regardless until the SE engine removes compatibility for the old LCD code.
Judgernaut 2019 年 7 月 30 日 上午 3:21 
Any chance of getting it to tick a timer when at X percent? Pretty please
Judgernaut 2019 年 7 月 26 日 上午 3:10 
Well gosh darn, it works anyway :D
Judgernaut 2019 年 7 月 26 日 上午 3:07 
Dang it... been trying to find a simple volume script but this one throws a lot of errors :F
Nuros 2018 年 9 月 9 日 上午 5:12 
simple and great, thank you :)
FifthPegasus 2017 年 12 月 3 日 上午 11:09 
I was just looking for something like this. Thank you