[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  Changing name strings
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Changing name strings

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


Posted by Trepko   (1 post)  [Biography] 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
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] 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.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] 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.
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] 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.
[Go to top] 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.


3,758 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]