|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 6:47 am
alias and string lists |
how do you display 1 thing out of a string list var?
can you use a string list var as a pattern for a trigger?
if so what is the syntax? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Oct 26, 2002 6:57 am |
quote:
is this posible?
I have tried
<@test>
(@test)
{@test}
({@test})
and none seem to work
what is the syntax to trigger off a varible? (to have your pattern only as a varible (and to make it harder a varable that is a string list)
thanks for the help
To use a stringlist in a trigger pattern, you enclose it in curly braces, like this {Tom|Dick|Harry|...}, right?
Well, a variable containing a stringlist works the same way except that you use the variable name in place the Tom|Dick|Harry|...
#trigger {{Tom|Dick|Harry|...}} {}
#trigger {{@Names}} {}
To not use a stringlist, just remove the extra set of curly braces from around the variable name, like this:
#trigger {@attackmessages} {}
li'l shmoe of Dragon's Gate MUD |
|
|
|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 7:09 am |
nope that doesn't seem to work :(
I don't think it's seeing the string varables differnt options so nothing to trigger off |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Oct 26, 2002 8:05 am |
You display one thing out of a stringlist variable with the %item function.
Yes, you can use a stringlist variable as a pattern for a trigger. If you are using the editor, enclose the name of the variable in braces {@stringlist}. If you also want to capture the value as a parameter, add parentheses outside the braces, ({@stringlist}).
From the command line, three sets of delimiters seem to be needed. I can't tell you why, but that's what my own experience indicates.
#TR {{{@stringlist}}}
#TR {({@stringlist})}
LightBulb
Senior Member |
|
|
|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 8:56 am |
that worked wonders...thanyou so much.
next problem is how do I get it to pick up the right obj.
pattern = ({@glist})
value = get %item( @GNames, %ismember( "%1", @GList))@GList))
this doesn't seem to be working...I have the desc in the glist var and what to get.
but it winds up getting the whole string not just 1 item....if you could lay out the syntax or tell me what help to read I would be happy |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Oct 26, 2002 2:04 pm |
get %item( @GNames, %ismember( "%1", @GList))@GList))
is the part in red a typo, or is it acutally like that in your trigger?
Kjata |
|
|
|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 6:57 pm |
well I made the changes sugested above but
now I get nothing :(
get |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Oct 26, 2002 7:45 pm |
What changes did you make? Is your trigger commands currently:
get %item( @GNames, %ismember( "%1", @GList))
Kjata |
|
|
|
Tigger Novice
Joined: 07 Oct 2002 Posts: 46 Location: USA
|
Posted: Sat Oct 26, 2002 8:45 pm |
yep it's get
%item( @GNames, %ismember( "%1", @GList))
and now all I do is
get
and nothing else |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Oct 26, 2002 9:15 pm |
quote:
yep it's get
%item( @GNames, %ismember( "%1", @GList))
and now all I do is
get
and nothing else
You are using one stringlist to determine the position of the element in another stringlist you want to retrieve. My guess is that one of your stringlists is missing an entry, and that's why you're getting the incomplete GET command.
li'l shmoe of Dragon's Gate MUD |
|
|
|
|
|