|
Sylmannemo Beginner
Joined: 20 Oct 2006 Posts: 18
|
Posted: Thu Apr 23, 2009 9:31 pm
Multi-Fire reflexes on the same line. |
I'm having trouble geting reflexes to fire multiple times on the same line. Instances being a case where I'm given a list of names such as this.
Quote: |
Kabal, Saito, Jalanon, Maleah, Xohln, Thun, Belteshazzar, Velvet, Malekith
|
Code: |
#TRIGGER {You see the following people here:} {#var NameCheck %null}
#COND {([A-Za-z\( ]+)} {
#VAR NameCheck {%concat( @NameCheck, "%1")}
#IF (%pos( ",", @NameCheck)) {
#VAR NameCheck {%subregex( @NameCheck, "[^\w]+", "|")}
#T- whomhere
}
} {within|param=3|regex}
|
Honestly, it's not a script I wrote there, I'm not entirely sure what all of that's doing, but it's definitely not doing all of what I want.
Other tries included
Code: |
#TRIGGER {(%w){,|.}} {#if (%ismember(%1, @Citizens)=0) {enemy %1}} "" {reparse}
|
And it finally devolved into
Code: |
#REGEX {^(\w+)(\,|\.)(\s)(\w+)(\,|\.)(\s)(\w+)(\,|\.)(\s)(\w+)(\,|\.)(\s)(\w+)(\,|\.)(\s)(\w+)(\,|\.)(\s)(\w+)(\,|\.)(\s)(\w+)(\,|\.)(\s)(\w+)(\,|\.)(\s)(\w+)(\,|\.)}
|
I'd like to clean it up into a working version with something like what the second one does. I need to run the list of names against a check, but I know how to do all that, I just can't get a single reflex to fire multiple times on the same line for some reason, even with reparsing. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4701 Location: Pensacola, FL, USA
|
Posted: Thu Apr 23, 2009 9:36 pm |
did you check the 'repeat within line' option for the trigger?
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Sylmannemo Beginner
Joined: 20 Oct 2006 Posts: 18
|
Posted: Thu Apr 23, 2009 9:39 pm |
I'm both relieved and disappointed that I don't seem to have that option.
Relived I didn't miss such an obvious thing, disappointed that I don't have such an obvious solution. zMUD 7.21?
My options are, Case sensitive, ANSI trigger, Temporary, Verbatim and Trigger on Trigger. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Apr 24, 2009 3:18 am |
Far too complex. If all you want is a list of names that you can use, say, #forall on, all you need to do is use * to get the whole line, and then use %subchar(the whole line,", ","|") to get rid of the commas and spaces. You then have a list of all the people.
|
|
|
|
Sylmannemo Beginner
Joined: 20 Oct 2006 Posts: 18
|
Posted: Fri Apr 24, 2009 4:25 pm |
Unless I'm doing it wrong, problems seem to arise when I have multiple lines of text that I need to do this with.
I tried a few variations, but because each line starts in the same manner and doesn't have ", " at the beginning I seem to be having some problems.
I tried a couple different things to try and sort this out,
Code: |
#REGEX {(.+)} {
#if (@line1=%null) {line1=%1}
#If (@line1!=%null) {line2=%1}
etc.
#var namechecking %concat(@line1, @line2, etc.)
}
|
Was causing some syntax problems when I went to use the %subchar
same with
Code: |
namechecking=%push( %1, @namechecking)
|
%push seems to only collect the first part of the string for some reason, doesn't add beyond the first name, I'd assume because of the ", " involved. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|