So I'm trying to get some coding together so I can get a trigger for a cecho that tells me when someone or something puts up a pentagram or circle and when that pentagram/circle goes down. So far I have something, but I'm not sure why it isn't working. I need one for players, and one for hunting. (Not sure if they will be different.) I use itar <creature name> for targetting while hunting and tar <player> for targetting during combat.
For hunting I have this
for line 0: ^(.+) mutters and traces a cobalt blue pentagram in the air that remains hovering before (him|her)\.$
for line 1: ^Spreading (his|her) arms wide\, (.+) spins clockwise and a shimmering white orb springs up around (him|her)\.$
I have both set to perl regex
For the code, I have:
if string.lower("" .. matches[2] .. "") == string.lower("" ..itar.. "") then deleteLine()
cecho("\n <medium_violet_red> ------------------------------------------------ \n")
cecho("\n <medium_violet_red> | TARGET SHIELDUP TARGET SHIELDUP |\n")
cecho("\n <medium_violet_red> ------------------------------------------------ \n")
end
Comments
cecho("\n <medium_violet_red> ------------------------------------------------ \n")
cecho("\n <medium_violet_red> | TARGET SHIELDUP TARGET SHIELDUP |\n")
cecho("\n <medium_violet_red> ------------------------------------------------ \n")
Eg, if your target is 'merian', you can have the different types of merian, 'A merian bravo mutters and traces...'
Try
if string.find(matches[2], itar) then
YOUR CODE HERE
end
if string.find(matches[2], itar) then
deleteLine()
cecho("\n <medium_violet_red> ------------------------------------------------ \n")
cecho("\n <medium_violet_red> | TARGET SHIELDUP TARGET SHIELD UP |\n")
cecho("\n <medium_violet_red> ------------------------------------------------ \n")
end
Is everything correct?
Try
itar = matches[2]
echo ("Target: " ..itar)
(Just tested this to verify that it does indeed work)
eg:
Using these lines:
^.* mutters and traces a cobalt blue pentagram in the air that remains hovering before (\w+)\.$
^Spreading (\w+) arms wide, .* spins clockwise and a shimmering white orb springs up around (\w+)\.$
^Eyes glowing red, .* bellows and a shield of protection flickers into view around (\w+) form\.$