Pattern:^e (.+)$
local vibes={
dissipate="outr pentagon;spin pentagon;embed dissipate",
palpitation="outr cylinder;spin cylinder;embed palpitation",
heat="outr pyramid;spin pyramid;embed heat",
alarm="outr spiral;spin spiral;embed alarm",
tremors="outr disc;outr egg;spin disc;spin egg;embed tremors;inr disc",
reverberation="outr disc;outr pentagon;spin disc;spin pentagon;embed reverberation",
adduction="outr disc;outr polyhedron;spin disc;spin polyhedron;embed adduction",
harmonyheal="outr egg;outr sphere;spin egg;spin sphere;embead harmony;tune harmony healing",
harmonyrestoration="outr egg;outr sphere;spin egg;spin sphere;embead harmony;tune harmony restoration",
creeps="outr torus;spin torus;embed creeps",
silence="outr egg;spin egg;embed silence",
revelation="outr cube;outr diamond;embed revelation",
grounding="outr sphere;spin sphere;embed grounding",
oscillate="outr diamond;spin diamond;embed oscillate",
focus="outr pyramid;spin pyramid;embed focus",
disorentation="outr spiral;spin spiral;embed disorentation",
damage="outr pentagon;outr cylinder;spin pentagon;spin cylinder; embed dissipate;queue add eq embed palpitation",
}
if matches[2] then
send(vibes[matches[2]])
end
I have only scripted what I have up to at the moment. Wondering if there was an easier way to do this, or if this is genrally it?
I have dampen in a separate alias workup, generally the same as above, but shorter, again dampening individually.
Comments
one suggestion is that you shorten the name for the vibe so e dissipate becomes e dis or whatever is easy for you to remember
I mean I have already started to build the damage vibes into one summoning and working on affliction.
since doing:
would be equivalent to setting:
If you don't have a variable called grounding set up already, that should be throwing an error because vibes[nil] can't be assigned a value.
Syntax/spelling aside, that seems to be a pretty efficient way to handle it, although since efficiency isn't really vital in an alias you're running at most a few times a second, you could change it to the following if you found that it improved readability for you:
Not sure there is an objectively best way to do this particular task really.
{ star = "star" } is equivalent to { ["star"] = "star" }
You can test it to see.
limbC = {["right leg"] = 6, ["right arm"] = 3, head = 0}
etc. All function the same way, but now you can, for example have a trigger that does:
You swing giant weapon at victim's right leg.
You swing giant weapon at victim's head.
Use a catch-all trigger of: ^You swing (.+) at \w+'s (.+).$
Then rather searching the table, you can just do limbC[matches[3]] = limbC[matches[3]] + 1
I'm really, really not a fan of when people define tables inside an alias/trigger/etc. Initialising a table every single time you run the alias just seems wasteful; create a script object that initialises the table and actually stores it in memory, and use that every time. I'm also a fan of namespaces since they reduce the chances of conflicts with other people's scripts and their variables.
I'd likely do something like this:
Uses a namespace, keeps the list of crystals around (this is useful information for other things you might want to do, such as determining which vibe(s) an opponent Magi is embedding), and also allows mapping shortnames to full vibe names easily. Your alias would just have vibes.embed(matches[2]) as the code.
Results of disembowel testing | Knight limb counter | GMCP AB files
though I'm trying to figure out if I can work with that on multiple step ones.. Like Harmony where it requires tuning:
Thank you
Results of disembowel testing | Knight limb counter | GMCP AB files
cmd_sep="|"
function magi.embed(vibe, misc)
local command = ""
for i, crystal in ipairs(magi.crystals[vibe]) do
command = command.."outr "..crystal..cmd_sep.."spin "..crystal..cmd_sep
end
if misc ~= nil and vibe == "sonicportal" then
command = command.."embed "..vibe.." "..misc
else
command = command.."embed "..vibe
end
send("queue add eqbal stand"..cmd_sep..command)
end
magi.crystals = {
["dissipate"] = { "pentagon" },
["palpitation"] = { "cylinder" },
["heat"] = { "pyramid" },
["alarm"] = { "spiral" },
["tremors"] = { "disc", "egg" },
["reverberation"] = { "disc", "pentagon" },
["sonicportal"] = { "sphere", "torus" },
["adduction"] = { "disc", "polyhedron" },
["harmony"] = { "egg", "sphere" },
["creeps"] = { "torus" },
["silence"] = { "egg" },
["revelation"] = { "cube", "diamond" },
["grounding"] = { "sphere" },
["oscillate"] = { "diamond" },
["focus"] = { "pyramid" },
["energise"] = { "polyhedron"},
["stridulation"] = { "cylinder", "polyhedron" },
["gravity"] = { "egg", "torus" },
["forest"] = { "diamond", "pyramid" },
["dissonance"] = { "cylinder", "sphere", "spiral" },
["plague"] = { "cube", "pyramid", "spiral" },
["lullaby"] = { "pyramid" },
["retardation"] = { "disc" },
["disorientation"] = { "spiral" },
["forest"] = { "diamond", "pyramid" },
}