Page 1 of 1

Block Scan & Break

Posted: Tue Mar 21, 2023 7:08 am
by beholderface
This hex, designed for things like ancient debris mining, attempts to grab the item type of the entity you're looking at, then iterates over a 17x17x17 area centered on you, comparing each block against the entity you used. Each block that matches will then be broken and its drops teleported to you via a gate.
It is pretty performance intensive (on my machine with an i7 9700k, it takes ~3.1 seconds for the next tick of my superflat testing world), so please be considerate of others on servers.
Due to the fact that it uses normal Thoth's Gambit rather than any loop unrolling stuff for the item teleportation, it will trigger the recursion depth mishap if you use this in a space where it would mine more than ~400 blocks.

Code: Select all

//get items that already exist in order to remove them from list of items to grab after breaking target blocks
Mind's Reflection
Compass' Purification
Numerical Reflection: 16
Zone Distillation: Item
//get target block type and stick it in ravenmind
Mind's Reflection
Compass' Purification
Mind's Reflection
Alidade's Purification
Scout's Distillation
Physician's Purification
Huginn's Gambit
//produce the starting position
Vector Reflection -X
Vector Reflection -Y
Vector Reflection -Z
Additive Distillation
Additive Distillation
Numerical Reflection: 8
Multiplicative Distillation
Mind's Reflection
Compass' Purification
Additive Distillation
//initial loop index
Numerical Reflection: 0
{
    Gemini Decomposition
    Numerical Reflection: 17
    Modulus Distillation
    Prospector's Gambit
    Numerical Reflection: 17
    Division Distillation
    Floor Purification
    Numerical Reflection: 17
    Modulus Distillation
    Numerical Reflection: 2
    Fisherman's Gambit II
    Numerical Reflection: 289
    Division Distillation
    Floor Purification
    Vector Exaltation 
    Numerical Reflection: 2
    Fisherman's Gambit II
    Additive Distillation 
    Gemini Decomposition
    Surveyor's Purification
    Muninn's Reflection //get type of target block
    Equality Distillation
    {
        Break Block
        Bookkeeper's Gambit: v
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit
    Numerical Reflection: 1
    Additive Distillation
}
Numerical Reflection: 289
Gemini Gambit
{
    Combination Distillation
}
Flock's Disintegration
Numerical Reflection: 288
Gemini Gambit
Numerical Reflection: 288
Flock's Gambit 
Hermes' Gambit
Numerical Reflection: 17
Gemini Gambit
{
    Combination Distillation
}
Flock's Disintegration
Numerical Reflection: 16
Gemini Gambit
Numerical Reflection: 16
Flock's Gambit
Hermes' Gambit
Hermes' Gambit
//remove start pos and loop index
Bookkeeper's Gambit: vv
//get items currently present
Mind's Reflection
Compass' Purification
Numerical Reflection: 16
Zone Distillation: Item
//remove preexisting items from list
Undertaker's Gambit
Intersection Distillation
Exclusionary Distillation
{
    Gate's Opening
}
Jester's Gambit 
{
    //just a placeholder for gate iota
    Bookkeeper's Gambit: -
}
Flock's Disintegration
Rotation Gambit II
Thoth's Gambit
Bookkeeper's Gambit: v
Mind's Reflection
Compass' Purification
Gate's Closing

Re: Block Scan & Break

Posted: Tue Mar 28, 2023 9:57 pm
by 4ni0n
Here's the patterns for this, let me know if something's incorrect.
Mind's ReflectionCompass' PurificationNumerical Reflection: 16Zone Distillation: ItemMind's ReflectionCompass' PurificationMind's ReflectionAlidade's PurificationScout's DistillationqawdeHuginn's GambitVector Reflection -XVector Reflection -YVector Reflection -ZAdditive DistillationAdditive DistillationNumerical Reflection: 8Multiplicative Dstl.Mind's ReflectionCompass' PurificationAdditive DistillationNumerical Reflection: 0qqqGemini DecompositionNumerical Reflection: 17Modulus DistillationProspector's GambitNumerical Reflection: 17Division Dstl.Floor PurificationNumerical Reflection: 17Modulus DistillationNumerical Reflection: 2Fisherman's Gambit IINumerical Reflection: 289Division Dstl.Floor PurificationVector ExaltationNumerical Reflection: 2Fisherman's Gambit IIAdditive DistillationGemini DecompositionqaqqaeaMuninn's ReflectionEquality DistillationqqqBreak BlockBookkeeper's Gambit: Drop 1eeeFlock's DisintegrationAugur's ExaltationHermes' GambitNumerical Reflection: 1Additive DistillationeeeNumerical Reflection: 289Gemini GambitqqqCombination DistillationeeeFlock's DisintegrationNumerical Reflection: 288Gemini GambitNumerical Reflection: 288Flock's GambitHermes' GambitNumerical Reflection: 17Gemini GambitqqqCombination DistillationeeeFlock's DisintegrationNumerical Reflection: 16Gemini GambitNumerical Reflection: 16Flock's GambitHermes' GambitHermes' GambitBookkeeper's Gambit: Drop 2Mind's ReflectionCompass' PurificationNumerical Reflection: 16Zone Distillation: ItemUndertaker's GambitIntersection DistillationExclusionary DistillationqqqqaqeedeeeeJester's GambitqqqBookkeeper's Gambit: Keep 1eeeFlock's DisintegrationRotation Gambit IIThoth's GambitBookkeeper's Gambit: Drop 1Mind's ReflectionCompass' Purificationqqqwwqqqwqqawdedw

Re: Block Scan & Break

Posted: Tue Mar 28, 2023 10:11 pm
by beholderface
Looked through like 20% of that, didn't notice any errors, it's probably all correct ¯\_(ツ)_/¯
Though it occurs to me that with recent Hexal versions changing Physician's Purification from "entity type, or item type if input entity is an item" to just "entity type", the usage of it here should be replaced with Sorter's Purification.

Code: Select all

//get items that already exist in order to remove them from list of items to grab after breaking target blocks
Mind's Reflection
Compass' Purification
Numerical Reflection: 16
Zone Distillation: Item
//get target block type and stick it in ravenmind
Mind's Reflection
Compass' Purification
Mind's Reflection
Alidade's Purification
Scout's Distillation
Sorter's Purification
Huginn's Gambit
//produce the starting position
Vector Reflection -X
Vector Reflection -Y
Vector Reflection -Z
Additive Distillation
Additive Distillation
Numerical Reflection: 8
Multiplicative Distillation
Mind's Reflection
Compass' Purification
Additive Distillation
//initial loop index
Numerical Reflection: 0
{
    Gemini Decomposition
    Numerical Reflection: 17
    Modulus Distillation
    Prospector's Gambit
    Numerical Reflection: 17
    Division Distillation
    Floor Purification
    Numerical Reflection: 17
    Modulus Distillation
    Numerical Reflection: 2
    Fisherman's Gambit II
    Numerical Reflection: 289
    Division Distillation
    Floor Purification
    Vector Exaltation //stack state on first iteration: preexisting items, starting position, 0(loop index), [0,0,0](offset from starting position)
    Numerical Reflection: 2
    Fisherman's Gambit II
    Additive Distillation //preexisting items, starting pos, 0, (starting pos offset + starting pos)
    Gemini Decomposition
    Sorter's Purification //preexisting items, starting pos, 0, (starting pos offset + starting pos), type of that block
    Muninn's Reflection //add type of target block
    Equality Distillation
    {
        Break Block
        Bookkeeper's Gambit: v
    }
    Flock's Disintegration
    Augur's Exaltation
    Hermes' Gambit
    Numerical Reflection: 1
    Additive Distillation
}
Numerical Reflection: 289 //297
Gemini Gambit
{
    Combination Distillation
}
Flock's Disintegration
Numerical Reflection: 288 //296
Gemini Gambit
Numerical Reflection: 288 //296
Flock's Gambit //ewdqdwe
Hermes' Gambit
Numerical Reflection: 17
Gemini Gambit
{
    Combination Distillation
}
Flock's Disintegration
Numerical Reflection: 16
Gemini Gambit
Numerical Reflection: 16
Flock's Gambit
Hermes' Gambit
Hermes' Gambit //expected stack state: preexisting items, starting pos, loop index
//remove start pos and loop index
Bookkeeper's Gambit: vv
//get items currently present
Mind's Reflection
Compass' Purification
Numerical Reflection: 16
Zone Distillation: Item
//remove preexisting items from list
Undertaker's Gambit
Intersection Distillation
Exclusionary Distillation //stack state: new items
{
    Gate's Opening
}
Jester's Gambit //pattern list for thoth, new items
{
    //placeholder for gate iota
    Bookkeeper's Gambit: -
}
Flock's Disintegration
Rotation Gambit II
Thoth's Gambit
Bookkeeper's Gambit: v
Mind's Reflection
Compass' Purification
Gate's Closing
Mind's ReflectionCompass' PurificationNumerical Reflection: 16Zone Distillation: ItemMind's ReflectionCompass' PurificationMind's ReflectionAlidade's PurificationScout's DistillationqaqqaeaHuginn's GambitVector Reflection -XVector Reflection -YVector Reflection -ZAdditive DistillationAdditive DistillationNumerical Reflection: 8Multiplicative Dstl.Mind's ReflectionCompass' PurificationAdditive DistillationNumerical Reflection: 0qqqGemini DecompositionNumerical Reflection: 17Modulus DistillationProspector's GambitNumerical Reflection: 17Division Dstl.Floor PurificationNumerical Reflection: 17Modulus DistillationNumerical Reflection: 2Fisherman's Gambit IINumerical Reflection: 289Division Dstl.Floor PurificationVector ExaltationNumerical Reflection: 2Fisherman's Gambit IIAdditive DistillationGemini DecompositionqaqqaeaMuninn's ReflectionEquality DistillationqqqBreak BlockBookkeeper's Gambit: Drop 1eeeFlock's DisintegrationAugur's ExaltationHermes' GambitNumerical Reflection: 1Additive DistillationeeeNumerical Reflection: 289Gemini GambitqqqCombination DistillationeeeFlock's DisintegrationNumerical Reflection: 608Gemini GambitNumerical Reflection: 608Flock's GambitHermes' GambitNumerical Reflection: 17Gemini GambitqqqCombination DistillationeeeFlock's DisintegrationNumerical Reflection: 16Gemini GambitNumerical Reflection: 16Flock's GambitHermes' GambitHermes' GambitBookkeeper's Gambit: Drop 2Mind's ReflectionCompass' PurificationNumerical Reflection: 16Zone Distillation: ItemUndertaker's GambitIntersection DistillationExclusionary DistillationqqqqaqeedeeeeJester's GambitqqqBookkeeper's Gambit: Keep 1eeeFlock's DisintegrationRotation Gambit IIThoth's GambitBookkeeper's Gambit: Drop 1Mind's ReflectionCompass' Purificationqqqwwqqqwqqawdedw