Zacc2008-03-22 06:34:16
Alright, so I figured out how to get triggers to call scripts, and how to use the arguments for the scripts. However, I'm having a problem with something that shouldn't be very difficult. I can't figure out what's wrong, and I've tried a handful of different subroutines, all of which should have worked in theory.
I'm fairly confident it's the trigger line that's not catching (it's not setting variables at all). I managed to get it to work once, but that's because I dumbed it down into a very very basic trigger without regular expressions. I've tried all sorts of combinations to find the right expression, but only the basic ones have worked so far, as long as there's no other trigger that could match it. I need it so that it will catch the line even if the attack does one or two afflictions instead of three. I created three seperate triggers, and they didn't work together. I did just one (with the 3 afflictions/variables) and it caught those. I really don't know why it's not catching them... other than maybe there's a conflict where one line is picking all three afflictions as %2, another is grabbing two as %3, and the third is grabbing each seperately and working.
Here's what I have so far:
* weaves a glamour of radiant prismatic colours, dazzling you with a burst of *, *, and *.
setvariable "colour1", "%2"
setvariable "colour2", "%3"
setvariable "colour3", "%4"
call glamours (a, b, c)
<--- (It caught this one only when I had the setvariable as %1, %2, %3 instead of starting with %2 (the actual affliction)).
* weaves a glamour of radiant prismatic colours, dazzling you with a burst of *, and *.
setvariable "colour1", "%2"
setvariable "colour2", "%3"
call glamours (a, b, c)
(Doesn't catch at all).
* weaves a glamour of radiant prismatic colours, dazzling you with a burst of *.
setvariable "colour1", "%2"
call glamours (a, b, c)
(Same as above).
Sub glamours (a, b, c)
colour1 = getvariable ("colour1")
colour2 = getvariable ("colour2")
colour3 = getvariable ("colour3")
if colour1 = "incandescent blue striations" then
setvariable "recklessness", "1"
end if
if colour1 = "bright yellow flashes" then
setvariable "dementia", "1"
end if
if colour1 = "emerald green iridescence" then
setvariable "epilepsy", "1"
end if
if colour1 = "vibrant orange hues" then
setvariable "stupidity", "1"
end if
if colour1 = "lustrous violet swirls" then
setvariable "dizziness", "1"
end if
if colour1 = "scarlet red light" then
setvariable "paralysis", "1"
end if
if colour2 = "incandescent blue striations" then
setvariable "recklessness", "1"
end if
if colour2 = "bright yellow flashes" then
setvariable "dementia", "1"
end if
if colour2 = "emerald green iridescence" then
setvariable "epilepsy", "1"
end if
if colour2 = "vibrant orange hues" then
setvariable "stupidity", "1"
end if
if colour2 = "lustrous violet swirls" then
setvariable "dizziness", "1"
end if
if colour2 = "scarlet red light" then
setvariable "paralysis", "1"
end if
if colour3 = "incandescent blue striations" then
setvariable "recklessness", "1"
end if
if colour3 = "bright yellow flashes" then
setvariable "dementia", "1"
end if
if colour3 = "emerald green iridescence" then
setvariable "epilepsy", "1"
end if
if colour3 = "vibrant orange hues" then
setvariable "stupidity", "1"
end if
if colour3 = "lustrous violet swirls" then
setvariable "dizziness", "1"
end if
if colour3 = "scarlet red light" then
setvariable "paralysis", "1"
end if
end sub
That script seemed a little too long and had too many "if"s in it (though, it did work), so I changed it to this:
Sub glamours (a, b, c)
colour1 = getvariable ("colour1")
colour2 = getvariable ("colour2")
colour3 = getvariable ("colour3")
if colour1 = "incandescent blue striations" OR colour2 = "incandescent blue striations" OR colour3 = "incandescent blue striations" then
setvariable "recklessness", "1"
end if
if colour1 = "bright yellow flashes" OR colour2 = "bright yellow flashes" OR colour3 = "bright yellow flashes" then
setvariable "dementia", "1"
end if
if colour1 = "emerald green iridescence" OR colour2 = "emerald green iridescence" OR colour3 = "emerald green iridescence" then
setvariable "epilepsy", "1"
end if
if colour1 = "vibrant orange hues" OR colour2 = "vibrant orange hues" OR colour3 = "vibrant orange hues" then
setvariable "stupidity", "1"
end if
if colour1 = "lustrous violet swirls" OR colour2 = "lustrous violet swirls" OR colour3 = "lustrous violet swirls" then
setvariable "dizziness", "1"
end if
if colour1 = "scarlet red light" OR colour2 = "scarlet red light" OR colour3 = "scarlet red light" then
setvariable "paralysis", "1"
end if
end sub
Haven't been able to get the trigger to catch, so I'm not sure if this one will work.
Which expression should I be using in the trigger for strings I want to capture?
Edit: I suppose I could just use the colours and trigger those, but I dislike using small triggers like that. They have a habit of being set off when they shouldn't be (such as people saying "paranoid." over CT).
I'm fairly confident it's the trigger line that's not catching (it's not setting variables at all). I managed to get it to work once, but that's because I dumbed it down into a very very basic trigger without regular expressions. I've tried all sorts of combinations to find the right expression, but only the basic ones have worked so far, as long as there's no other trigger that could match it. I need it so that it will catch the line even if the attack does one or two afflictions instead of three. I created three seperate triggers, and they didn't work together. I did just one (with the 3 afflictions/variables) and it caught those. I really don't know why it's not catching them... other than maybe there's a conflict where one line is picking all three afflictions as %2, another is grabbing two as %3, and the third is grabbing each seperately and working.
Here's what I have so far:
* weaves a glamour of radiant prismatic colours, dazzling you with a burst of *, *, and *.
setvariable "colour1", "%2"
setvariable "colour2", "%3"
setvariable "colour3", "%4"
call glamours (a, b, c)
<--- (It caught this one only when I had the setvariable as %1, %2, %3 instead of starting with %2 (the actual affliction)).
* weaves a glamour of radiant prismatic colours, dazzling you with a burst of *, and *.
setvariable "colour1", "%2"
setvariable "colour2", "%3"
call glamours (a, b, c)
(Doesn't catch at all).
* weaves a glamour of radiant prismatic colours, dazzling you with a burst of *.
setvariable "colour1", "%2"
call glamours (a, b, c)
(Same as above).
Sub glamours (a, b, c)
colour1 = getvariable ("colour1")
colour2 = getvariable ("colour2")
colour3 = getvariable ("colour3")
if colour1 = "incandescent blue striations" then
setvariable "recklessness", "1"
end if
if colour1 = "bright yellow flashes" then
setvariable "dementia", "1"
end if
if colour1 = "emerald green iridescence" then
setvariable "epilepsy", "1"
end if
if colour1 = "vibrant orange hues" then
setvariable "stupidity", "1"
end if
if colour1 = "lustrous violet swirls" then
setvariable "dizziness", "1"
end if
if colour1 = "scarlet red light" then
setvariable "paralysis", "1"
end if
if colour2 = "incandescent blue striations" then
setvariable "recklessness", "1"
end if
if colour2 = "bright yellow flashes" then
setvariable "dementia", "1"
end if
if colour2 = "emerald green iridescence" then
setvariable "epilepsy", "1"
end if
if colour2 = "vibrant orange hues" then
setvariable "stupidity", "1"
end if
if colour2 = "lustrous violet swirls" then
setvariable "dizziness", "1"
end if
if colour2 = "scarlet red light" then
setvariable "paralysis", "1"
end if
if colour3 = "incandescent blue striations" then
setvariable "recklessness", "1"
end if
if colour3 = "bright yellow flashes" then
setvariable "dementia", "1"
end if
if colour3 = "emerald green iridescence" then
setvariable "epilepsy", "1"
end if
if colour3 = "vibrant orange hues" then
setvariable "stupidity", "1"
end if
if colour3 = "lustrous violet swirls" then
setvariable "dizziness", "1"
end if
if colour3 = "scarlet red light" then
setvariable "paralysis", "1"
end if
end sub
That script seemed a little too long and had too many "if"s in it (though, it did work), so I changed it to this:
Sub glamours (a, b, c)
colour1 = getvariable ("colour1")
colour2 = getvariable ("colour2")
colour3 = getvariable ("colour3")
if colour1 = "incandescent blue striations" OR colour2 = "incandescent blue striations" OR colour3 = "incandescent blue striations" then
setvariable "recklessness", "1"
end if
if colour1 = "bright yellow flashes" OR colour2 = "bright yellow flashes" OR colour3 = "bright yellow flashes" then
setvariable "dementia", "1"
end if
if colour1 = "emerald green iridescence" OR colour2 = "emerald green iridescence" OR colour3 = "emerald green iridescence" then
setvariable "epilepsy", "1"
end if
if colour1 = "vibrant orange hues" OR colour2 = "vibrant orange hues" OR colour3 = "vibrant orange hues" then
setvariable "stupidity", "1"
end if
if colour1 = "lustrous violet swirls" OR colour2 = "lustrous violet swirls" OR colour3 = "lustrous violet swirls" then
setvariable "dizziness", "1"
end if
if colour1 = "scarlet red light" OR colour2 = "scarlet red light" OR colour3 = "scarlet red light" then
setvariable "paralysis", "1"
end if
end sub
Haven't been able to get the trigger to catch, so I'm not sure if this one will work.
Which expression should I be using in the trigger for strings I want to capture?
Edit: I suppose I could just use the colours and trigger those, but I dislike using small triggers like that. They have a habit of being set off when they shouldn't be (such as people saying "paranoid." over CT).
Unknown2008-03-23 02:45:19
Not sure about your pattern matching problems, but I may have an improvement for you.
When it comes to if statements, you have to ask yourself a question: can it be more than one value when it's checked?
Think of it like this.. If you're calling a function to check a value, and it can be 10 different values, but when called, it can only be one of ten, you're going to want to find the value it is, and then stop right there, ignoring the rest of the checks.. This is where you use elseif statements.
Just a basic example
if value == 1
do this
if value == 2
do this
et cetera...
Assuming this was real code, in that example, even if it matches value on the first check, its going to continue to check it at every other if statement.
The improved version would be..
if value == 1
do this
elseif value == 2
do this
et cetera...
See, in this one, if it matches the value on the first check, it will ignore following elseif statements and move down to the next set of instructions. Very handy to do! There is no need to check value again, it equals 1, thus it can't equal 2, why should I have it check if it does when I know it doesn't?
When it comes to if statements, you have to ask yourself a question: can it be more than one value when it's checked?
Think of it like this.. If you're calling a function to check a value, and it can be 10 different values, but when called, it can only be one of ten, you're going to want to find the value it is, and then stop right there, ignoring the rest of the checks.. This is where you use elseif statements.
Just a basic example
if value == 1
do this
if value == 2
do this
et cetera...
Assuming this was real code, in that example, even if it matches value on the first check, its going to continue to check it at every other if statement.
The improved version would be..
if value == 1
do this
elseif value == 2
do this
et cetera...
See, in this one, if it matches the value on the first check, it will ignore following elseif statements and move down to the next set of instructions. Very handy to do! There is no need to check value again, it equals 1, thus it can't equal 2, why should I have it check if it does when I know it doesn't?
Mariello2008-03-23 04:11:40
This is what I have for the glamours lines
flags:
regex
keep eval
I have like 4 of these, one for each amount of afflictions the colourburst can give. I just match the color and these triggers work since the colors always come in a set of three words ie. dazzling orange swirls (not sure if that is right but you get the point). Now for each trigger I do this
There are five arguments total. The first one is the attacker and the other 4 are the colors I matched. Depending on the tigger would determine whether it is "%1" or "none"
For the script, I have
affon ("affliction") just sets the affliction variable to 1 after some evaluation.
Edit: as a side note, I think your triggers would work if you convert to regex and use the keep evaluating flag. OR you could convert it to reg ex, and sequence each trigger unflagging the keep evaluating flag. You'd want the longer glamour trigger (one with 4 afflictions) at a lower sequence than the others.
CODE
^(\\w+) weaves a glamour of radiant prismatic colours\\, dazzling you with a burst of \\w+ (\\w+) \\w+\\, \\w+ (\\w+) \\w+\\, and \\w+ (\\w+) \\w+\\.$
flags:
regex
keep eval
I have like 4 of these, one for each amount of afflictions the colourburst can give. I just match the color and these triggers work since the colors always come in a set of three words ie. dazzling orange swirls (not sure if that is right but you get the point). Now for each trigger I do this
CODE
call glamours ("%1", "%2", "%3", "none", "none")
There are five arguments total. The first one is the attacker and the other 4 are the colors I matched. Depending on the tigger would determine whether it is "%1" or "none"
For the script, I have
CODE
sub glamours (attacker, aff1, aff2, aff3, aff4)
if aff1 = "indigo" OR aff2 = "indigo" OR aff3 = "indigo" OR aff4 = "indigo" then
world.note "Damage"
end if
if aff1 = "blue" OR aff2 = "blue" OR aff3 = "blue" OR aff4 = "blue" then
call affon ("reckless")
end if
if aff1 = "yellow" OR aff2 = "yellow" OR aff3 = "yellow" OR aff4 = "yellow" then
call affon ("dementia")
end if
if aff1 = "green" OR aff2 = "green" OR aff3 = "green" OR aff4 = "green" then
call affon ("epilepsy")
end if
if aff1 = "orange" OR aff2 = "orange" OR aff3 = "orange" OR aff4 = "orange" then
call affon ("stupidity")
end if
if aff1 = "violet" OR aff2 = "violet" OR aff3 = "violet" OR aff4 = "violet" then
call affon ("dizziness")
end if
if aff1 = "red" OR aff2 = "red" OR aff3 = "red" OR aff4 = "red" then
call affon ("paralysis")
end if
end sub
if aff1 = "indigo" OR aff2 = "indigo" OR aff3 = "indigo" OR aff4 = "indigo" then
world.note "Damage"
end if
if aff1 = "blue" OR aff2 = "blue" OR aff3 = "blue" OR aff4 = "blue" then
call affon ("reckless")
end if
if aff1 = "yellow" OR aff2 = "yellow" OR aff3 = "yellow" OR aff4 = "yellow" then
call affon ("dementia")
end if
if aff1 = "green" OR aff2 = "green" OR aff3 = "green" OR aff4 = "green" then
call affon ("epilepsy")
end if
if aff1 = "orange" OR aff2 = "orange" OR aff3 = "orange" OR aff4 = "orange" then
call affon ("stupidity")
end if
if aff1 = "violet" OR aff2 = "violet" OR aff3 = "violet" OR aff4 = "violet" then
call affon ("dizziness")
end if
if aff1 = "red" OR aff2 = "red" OR aff3 = "red" OR aff4 = "red" then
call affon ("paralysis")
end if
end sub
affon ("affliction") just sets the affliction variable to 1 after some evaluation.
Edit: as a side note, I think your triggers would work if you convert to regex and use the keep evaluating flag. OR you could convert it to reg ex, and sequence each trigger unflagging the keep evaluating flag. You'd want the longer glamour trigger (one with 4 afflictions) at a lower sequence than the others.
Zacc2008-03-23 05:43:39
There's one that gives 4 afflictions? I haven't seen that yet... Ouch.
Interesting.
I haven't tinkered around with sequencing yet. It's a little over my head, but I'll give it a try. I've been using one of the free systems (Ethelon's, I think) to get a rough idea of what does what. I tried to create a subroutine similar to the rune one in that system. Unfortunately, I can't figure out why it's not catching, even if I do use the regular expressions (I've tried it with (.*?), (\\w+), and one other I can't remember).
For the expressions in the trigger, would (.*?) work? My main problem is forming the expressions. I can't figure out what to use and what not to use. Should I put a parenthesis here or a backslash there.. etc etc. I found the trigger tester to be of great use, though.
Edit: Actually, I think I've figured out what's wrong. After looking at your example, I noticed I don't have a backslash between my variable and commas and periods. Maybe that's the problem... I'll try it and find out.
Interesting.
I haven't tinkered around with sequencing yet. It's a little over my head, but I'll give it a try. I've been using one of the free systems (Ethelon's, I think) to get a rough idea of what does what. I tried to create a subroutine similar to the rune one in that system. Unfortunately, I can't figure out why it's not catching, even if I do use the regular expressions (I've tried it with (.*?), (\\w+), and one other I can't remember).
For the expressions in the trigger, would (.*?) work? My main problem is forming the expressions. I can't figure out what to use and what not to use. Should I put a parenthesis here or a backslash there.. etc etc. I found the trigger tester to be of great use, though.
Edit: Actually, I think I've figured out what's wrong. After looking at your example, I noticed I don't have a backslash between my variable and commas and periods. Maybe that's the problem... I'll try it and find out.