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

Add 'Item Crafted' Trigger #83

Open
3 tasks done
XykoZ opened this issue Dec 5, 2022 · 4 comments
Open
3 tasks done

Add 'Item Crafted' Trigger #83

XykoZ opened this issue Dec 5, 2022 · 4 comments
Labels
feature request A feature request Trigger Relates to a trigger unimplemented dependencies This feature requires other features to be coded first

Comments

@XykoZ
Copy link

XykoZ commented Dec 5, 2022

Category

A new trigger

What are you missing?

The idea is to create a flow which cycles through a list of items to be crafted and evenly crafts them up to a target quantity.
Eg. 1mil of each Summoning tablets, Runes, etc

Currently the item quantity trigger would do a rune up to 1mil before moving to the next one.
If the flow could progress after x crafts (1 is fine) then you could check for item quantity and if < 1mil then craft, else skip.

Thanks.

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
@XykoZ XykoZ added the feature request A feature request label Dec 5, 2022
@Alorel
Copy link
Owner

Alorel commented Dec 5, 2022

Hey, just to set your expectations straight, this wouldn't be coming very soon - it's impossible to reliably do this with the way the mod's currently coded.

I worked around this for some skills by using loops - buy materials & loop back to the "start crafting" step continuously - but it can be unreliable if your recipe is using crafted/gathered materials and item preservation/double chance starts coming into play and making numbers chaotic.

Your sort of automatic work splitting based on ratios should become possible once I've finished implementing a few other features:

  • and/or triggers - you'd basically set up an "or" trigger with "item quantity of material 1 <= X" or "item quantity of material 2 <= Y"
  • Allowing triggers to have outputs & for other steps to be able to read those outputs - this will then allow workflows to tell whether a step started because of trigger 1 or trigger 2 in the example above
  • Computed option inputs - in this case your workflow would start gathering material 1 or material 2 depending on which trigger activated
  • (potentially needed) ability to run workflows as actions in other workflows

@Alorel Alorel added Trigger Relates to a trigger unimplemented dependencies This feature requires other features to be coded first labels Dec 5, 2022
@XykoZ
Copy link
Author

XykoZ commented Dec 10, 2022

Could a mvp of this be to just run the action once and move on?

For example, woodcutting:
if normal < 1mil
cut normal log once
if oak < 1mil
cut oak once
...

Sure, it assumes ingredients are there, and if the ingredients are missing it'll attempt to craft, fail, and move on.

Is any of this a thing? :)

@Alorel
Copy link
Owner

Alorel commented Dec 11, 2022

Could a mvp of this be to just run the action once and move on?

I think that'd actually be more difficult to implement because it goes completely against how the mod is coded (keep doing thing A until the trigger for thing B fires) - right now the trigger for "oak < 1mil" would need to somehow trigger after you've cut the normal log, but not before the normal log action's finished.

Come to think of it, action timers are static, so an easy workaround for now could be to code a "delay" action:

Step 1

  1. Start cutting normal logs
  2. Wait for 850 milliseconds

Step 2

  1. Start cutting oak logs
  2. Wait for 1200 milliseconds
  3. Jump back to step 1

How does that sound?

@XykoZ
Copy link
Author

XykoZ commented Dec 11, 2022

Oh, that'd be great. Even if it's not perfect, can just throw some extra time on it. If I'm running it overnight, it'll just increase all logs by some amount, which is the point. Efficiency can come later :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature request Trigger Relates to a trigger unimplemented dependencies This feature requires other features to be coded first
Projects
None yet
Development

No branches or pull requests

2 participants