Space Engineers

Space Engineers

39 ratings
UfoL's Full Inventory Trigger Script
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
654.058 KB
15 Apr, 2019 @ 9:21pm
31 Jan, 2023 @ 2:59am
6 Change Notes ( view )

Subscribe to download
UfoL's Full Inventory Trigger Script

In 1 collection by UfoL BeerSeeker
UfoL's SE Scripts
4 items
Description
* UfoL's Full Inventory Trigger Script
* v.: 1.3.0

This is a simple script designed to monitor how full cargo containers are, and trigger chosen timer blocks once total combined storage space is full/empty enough, based on parameters set inside script. Script needs at least one block with inventory and one timer block to function. Two timer block will let you set actions when cargo level goes both high and low. Any number of cargo containers should work, and they don't have to be the same size. Have not tested with subgrids however.

* Supports group name for multiple containers or single block if group is not present.
* Supports any block that has inventory (note that it will count every inventory a block have, i.e. both of refinery's inventories)
* Provides simple LCD output, also to cockpit or other blocks with LCDs. It will default to the main LCD however. You can use group to for output to multiple LCDs.
* Possible to switch between constant triggering while above/below treshold or single trigger once volume goes off tresholds.

I wrote this script mostly for myself as i just wanted to switch my drill platform off once it fills the cargo to prevent wasting ore. And then back on once storage started clearing.
I couldn't find simple script to do that so i did it myself. Hopefully it will work for you too as it's my first attempt at programming since 7 years. I may add some more features and polish it in future.
It's amazing that game can motivate to work, while at work you only think about gaming :)

Update:
Fixed bug that crashed script if some of the blocks were missing.


Want to chat?
[discord.gg]
16 Comments
Jack Schitt 31 Jan, 2023 @ 3:17am 
Great! :steamthumbsup: I didn't know that was an extra task previously.
UfoL BeerSeeker  [author] 31 Jan, 2023 @ 3:02am 
oh look! they finally fixed that. When i last tried weird steam/keen bug made it impossible to upload thumbnails to script without using some external tools. Was broken for long enough that i stopped checking. I'll have to revisit my stuff and give em proper thumbnails now.
Jack Schitt 31 Jan, 2023 @ 2:24am 
I made a thumbnail for this I use because I run mods and scripts locally. I like them to have images. Feel free to use it if you'd like to.
https://i.imgur.com/OWcQHoV.png
Jack Schitt 7 Nov, 2021 @ 9:45am 
I had to change my design to using connectors instead of landing gear and having the "track" be a conveyor system instead of armor blocks. It was easier to get going that way. The robot doesn't need cargo but the cargo still gets full and the miner needs to stop when that happens. This script is exactly what I needed!

I'm not and won't ever be on discord.
UfoL BeerSeeker  [author] 7 Nov, 2021 @ 6:17am 
Thats cool Jack, if you'd like you can post picture of your creation on my discord. I'm curious how it ends up. Good luck.
Jack Schitt 4 Nov, 2021 @ 10:28am 
Thanks for sharing this! I just can't get a grasp on c#. Tried and tried and tried. I'm building a miner on 2 landing gear between a piston to dig a very long tunnel. One foot locks, machine digs, piston extends, sensor switches the landing gear lock status (one locked one unlocked), piston retracts.

The idea I have is I'd like a script to triger a timer to move the machine forward when cargo is near or completely empty. It will be it's own grid but merging a sorter block to junction blocks the machine sits and moves on so I'll be testing it with sub-grids. I'll let you know how it goes.
UfoL BeerSeeker  [author] 8 Jun, 2021 @ 3:47am 
thank you, i will tak a look when i have a moment
TheHellKat 5 Jun, 2021 @ 12:38pm 
Love this script, soon much utility. However I have found 2 spelling mistakes.

The first is one of the inventory warnings, inventory is spelt wrong, the other is the LCD text 'space usage within margins' within is spelt wrong.
aagunss2 16 Aug, 2020 @ 2:55am 
Thanks.. Saved me many hours coding similar script
LYNX 12 Aug, 2020 @ 4:13am 
Damn you sxript !! Where have u been all my SE life ?!!!

Thx for this, kudos given o/