So, I am trying to build a combination script for S&B, going off of envenoming script I found somewhere for DSLing. Here is what I have so far, and it doesn't work, though my instinct says it's something with the input, but for all I know it could be the entire thing that's wrong.
Could someone help me figure this out, please?
Input:
^d(\w+)(\w+)(\w+)(?: (\w+)|)$
Trigger body:
limb = nil
venom = nil
shieldArg = nil
if venomtree and shieldtree and limbtree then
venom = venomtree[matches[2]]
shieldArg = shieldtree[matches[3]]
if matches[4] then
limb = limbtree[matches[4]]
send("combination "..target.." slice "..limb.." "..venom.." smash "..shieldArg)
else
send("combination "..target.." slice "..venom.." smash")
end
else
venomtree = {
a = "aconite", --stupidity
b = "epseth", --shrivel legs
c = "curare", --paralysis
d = "darkshade", --sunlight allergy
e = "delphinium", --sleep
f = "digitalis", --shyness
g = "gecko", --slickness
h = "euphorbia", --vomitting
i = "eurypteria", --recklessness
j = "vernalius", --weakness
k = "kalmia", --asthma
l = "larkspur", --dizziness
m = "monkshood", --disloyalty
n = "epteth", --shivel arms
o = "oculus", --sight restored
p = "prefarar", --sensitivity
q = "notechis", --haemophilia
r = "vardrax", --addiction
s = "slike", --anorexia
t = "selarnia", --animal spirit disruption
x = "xentio", --clumsiness
}
shieldtree = {
h = "high", --lose focus balance
m = "mid", --paralysis
l = "low", --clumsiness
}
limbtree = {
ll = "left leg",
rl = "right leg",
la = "left arm",
ra = "right arm",
h = "head",
t = "torso",
}
venom = venomtree[matches[2]]
shieldArg = shieldtree[matches[3]]
if matches[4] then
limb = limbtree[matches[4]]
send("combination "..target.." slice "..limb.." "..venom.." smash "..shieldArg)
else
send("combination "..target.." slice "..venom.." smash")
end
end
Comments
There are two problems with the way you have it. First, there are four matches and you only use 3 (and it always expects the third match, for limbs, to be there, only the fourth unused match is optional).
Second, \w+ matches one or more of any alphanumeric character, and tries to match as much as possible, in order from left to right. So if you tried to do dshrl for stupidity/high/right leg, the first match would be sh, the second match would be r, and the third match would be l, and none of those will be found in the tables.
Just realized I have some super messy regex I could probably clean up. That jester throwing stuff I wrote at the start of Xith is hilarious, yet functional.
^(del|cur|pre|ept|eps|aco|kal|sli|gek|mon|voy|ver|dar|eur|lar|ole|xen|occ|sel|dig|var)(del|cur|pre|ept|eps|aco|kal|sli|gek|mon|voy|ver|dar|eur|lar|ole|xen|occ|sel|dig|var)(del|cur|pre|ept|eps|aco|kal|sli|gek|mon|voy|ver|dar|eur|lar|ole|xen|occ|sel|dig|var)$
So pro. But (\w\w\w)(\w\w\w)(\w\w\w) would work better and pull from a single venom table just fine.
His 1-letter venoms make me angry though.
The prototype for my next-gen serpent/apostate/alchemist input system (being worn by some asian guy).
should be
venom = "asdf"
Results of disembowel testing | Knight limb counter | GMCP AB files