Space Engineers

Space Engineers

Not enough ratings
Current Volume (Miner Assist)
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
66.589 KB
30 Nov, 2017 @ 11:28am
9 Aug, 2019 @ 2:04pm
4 Change Notes ( view )

Subscribe to download
Current Volume (Miner Assist)

Description
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 Comments
Judgernaut 30 Jul, 2019 @ 4:05am 
Thanks!
the-phil  [author] 30 Jul, 2019 @ 3:49am 
@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 30 Jul, 2019 @ 3:21am 
Any chance of getting it to tick a timer when at X percent? Pretty please
Judgernaut 26 Jul, 2019 @ 3:10am 
Well gosh darn, it works anyway :D
Judgernaut 26 Jul, 2019 @ 3:07am 
Dang it... been trying to find a simple volume script but this one throws a lot of errors :F
Nuros 9 Sep, 2018 @ 5:12am 
simple and great, thank you :)
FifthPegasus 3 Dec, 2017 @ 11:09am 
I was just looking for something like this. Thank you