Yetzederixx Beginner
Joined: 19 Oct 2010 Posts: 14 Location: Sulphur, LA
|
Posted: Wed Oct 27, 2010 9:23 pm
PK Group Collection/Highlighting |
This script will gather the players name, I'm Kylanthys in the selction of names, and place them into their pk group (clans in http://dsl-mud.org).
Selection from whoclan:
Code: |
[51 Pri] [ Slayers ] Ys'llaggra Underlord (Leader) (Recruiter)
[51 Arm] [ Justice ] Rayyke Recruit
[51 Cle] [ Shalonesti ] Kylanthys Sha'falas
[51 Inv] [ White Robes ] Jyoti Archmagus (Recruiter)
[51 Pri] [ Wargar*] Akxo Warcouncil(Thane) (Recruiter)
|
Pattern: ^[(\d+) \w+] (.*).*[|)]\s+([a-z']+)\s+\a+.*
Reg Ex: True
ID : gatherNames
Code: |
$clan = %if(%ends(%2, "*"), %remove("*", %2))
$clan = %replace(%2, " ", "")
#ADDITEM @$clan %3
|
Please take note of the @$clan. This same script in ZMUD was 548 characters long without being able to do that. My variable names are Shalonesti, WhiteRobes, etc and by using the short cut of @$clan it saved 456 chars of repetitive code.
This section actually does the highlighting:
Code: |
where
Players near you:
Akrie Lhedr-Eowyl Pond
Erebron The Dining Hall
Elyrial Lhedr-Eowyl Pond
Kylanthys In The Trees
|
Pattern: ^([a-zA-Z']+) \s?\s+(\w+).*
Note: the \s?\s+ was necessary here to keep it from firing at wierd times, like during communications.
Reg Ex: True
Code : I'm only going to snippit the first little bit as there are 16 groups. Bravo on the #switch, it made this alot easier as I didn't have to worry about the 12ish end braces
Code: |
#switch (%ismember(%1, @BlackRobes)) {#cw 96} |
[/code] |
|