code: add smart vault

This commit is contained in:
Dmitriy Pleshevskiy 2024-01-04 20:33:21 +03:00
parent e52220c5a3
commit 0bd5a8e4f5
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985

11
code/vault.txt Normal file
View file

@ -0,0 +1,11 @@
sensor itemsCount vault1 @totalItems
sensor itemCapacity vault1 @itemCapacity
print "Vault capacity: "
print itemCapacity
print "\n"
print "Vault count: "
print itemsCount
printflush message1
op mul maxItemsCount itemCapacity 0.95
op greaterThanEq isUnloadEnabled itemsCount maxItemsCount
control enabled unloader1 isUnloadEnabled 0 0 0