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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  Text Substitutions in MUSHclient.

Text Substitutions in MUSHclient.

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


Posted by Haflinger   (9 posts)  [Biography] bio
Date Sun 21 Apr 2002 06:57 PM (UTC)

Amended on Sun 21 Apr 2002 06:58 PM (UTC) by Haflinger

Message
Is there any way I can make a list of text substitutions? I'd like to have my input text converted to something else when it is sent, mainly for a lauguage accent.

For example, if I type "Hello" I'd like it to send "Hallo", or if I typed "one" it would send "vun". As you can see, it would be a German accent.

I'd need a list of about 30 words to be substituted.

Thanks ;)
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 22 Apr 2002 02:42 AM (UTC)
Message
You could do it fairly easily, however you may have problems with "words" within words. The example I give below would replace "one" even inside another word (like someone, bone, lonely etc.).

Make an alias that calls a script ...


Alias: *
Label: FixUpWords
Script: FixUpWords


Add this script to your script file (language VBscript) ...


Sub FixUpWords (AliasName, AliasLine, arrWildcard) 

dim NewLine

  NewLine = arrWildcard (1)	' get line they entered

  NewLine = world.Replace (NewLine, "one", "vunn", true)
  NewLine = world.Replace (NewLine, "hello", "hallo", true)
'
'  add other ones here
'

  world.send NewLine

end sub


What this does is get the line you entered, and scan it for each word you want to find, and replace it with the replacement word. You could add extra lines to do more words.

Then finally the resulting string is sent to the world.

You could fix the "one" problem by searching for " one " (with spaces around it) and replacing with " vunn " (with spaces), however then you might run into problems with sentences like this: "I see one, I think" (in that sentence, "one" doesn't have a space on each side).

However with a bit of tweaking you can probably make it work pretty well.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


9,764 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 HostDash]