This may be compatible with other versions, it for sure will be with minor edits. (this was technically made with Essentials GSC V21.1 but will still work with Essentials V21.1)
Add this script above main and name it whatever you want or "tradeOffMachine"
def tradeOffMachine
if...