|
goten Beginner
Joined: 28 Jul 2009 Posts: 13
|
Posted: Tue Jul 28, 2009 7:03 pm
trigger matching string |
hello i'm new to zmud so any help is appreciated:
want to trigger this text:
1191h, 1329m ceda ->this would set my variable equilibrium to 1
1191h, 1329m cdab ->this would set my variable equilibrium to 0
I want the trigger to recognize when it misses the E letter |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Tue Jul 28, 2009 9:46 pm |
#TR {(%d)h, (%d)m (%w)} {
#IF (%3="ceda") {equilibrium=1}
#IF (%3="cdab") {equilibrium=0}
} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
goten Beginner
Joined: 28 Jul 2009 Posts: 13
|
Posted: Tue Jul 28, 2009 9:56 pm |
I think I need something more complex cause the chars change.... like 1275h, 1223m bcdefil({-})
what I noticed is that they go in order...
I am trying something like this #TRIGGER {*h, *m* [a..b][c..d][f..z -()}{]*} {
eq1="off"
#if (@eq1="on") {eq2=on} {eq2=off}
}
but I found out this symbol { doesn't work in here []....
is there something like this[a..z] but for symbols ? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Jul 28, 2009 10:21 pm |
#REGEX {\d+h, \d+m ?(b)?(c)?(d)?(e)?(f)?(i)?(l)?(?:\(\{-\}\))?} {eq=%4}
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Tue Jul 28, 2009 10:24 pm |
you are only looking for the e right?
try
#IF (%match(%3, "e")) {equilibrium=1} {equilibrium=0} |
|
_________________ Discord: Shalimarwildcat |
|
|
|
goten Beginner
Joined: 28 Jul 2009 Posts: 13
|
Posted: Tue Jul 28, 2009 10:41 pm |
thanks for help
but hmm none of those two seem to work, i'm probably doing something wrong... :(
to be more precise I need something like this:
1275h, 1223m in this part I have: [a..d]e[f..z][any symbol] if true #sa eq on
[a..d][f..z][any symbol] if true #sa eq off
thanks for help |
|
|
|
goten Beginner
Joined: 28 Jul 2009 Posts: 13
|
Posted: Tue Jul 28, 2009 10:52 pm |
you are only looking for the e right?
try
#IF (%match(%3, "e")) {equilibrium=1} {equilibrium=0}
this one works almost all the time but it doesn't work when it looks like this:
1275h, 1223m - or 1275h, 1223m (-) that means it needs at least one letter to work properly
like 1275h, 1223m i- |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Tue Jul 28, 2009 10:55 pm |
#TR {(%d)h, (%d)m (*)} {#IF (%match(%3, "e")) {equilibrium=1} {equilibrium=0}}
that should do it then |
|
_________________ Discord: Shalimarwildcat |
|
|
|
goten Beginner
Joined: 28 Jul 2009 Posts: 13
|
Posted: Tue Jul 28, 2009 10:55 pm |
changed trigger text from (%d)h, (%d)m (%w) to (%d)h, (%d)m (%3)
and it seems to work perfectly THANKS !!!!! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Tue Jul 28, 2009 10:57 pm |
you dont wanna use %3 in the trigger pattern, use *
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
goten Beginner
Joined: 28 Jul 2009 Posts: 13
|
Posted: Tue Jul 28, 2009 10:57 pm |
both (*) and (%3) work good
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Tue Jul 28, 2009 10:57 pm |
bah duplicate... using %3 in the pattern is not good code
|
|
_________________ Discord: Shalimarwildcat
Last edited by shalimar on Tue Jul 28, 2009 10:57 pm; edited 1 time in total |
|
|
|
goten Beginner
Joined: 28 Jul 2009 Posts: 13
|
Posted: Tue Jul 28, 2009 10:57 pm |
ok thanks
|
|
|
|
|
|