Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
moksha
Novice


Joined: 13 Oct 2002
Posts: 37
Location: United Kingdom

PostPosted: 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
Reply with quote
moksha
Novice


Joined: 13 Oct 2002
Posts: 37
Location: United Kingdom

PostPosted: 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
Reply with quote
Talahaski
Enchanter


Joined: 10 Oct 2000
Posts: 656
Location: USA

PostPosted: 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
Reply with quote
moksha
Novice


Joined: 13 Oct 2002
Posts: 37
Location: United Kingdom

PostPosted: Tue Mar 18, 2003 10:40 pm   
 
Hi Talahaski

Great idea. I think I'll do it that way.

Thanks

Moksha
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net