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
➜ Text Substitutions in MUSHclient.
|
Text Substitutions in MUSHclient.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Haflinger
(9 posts) 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 ;) | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) 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 | | 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.
12,866 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top