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
HobbezG2
Beginner


Joined: 01 Mar 2012
Posts: 17

PostPosted: Thu Mar 01, 2012 5:34 pm   

[Question] Highlighter Fix for zMud 7.21 [SOLVED 3/4/12]
 
Hi Everyone. I built this highlighter a long time ago based off of a script from someone else, and have always had issues with two minor pieces that never worked. It's always bothered me and I hope that someone here with a more complex understanding of 7.21 functions and syntax could help me fix this problem once and for all.

The script is a highlighter script that pulls names from a generated list in the game and populates them into lists that are instructed to show all names within said list as a specific color. Due to the nature of the game I'm playing, the lists generated from typing a specific command in the game shows different clans members differently. The following is what shows up in the game that the triggers pulls names from:

Code:

[46 Swb] [ Shalonesti ]      Aerariel     Nameless       
[42 Pir] [ Wargar ]          Chaxta       Oreborn         
[41 Arm] [ Justice ]         Zquas        Recruit         
[41 Dra] ( Dragon )          Kilkanath    Member         
[40 Mon] [ Bloodlust ]       Xyther       Savage         
[22  D-Dwf Enc] [ Loner ] Norbik Ebonstone  Lithopedian


If you notice, that the Loner clan and the Dragon Clan do not populate the same way as the other clans do. This here is the root of the problem because the trigger doesn't recognize the Loner or the Dragon due to the way they look.

Example:


Code:
[46 Swb] [ Shalonesti ]
[42 Pir] [ Wargar ]
[41 Arm] [ Justice ]
[41 Dra] ( Dragon )
[40 Mon] [ Bloodlust ]
[22  D-Dwf Enc] [ Loner ]


Notice how the beginning of the line is different and the brackets around the Clan name? [ Clan ] works perfectly while ( Clan ) does not. Also, despite [ Loner ] using the []'s, it still doesnt work correction due to the different beginnings.

The following is the actual trigger used, so hopefully you all can tell me what I need to change in the actual code in order to make the Loner and Dragon clans work like the other clans do:


Code:
#IF ((%1) == (Knighthood)) {#additem khoodmemb %2}
#IF ((%1) == (Justice)) {#additem justmemb %2}
#IF ((%1) == (Shalonesti)) {#additem shalomemb %2}
#IF ((%1) == (Shadow)) {#additem shadmemb %2}
#IF ((%1) == (Bloodlust)) {#additem lustmemb %2}
#IF ((%1) == (Wargar)) {#additem wargmemb %2}
#IF ((%1) == (Slayers)) {#additem slaymemb %2}
#IF ((%1) == (Black Robes)) {#additem blackmemb %2}
#IF ((%1) == (White Robes)) {#additem whitememb %2}
#IF ((%1) == (Red Robes)) {#additem redmemb %2}
#IF ((%1) == (Chaos)) {#additem chaosmemb %2}
#IF ((%1) == (Loner)) {#additem lonermemb %2}
#IF ((%1) == (Dragon)) {#additem dragonmemb %2}


If anyone can explain and show me the correct way, I would be really really happy. :D

Thanks!


Last edited by HobbezG2 on Sun Mar 04, 2012 7:04 pm; edited 1 time in total
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Mar 01, 2012 6:50 pm   
 
Simple trigger, really.

Code:
#TRIGGER {^~[*~] {~[|~(} (%w) {~]|~)}%s(%w)} {rest of script here}


The reason ( Dragon ) wouldn't work is simply because () is used for capturing parameters. You need to escape the parentheses to capture properly. Additionally, the [] should be escaped because they indicate a range for the trigger (e.g. [1-9] will search for any single digit). This trigger should work for all instances. If you have any questions as to what something is, don't hesitate to ask.

Also, in your script, you can change the () around the clan name to " " instead, and you can remove the () around the %1.
Reply with quote
HobbezG2
Beginner


Joined: 01 Mar 2012
Posts: 17

PostPosted: Thu Mar 01, 2012 7:15 pm   
 
Thanks Charneus, I suppose I could make it a whole lot cleaner. You're saying to just repalce all of the []'s and () with ""'s?

EDIT: In addition to the alter trig edit you listed above.
Reply with quote
HobbezG2
Beginner


Joined: 01 Mar 2012
Posts: 17

PostPosted: Thu Mar 01, 2012 8:05 pm   
 
Crazy, everything works FLAWLESSLY now, thank you so much!
_________________
Dark and Shattered Lands
dsl-mud.org:4000
www.dsl-mud.org
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Mar 01, 2012 8:52 pm   
 
I was talking about replacing the ()s around the %1 and the clan name in the #IF ((%1) == (clan)) portion of your script. You just need it to be #IF (%1 == "clan") instead.


Glad it works for you, though!
Reply with quote
HobbezG2
Beginner


Joined: 01 Mar 2012
Posts: 17

PostPosted: Sat Mar 03, 2012 2:34 am   
 
Charneus, I'm having issues now with the Clan names with two words such as the three listed below. They worked before but now they don't. Any idea on how to fix these?


[51 Tra] [ White Robes ] Berr Magus
[51 Mag] [ Black Robes ] Geirrvif Magus
[51 Mag] [ Red Robes ] Prazle Magus

Also, I'm having difficulties with the Loner lists adding certain RP Ranks for Pirate and Priest characters.
Example:

[26 Yinn Pir] [ Loner ] Cabin Person Crvain

Their "Pirate Rank" is Cabin Person and their actual name is Crvain, so its adding "Cabin" to the Loner list. Should I just make an exclusion list with an array of ranks that I want to bar from being flagged ever? Aka, all of the Pirate and Priest ranks? And if so, How might I incorporate it?
_________________
Dark and Shattered Lands
dsl-mud.org:4000
www.dsl-mud.org
Reply with quote
HobbezG2
Beginner


Joined: 01 Mar 2012
Posts: 17

PostPosted: Sat Mar 03, 2012 3:12 am   
 
This one allows highlighting of Loners and Dragons, but not 2-word clan names:

#TRIGGER {^~[*~] {~[|~(} (%w) {~]|~)}%s(%w)}

This one allows 2-word clan names, but not loners and dragons:

#TRIGGER {^~[%d %w~] ~[ (*){ |*}~]%s(%x)}


What am I missing here?
_________________
Dark and Shattered Lands
dsl-mud.org:4000
www.dsl-mud.org
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Mar 03, 2012 6:26 am   
 
Look into the use of ranges. [%w%s] will match any of the clan names.
_________________
EDIT: I didn't like my old signature
Reply with quote
HobbezG2
Beginner


Joined: 01 Mar 2012
Posts: 17

PostPosted: Sat Mar 03, 2012 6:38 am   
 
Thanks MattLofton, but could you be a bit more specific and apply it to the following trigger?

#TRIGGER {^~[*~] {~[|~(} (%w) {~]|~)}%s(%w)}


Thanks!
_________________
Dark and Shattered Lands
dsl-mud.org:4000
www.dsl-mud.org
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Mar 03, 2012 11:10 am   
 
Where the first %w is, change that to [%w%s]. Your trigger will look like this:

Code:
#TRIGGER {^~[*~] {~[|~(} [%w%s] {~]|~)}%s(%w)}


Had I known you had multiple-word clan names before, I'd have suggested this one. :)
Reply with quote
HobbezG2
Beginner


Joined: 01 Mar 2012
Posts: 17

PostPosted: Sat Mar 03, 2012 4:35 pm   
 
Thanks Charneus, you are a wizard and a gentleman. Does the above trig account for names with single digit levels? The range is lvl 1 thru 51. Thanks!
_________________
Dark and Shattered Lands
dsl-mud.org:4000
www.dsl-mud.org
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Mar 03, 2012 7:01 pm   
 
In ZMud and CMud pattern matching, wildcards are equivalent to [%whatever] (for example, %d = [%d]). The wildcard doesn't stop matching until the parser gets to a character that doesn't match, so the following pattern works for the following examples:

#trigger {left%dright} {}

left1right
left82right
left999999999999999999999999999999999999right

In Charneus's example, * is equivalent to [%x%d%s], which generally means if you see it on-screen it'll match (the only exception is that in ZMud * does not match any character defined in the Special Characters Preferences).
_________________
EDIT: I didn't like my old signature
Reply with quote
HobbezG2
Beginner


Joined: 01 Mar 2012
Posts: 17

PostPosted: Sun Mar 04, 2012 7:03 pm   
 
All issues regarding improper highlighting have been resolved and you can see the final results from this effort in the finished script sections:

http://forums.zuggsoft.com/forums/viewtopic.php?t=37538
_________________
Dark and Shattered Lands
dsl-mud.org:4000
www.dsl-mud.org
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