|
moksha Novice
Joined: 13 Oct 2002 Posts: 37 Location: United Kingdom
|
Posted: Tue Mar 18, 2003 9:08 pm
Stringlist help |
Hello again,
I'm trying to create a script that when I pick up items will put them in designated containers automatically.
I'm thinking along the lines of when I get an item it will check it against 3 "master" stringlists and if a match is found will put the item in the correct container using alias's or if its not on any of the lists, drop it again
So far I have the master stringlists [food|treasure|eq] and the alias's [fsort|tsort|eqsort} but I can't get the checks right on the trigger.
#tr {^(%a) taken.} {#if {%ismember( %lower( "%1", @Food))} {fsort};#if {%ismember( %lower( "%1", @treasure))} {tsort} ;#if {%ismember( %lower(%1, @eq)))} {eqsort} }
So am i going in the right direction with this or is there an easier way I'm missing completely?
Thanks in advance
Moksha |
|
|
|
moksha Novice
Joined: 13 Oct 2002 Posts: 37 Location: United Kingdom
|
Posted: Tue Mar 18, 2003 10:15 pm |
Hi
I can make it work with only one #if statement in the trigger by taking out the %lower stuff and capitalizing the master stringlists but how can i make it check through three master lists and perform the required actions
Moksha |
|
|
|
Talahaski Enchanter
Joined: 10 Oct 2000 Posts: 656 Location: USA
|
Posted: Tue Mar 18, 2003 10:36 pm |
It may be easier and more efficient to just use 3 triggers instead of 1 trigger with IFs.
#tr {^({@list1}) taken.} {fsort}
#tr {^({@list2}) taken.} {tsort}
#tr {^({@list3}) taken.} {eqsort}
This is not tested, so I may have the syntax wrong, but i think its right.
If you use it this way, make sure the triggers are NOT case sensitive, then you won't have to worry about capitolizing.
Talahaski
Processor PIII 1000
Memory 265MB
Video NVIDIA 64MB
Windows XP
Zmud Version 6.55a
Zmapper Version 1.14
http://www.dartmud.com |
|
|
|
moksha Novice
Joined: 13 Oct 2002 Posts: 37 Location: United Kingdom
|
Posted: Tue Mar 18, 2003 10:40 pm |
Hi Talahaski
Great idea. I think I'll do it that way.
Thanks
Moksha |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Mar 19, 2003 12:58 am |
#IF expects the first parameter to be an expression, delimited (if necessary) by parentheses not braces.
#tr {^(%a) taken.} {#if (%ismember( %lower( "%1", @Food))) {fsort};#if (%ismember( %lower( "%1", @treasure))) {tsort} ;#if (%ismember( %lower(%1, @eq))) {eqsort}}
LightBulb
Advanced Member |
|
|
|
|
|