Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Tips and tricks ➜ Changing name strings

Changing name strings

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Trepko   (1 post)  Bio
Date Thu 26 Aug 2004 04:00 AM (UTC)

Amended on Thu 26 Aug 2004 04:03 AM (UTC) by Trepko

Message
I was wondering if you can change a name string when someone says something on channels such as:

[OOC] Trepko: -- 'Hrm'
[OOC] Person I hate: -- 'Hrm'

I was wondering if you could change the name of someone when they talk on a channel to something like that.

If you know could you please tell me how to do it? :p

EDIT: I'm using MUSH v3.42
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #1 on Thu 26 Aug 2004 07:20 AM (UTC)

Amended on Thu 26 Aug 2004 07:21 AM (UTC) by Ked

Message
If you don't care about preserving the original colours of the line then you can do it fairly easily:


<triggers>
<trigger
name="replace_name"
match="^(\[OOC\]) (?:NastyGuy1|NastyGuy2|NastyGuy3): -- (.*)$"
enabled="y"
omit_from_output="y"
sequence="1"
script="ReplaceName"
regexp="y"
></trigger>
</triggers>

sub ReplaceName(name, output, wildcs)
   world.ColourNote "white", "", wildcs(1) & " Person I hate: -- " & wildcs(2)
end sub


That's in Vbscript and requires you to put the sub in your script file, or you can make this a separate plugin. It'll replace the original line with a custom one, in white foreground.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #2 on Thu 26 Aug 2004 08:02 AM (UTC)
Message
You can also just use this (no script file changing):


<triggers>
<trigger
name="replace_name"
match="^(\[OOC\]) (?:NastyGuy1|NastyGuy2|NastyGuy3): -- (.*)$"
enabled="y"
omit_from_output="y"
sequence="1"
regexp="y"
send_to="12"
>
<send>world.ColourNote "white", "", "%1" & " Person I hate: -- " & "%2"</send>
</trigger>
</triggers>


Or at least, I think thats right. I just cut up Keds trigger, and added things from memory.


~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #3 on Fri 27 Aug 2004 07:16 AM (UTC)
Message
Unless it changed, I believe using "omit_from_output" omits anything you try to send also. There was a workaround involving the use of two sequenced triggers, of which one sends to script and the other actually gags, but I thought that using the script file is easier.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,434 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.