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
rocketdog
Newbie


Joined: 19 Sep 2014
Posts: 6

PostPosted: Thu Sep 25, 2014 11:56 am   

NEED HELP: #VAR, #TRIGGERS and Brackets.
 
This old question Check third post!


Last edited by rocketdog on Thu Oct 09, 2014 6:03 pm; edited 1 time in total
Reply with quote
rocketdog
Newbie


Joined: 19 Sep 2014
Posts: 6

PostPosted: Sat Sep 27, 2014 1:11 am   
 
Well, the problem abovedidn't took look before I figured it out.. However, here is another, more tricky problem where I REALLY could use your help: A friend gave me a very advanced list of triggers and such. (Here is the settings in text: http://pastebin.com/eTmBtTvR )

And here is the file cropped with the things I'm trying to use: http://pastebin.com/hjj1Hg2w

I have the following problems: The trigger at the bottom: #TRIGGER {^You lay your hands over (*) and fill it with magical energy!$} {enchant_up %subregex( %1, "[, ']+", "_")}
This leads to, when using the spell "Enchant armor" at an item, in this example "Magical Leggings of Tiamat (Frayed)", things get really messy because of the ()'s.
Instead of getting the variable enchant_blue_dragon_skin_boot_time with a timer, the variable ends up with the value: "time1_time1_time1_time1_time1_time1_time1_time1_time1_time1_" etc ad infinitum.
Just like my experience with triggers are none, so is my regex-skills. I tried adding "( )" into the trigger, but that just made the trigger send "enchant_magical_leggings_of_tiamat_(frayed)_time=1" into the MUD instead of making the variable.[/b]

Another problem I have is the aliases "enchant_check" and "enchant_show" gives nothing.

I just imported the things in the second pastebin-link..could this be the reason these aliases arent working? Am I missing something from the whole text-file?
Looking at "enchant_check", I can't see any connection to the first file.

Help would be much appreciated!
Reply with quote
rocketdog
Newbie


Joined: 19 Sep 2014
Posts: 6

PostPosted: Sat Sep 27, 2014 2:26 am   
 
Remove post.
Reply with quote
rocketdog
Newbie


Joined: 19 Sep 2014
Posts: 6

PostPosted: Thu Oct 09, 2014 6:00 pm   
 
Ok. I think I've been able to figure some things out. How to get rid of things and only fogus on certain things.

I found out the problem to be, that The enchant_magical_leggings_of_tiamat_(frayed) cannot be created (guess it's because zMUD cannot have brackets in variabels?), so instead it becomes @enchant_magical_leggings_of_tiamat_,
however, in the StringList in @enchant_list the item is shown as magical_leggings_of_tiamat_(frayed) - with brackets, as opposed to the trigger-made @enchant_magical_leggings_of_tiamat_.
If I rename the trigger-made @enchant_magical_leggings_of_tiamat_ to #VAR @enchant_magical_leggings_of_tiamat_frayed_(frayed), and of course rename the StringList-Row from enchant_magical_leggings_of_tiamat_(frayed) to enchant_magical_leggings_of_tiamat_frayed ..the whole trigger works like a charm.

So my question is: How do I make #TRIGGER {^You lay your hands over (*) and fill it with magical energy!$} {enchant_up %subregex( %1, "[, ']+", "_")} create the variable @magical_leggings_of_tiamat_(frayed) - or - How do I through the triggers get of the brackets in the StringList inside the @enchant_list?

Really, I could _really_ use some help here.. I guess this is like 2+2 for some of you guys that jbiws origrannubg etc ;)
Would litteraly help me, so I dont have too watch the zMUD almost crashing becaue the @enchant_magical_leggings_of_tiamat_ contains time_1_time1_time_1 etc ad infinitum, because everytime I press i (inventory) it shows the time_1*42398429 instead of the timer I'm trying to make.

Peace out, your Rocketdog
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Thu Oct 09, 2014 10:04 pm   
 
Just add them to the characters that get replaced with underscores:
Code:
%subregex( %1, "[, '()]+", "_")
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