Batch edit?
-
How can one do @edit (all offspring of parent obect)/attribute=string,newstring ?
-
Are you using mux? You could do an @dol and edit the children() of the thing.
So something like:
@dol children(<DBRef of Parent>) = @edit ##/<wild-attr> = <search>,<replace>
-
@Derp
That should work for penn too. -
Yep, it's PennMUSH. Thanks.
-
What does the ## substitute for in your line?
edit: Oh, wait, nothing? Just itself?
-
Yeah. It's the substitution symbol for a list element, which is generated from the children() function.
Edit to Add: I know nothing about Penn, so I'm trusting Bobo that it works the same. My experience is strictly limited to mux.
-
@Derp
This is one of those instances where it's exactly the same, like about 95% of MUSHcode between Penn and MUX.@il-volpe
The ## is the denotation for the list you generated with @dolist..Specifically for penn, you should:
@dol [children(DBREF)]=@edit ##/attr=search,replace
IE
@dol children(Snarfblatt)=@edit ##/desc=Flounder,Scuttle
that would edit all the children of the Snarfblatt object's @desc, replacing all instances of Flounder with Scuttle.
What are you specifically trying to edit, if i may ask?
-
Bugger. It doesn't work, because the parent I've in mind is actually the exit parent, and MUSH doesn't treat it like it does other parents....
-
@il-volpe
What are you trying to do? -
Eliminate a repeated error in exit messages. And know how to do this sort of thing so that later, when I set it up, I can change room descs to reflect seasons.
-
Is this for every exit? If so, you can do:
@dol search(type = exit) = @edit ##/attribute = search,replace
-
Is the message on the parent? If so, you just need to fix the parent.
If it's on individual exits, you'll need to
@dol [lsearch(all,type,exit)]=@edit ##/attr=search,replace
-
Ahh! Thanks. Naw, the message isn't on the parent. It's not on every exit, either, but if I search for it and it's not there, well, it won't replace it, so all good.
-
I'm just gonna defer to Bobo here, because I keep forgetting you're using Penn.
-
@il-volpe
My advice when using parents is to default all the messages to the parent; that way, if you fuck something up, it's a single piece of fix. Now, your messages will all be samey (but honestly, sometimes conformity across the board is fine, it makes things more easy to follow). -
That's sensible, but in this case I get some mood and RP mileage out of the various messages. With your help, this was an easy fix, and it wasn't a necessary one really. And it's given me another bit o' skill, and that's good to have. Thanks, folks!
-
Glad I could be of somewhat limited assistance.