Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script exit handler #182

Open
3 tasks done
Matthew-Whitlock opened this issue Jan 28, 2023 · 0 comments
Open
3 tasks done

Script exit handler #182

Matthew-Whitlock opened this issue Jan 28, 2023 · 0 comments
Labels
feature request A feature request

Comments

@Matthew-Whitlock
Copy link

Matthew-Whitlock commented Jan 28, 2023

Category

A new trigger

What are you missing?

Since you can run a workflow within another, a common pattern I have is something like this:

Script: Mine Essence
    Run-script: Gather Moles, until next step trigger
    When qty Mole >= 100: Run-script: Gather Ravens, until next step trigger
    When qty Raven >= 100: Equip summons, mine essence
    When qty mole <= 0 || qty Raven <= 0: Goto Step 1
Script: Gather Moles
    Mine Augite
    When qty Augite >= 10: Buy shards, Craft Mole
    When Augite <= 0 || shards <= 0: Goto 1

A nice convenience would be an exit handler for gather moles that sells off any remaining Augite and Shards when the script exits, regardless of if it exits naturally or due to being cut off by another script. I'd prefer it in the Script itself rather than the caller, so it's more easily reusable.

Bonus points for having if statements in the exit manager(if qty augite <= 10: sell augite to make sure I don't sell something I'm building a stockpile of currently.).

Code of Conduct

  • I agree to follow the code of conduct
  • My request fits the contribution guidelines
  • I have searched for similar issues and nothing similar exists
@Matthew-Whitlock Matthew-Whitlock added the feature request A feature request label Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature request
Projects
None yet
Development

No branches or pull requests

1 participant