Page 1 of 1

Recursive Recharge

Posted: Fri Jul 07, 2023 2:25 am
by beholderface
This hex, designed for use with very large phials that are not survival-accessible with only base hex, draws amethyst shards from your bound nexus and uses them to cast Recharge Item, and continues doing so until it detects that the most recent cast left amethyst behind, or you have <= 10 meta-evals remaining, so that if your CAD does any special things after casting it should still be able to use a bit of meta-eval for those.
You can use whatever stacking mediafy macro you like, though this hex assumes that you use one which does Entity -> (one iota) and does not interfere with the rest of the stack.

In testing, it consumed 377 meta-evals when supplying 60,005 dust worth of media to one of the big phials from the creative inventory, so I expect you should be able to use this with at least 80,000 dust phials before you start having to cast it multiple times, assuming minimal meta-eval usage from any special CAD features.
Patterns
qqqeeeqwaeawqaweeeeewaawwNumerical Reflection: 0deeedqqqaadaaNumerical Reflection: 2aadaaadaaqqqqwqqqqqaaNumerical Reflection: 64qqqqqaqdeeBookkeeper's Gambit: Keep 1eeeqwaeawqawdddeaqqNumerical Reflection: 64eaqaawBookkeeper's Gambit: Drop 1, Keep 1qaqaaaadaaddqddqdedNumerical Reflection: 0.125aadadaawqqqqqwdeddwwNumerical Reflection: 0deeedqqqqqwaeaeaeaeaeaqqqqqwdeddwwaadaaaqaeaqNumerical Reflection: 0eqqqNumerical Reflection: 0deeedeaqaaBookkeeper's Gambit: Drop 1dedqeeeqqqBookkeeper's Gambit: Drop 1aqaeeeeawdddeaqqqqaedNumerical Reflection: 10ewdwqqqdeaqqaqdeeeeeqwaeawqawdddeaqqeeeaadaadeaqq

Code: Select all

//fetch mote to split from
{
    <Amethyst Shard itemtype> //-
}
Flock's Disintegration
Stocktake Purification
Numerical Reflection: 0
Selection Distillation
{
    //facilitate further recursion
    Gemini Decomposition
    //get copy of mote
    Numerical Reflection: 2
    Fisherman's Gambit II
    //if mote contains less than 64 items, stop casting in order to avoid nulling references
    Gemini Decomposition
    Weighing Purification
    Numerical Reflection: 64
    Minimus Distillation II
    {
        Charon's Gambit
        Bookkeeper's Gambit: -
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit
    //split off mote and recharge from it
    Numerical Reflection: 64
    Splitting Gambit
    Bookkeeper's Gambit: v-
    Mind's Reflection
    Compass' Purification
    Gemini Decomposition
    Rotation Gambit II
    Return Item
    Numerical Reflection: 0.125 //aqaawdaddadd
    Dioscuri Gambit
    Zone Distillation: Item
    Numerical Reflection: 0
    Selection Distillation
    Recharge Item
    //count items, if there are any remaining, mediafy them and cease recursion. otherwise, signal to continue recursing.
    Zone Distillation: Item
    Gemini Decomposition
    Abacus Purification
    Numerical Reflection: 0
    Maximus Distillation
    {
        Numerical Reflection: 0
        Selection Distillation
        Stacking Mediafy
        Bookkeeper's Gambit: v
        False Reflection
    }
    {
        Bookkeeper's Gambit: v
        True Reflection
    }
    Augur's Exaltation
    Hermes' Gambit
    //cease recursion if there are fewer than 10 meta-evals available
    Thanatos' Reflection
    Numerical Reflection: 10
    Maximus Distillation
    Conjunction Distillation
    {
        Hermes' Gambit
        Charon's Gambit
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit
}
Gemini Decomposition
Hermes' Gambit

Re: Recursive Recharge

Posted: Fri Jul 14, 2023 10:16 pm
by beholderface
Unrolled Recharge
A version that uses halting loop unrolling instead of recursion in order to not worry about meta-eval, and as such can charge maxint phials without issue. Noticably more performance-intensive than the recursive version, so if you're not worrying about meta-eval and don't need to charge incredibly large things, you should probably use that instead.
Any stacking mediafy macro that works with the first version should work with this one.
Patterns
qqqeeeqwaeawqaweeeeewaawwNumerical Reflection: 0deeedqqqaadaaqqqqwqqqqqaaNumerical Reflection: 64qqqqqaqdeeBookkeeper's Gambit: Keep 1eeeqwaeawqawdddeaqqNumerical Reflection: 64eaqaawqaqaaaadaaddqddqdedNumerical Reflection: 0.125aadadaawqqqqqwdeddwwNumerical Reflection: 0deeedqqqqqwaeaeaeaeaeaqqqqqwdeddwwaadaaaqaeaqNumerical Reflection: 0eddqaaqqqBookkeeper's Gambit: Drop 1Numerical Reflection: 0deeedeaqaaBookkeeper's Gambit: Drop 1eeeaaqwqaaawdddeaqqqqqaqdeeBookkeeper's Gambit: Keep 1eeeqwaeawqawdddeaqqeeeNumerical Reflection: 900aadaadaaqqqqaeaqeeeqwaeawqNumerical Reflection: 899aadaadaaNumerical Reflection: 899ewdqdwedeaqqaadaaqaeaqdeaqqBookkeeper's Gambit: Drop 1

Code: Select all

//fetch mote to split from
{
    <Amethyst Shard itemtype> //-
}
Flock's Disintegration
Stocktake Purification
Numerical Reflection: 0
Selection Distillation
//pattern list to unroll
{
    //if mote contains less than 64 items, halt in order to avoid nulling references
    Gemini Decomposition
    Weighing Purification
    Numerical Reflection: 64
    Minimus Distillation II 
    {
        Charon's Gambit
        Bookkeeper's Gambit: -
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit 
    //split off mote and recharge from it
    Numerical Reflection: 64
    Splitting Gambit 
    Mind's Reflection
    Compass' Purification 
    Gemini Decomposition 
    Rotation Gambit II 
    Return Item 
    Numerical Reflection: 0.125 //aqaawdaddadd
    Dioscuri Gambit 
    Zone Distillation: Item 
    Numerical Reflection: 0
    Selection Distillation
    Recharge Item 
    //count remaining items, if there are any, mediafy them and halt, otherwise continue
    Zone Distillation: Item 
    Gemini Decomposition
    Abacus Purification
    Numerical Reflection: 0
    Maximus Distillation 
    Undertaker's Gambit 
    {
        //pattern to be extracted
        Bookkeeper's Gambit: v
        Numerical Reflection: 0
        Selection Distillation
        Stacking Mediafy
        Bookkeeper's Gambit: v
    }
    Speaker's Decomposition
    Augur's Exaltation  
    Hermes' Gambit 
    //act on the halt signal
    {
        Charon's Gambit
        Bookkeeper's Gambit: -
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit
}
Numerical Reflection: 900 
Gemini Gambit
{
    Combination Distillation
}
Flock's Disintegration
Numerical Reflection: 899 //(or you can just do 900 and subtract 1, since 899 is a much more complicated pattern than 900)
Gemini Gambit
Numerical Reflection: 899
Flock's Gambit
Hermes' Gambit
Gemini Decomposition
Combination Distillation
Hermes' Gambit
//delete the mote
Bookkeeper's Gambit: v