Re: Macro Megathread
Posted: Mon Jan 22, 2024 3:02 am
I posted these spells in their own thread last year, but that thread is now totally buried. Given how useful they are as macros, I thought I'd repost them here. Credit for Locator's Scalpel goes to [object Object], not myself, though I changed the macro pattern to a new one that better fits the theme of the other two.
Robo's Scalpel
list, num, list → list
Works just like Surgeon's Exaltation, but replaces the given index in the first list with the flattened content of the second list. Mainly intended for modifying spells, but you can probably find some other interesting uses.
Advanced Scalpel
list, num, num, list → list
A more powerful version of the above spell. Replaces all the items in the first list between the two provided indices (lower bound inclusive, upper bound exclusive) with the flattened content of the second list.
Locator's Scalpel
list, pattern, list → list
Modified version of Robo's Scalpel that takes a pattern instead of an index, and replaces the first index of that pattern in the first list with the contents of the second list. (As with the original, does not fail gracefully.)
Robo's Scalpel
list, num, list → list
Works just like Surgeon's Exaltation, but replaces the given index in the first list with the flattened content of the second list. Mainly intended for modifying spells, but you can probably find some other interesting uses.
Patterns
Code: Select all
#define Robo's Scalpel (EAST wwded) = list, num, list -> list
{
Rotation Gambit II
Dioscuri Gambit
Numerical Reflection: 1
Additive Distillation
Prospector's Gambit
Abacus Purification
Selection Exaltation
Rotation Gambit II
Numerical Reflection: 0
Jester's Gambit
Selection Exaltation
Rotation Gambit II
Combination Distillation
Combination Distillation
}
list, num, num, list → list
A more powerful version of the above spell. Replaces all the items in the first list between the two provided indices (lower bound inclusive, upper bound exclusive) with the flattened content of the second list.
Patterns
Code: Select all
#define Advanced Scalpel (EAST wwdewdda) = list, num, num, list -> list
{
Numerical Reflection: 21
Swindler's Gambit
Gemini Decomposition
Rotation Gambit
Prospector's Gambit
Abacus Purification
Selection Exaltation
Rotation Gambit II
Numerical Reflection: 0
Rotation Gambit
Selection Exaltation
Rotation Gambit II
Combination Distillation
Combination Distillation
}
list, pattern, list → list
Modified version of Robo's Scalpel that takes a pattern instead of an index, and replaces the first index of that pattern in the first list with the contents of the second list. (As with the original, does not fail gracefully.)
Patterns
Code: Select all
#define Locator's Scalpel (EAST wwdedqde) = list, pattern, list -> list
{
Rotation Gambit II
Prospector's Gambit
Jester's Gambit
Locator's Distillation
Dioscuri Gambit
Numerical Reflection: 1
Additive Distillation
Prospector's Gambit
Abacus Purification
Selection Exaltation
Rotation Gambit II
Numerical Reflection: 0
Jester's Gambit
Selection Exaltation
Rotation Gambit II
Combination Distillation
Combination Distillation
}