|
dazed-n-confused999 Wanderer
Joined: 03 Aug 2004 Posts: 79
|
Posted: Sun Apr 19, 2009 2:38 am
How to match a name from lists? |
I have 5 lists of players depending on their guild profession.
Knights, mages, sorcerers, rangers, ect.
When I target a person for battle, I usually only use the first 3 or 4 letters of their name (its much quicker as some names have 10 letters and only one vowel)
I want the attack alias to be able to make a check with only the first 3 or 4 (or however many I use) letters of the name against the full name in the list.
example:
alias name: J
value:
#var newtarg %1
#IF (%ismember( @NEWTARG, @KNIGHTLIST)) {swld = 1} {#IF (%ismember( @NEWTARG, @MAGELIST)) {swld = 2} {#IF (%ismember( @NEWTARG, @THIEFLIST)) {swld = 3} {#IF (%ismember( @NEWTARG, @SEERLIST)) {swld = 4} {#IF (%ismember( @NEWTARG, @BARDLIST)) {swld = 5} {swld = 6}}}}}
poisonload (alias that uses poisons most deadly to a certain type of person determined by the value of @swld)
jab @newtarg
I'm not sure if there is an easy command for this or if it requires some fancy trickery or maybe its not possible.
Someone point me in the right direction please. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4689 Location: Pensacola, FL, USA
|
Posted: Sun Apr 19, 2009 7:43 am |
you would be wanting somthing like...
#IF (%match(%expandlist(@magelist), "%q{@newtarg}")) |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Sun Apr 19, 2009 12:46 pm |
wow
|
|
|
|
dazed-n-confused999 Wanderer
Joined: 03 Aug 2004 Posts: 79
|
Posted: Tue Apr 21, 2009 2:48 am |
This is what I have now.
#var target %1
#IF (%match(%expandlist(@knightlist), "%q{@target}")) {swld = 1} {#IF (%match(%expandlist(@magelist), "%q{@target}")) {swld = 2} {#IF (%match(%expandlist(@thieflist), "%q{@target}")) {swld = 3} {#IF (%match(%expandlist(@seerlist), "%q{@target}")) {swld = 4} {#IF (%match(%expandlist(@bardlist), "%q{@target}")) {swld = 5} {swld = 6}}}}}
#show @swld
@swld never changes, it always ends up as a 6 |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Tue Apr 21, 2009 1:02 pm |
EDIT: [insert hasty observation]
This matched 'cow' in the second list:
#IF (%match( %expandlist( @magelist), @target)) {}
Though it would also match and use 'cowly' in your knightlist if there was a cowly person there. Must be some easy check for all that. |
|
|
|
dazed-n-confused999 Wanderer
Joined: 03 Aug 2004 Posts: 79
|
Posted: Tue Apr 21, 2009 5:43 pm |
Changed it to this.
#IF (%match( %expandlist( @knightlist), @target)) {#say knight} {#IF (%match( %expandlist( @magelist), @target)) {#say mage} {#IF (%match( %expandlist( @thieflist), @target)) {#say thief} {#IF (%match( %expandlist( @seerlist), @target)) {#say seer} {#IF (%match( %expandlist( @bardlist), @target)) {#say bard} {#say anyone}}}}}
#$%#n'-A that works!
Thanks everyone. |
|
|
|
|
|