What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Case talker

Case talker
Author: Message:
Grinder911
New Member
*


Posts: 5
Joined: Sep 2004
O.P. Case talker
How simple would it be to make a talker that converts uppercase characters to lowercase?

At my work everything is in uppercase so I'm constantly having to change back and forth so my contacts don't think I'm yelling at them.

I'll also forget to change back so when I start entering parts or invoicing a customer, I end up having to delete a lot of text by the time I notice.

I'm sure a talker like this would be very simple to write but It wouldn't be useful to very many people.

Any suggestions?

This post was edited on 09-18-2004 at 08:38 PM by Grinder911.
09-18-2004 08:36 PM
Profile PM Find Quote Report
Grinder911
New Member
*


Posts: 5
Joined: Sep 2004
O.P. RE: Case talker
Thanx. I think I've almost got it figured out.

This post was edited on 09-18-2004 at 09:03 PM by Grinder911.
09-18-2004 08:50 PM
Profile PM Find Quote Report
Martijn.
Full Member
***

Avatar
Previously known as |\/|artij|\|

Posts: 162
Reputation: 2
34 / Male / –
Joined: Apr 2004
Wink  RE: Case talker
I've made this some time ago, when I needed it myself:).

Don't look into it yet if you want to find out how to do it by yourself:).

.zip File Attachment: talkers.zip (416 bytes)
This file has been downloaded 118 time(s).
"If freedom is outlawed, only outlaws will have freedom."
09-18-2004 09:54 PM
Profile E-Mail PM Find Quote Report
Grinder911
New Member
*


Posts: 5
Joined: Sep 2004
O.P. RE: Case talker
I altered the talker.alternating.vbs and came up with this:

Function talker(input)
    For i = 1 To Len(input)
        keyvalue = Asc(Mid(input, i, 1))
        If (keyvalue >= 96 And keyvalue < 96 + 27) Or (keyvalue >= 64 And keyvalue < 64 + 27) Then
            If (i And 1) = 1 Then
                If keyvalue < 96 Then
                    s = s & Chr(96 + keyvalue - 64)
                Else
                    s = s & Chr(64 + keyvalue - 96)               
                End If
            Else
                If keyvalue >= 96 Then
                    s = s & Chr(64 + keyvalue - 96)
                Else
                    s = s & Chr(96 + keyvalue - 64)
                End If
            End If
    Else
            s = s & Chr(keyvalue)
        End If
    Next
    input = s&""
    talker = input
End Function

Can you see anything I don't need in there?

Then I altered talker.lafrican.js and came up with this:

var inchars="abcdefghijklmnopqrstuvwxyz";
var outchars="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

function talker(input) {
    var i=0;
    var output="";
    while (i<input.length) {
        var letter=input.substr(i,1);
        var upr=0;
        if (letter >= 'a' && letter <= 'z') {
            letter=outchars.charAt(inchars.indexOf(letter));
        }
        else
        if (letter >= 'A' && letter <= 'Z') {
            letter=inchars.charAt(outchars.indexOf(letter));
        }
        output=output+letter;
        i=i+1;
    }
    return output;
}

With the .js one everything works and the .vbs one the @ symbol and ` symbol are switched.

This post was edited on 09-18-2004 at 11:28 PM by Grinder911.
09-18-2004 10:47 PM
Profile PM Find Quote Report
Grinder911
New Member
*


Posts: 5
Joined: Sep 2004
O.P. RE: Case talker
I was able to figure out the simple version but I wanted to add the option of using a capital letter by typing a lowercase one.

Pretty much what I wanted was something that would swap both cases - lower to upper and upper to lower.
09-19-2004 12:10 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Case talker
Similar in VBScript:

Function talker(input)
  Dim i, Str, Char
  Str = ""
  For i = 1 To Len(input)
    Char = Mid(input, i, 1)
    If Char = LCase(Char) Then
      Char = UCase(Char)
    ElseIf Char = UCase(Char) Then
      Char = LCase(Char)
    End If
    Str = Str & Char
  Next
  talker = Str
End Function

This will change "This is a tëst - Ë" into "tHIS IS A TËST - ë" (note that ë, í, ô, etc. can also be upper/lowercased, these will be converted correctly also!)

This post was edited on 09-19-2004 at 01:35 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-19-2004 01:35 AM
Profile PM Find Quote Report
Mike
Elite Member
*****

Avatar
Meet the Spam Family!

Posts: 2795
Reputation: 48
32 / Male / Flag
Joined: Mar 2003
RE: Case talker
Uhhhh try this:
code:
Function talker(input)

If input = UCase(input) Then
talker = LCase(input)
Else
talker = talker
End if
End Function
Copy and paste this into notepad then save it with the name talker.lowercase.vbs in your stuff-plug.
quote:
Originally posted by CookieRevised
Dim i, Str, Char
Note!: This will declare the variables as variant!
They should be like this: Dim i as integer, Str As string, Char As string
But i dont know much vbscript...
YouTube closed-captions ripper (also allows you to download videos!)
09-19-2004 06:10 AM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Case talker
quote:
Originally posted by Mike2
Copy and paste this into notepad then save it with the name talker.lowercase.vbs in your stuff-plug.
Do NOT... This will NOT work.
1) IF it worked, then the only thing that will do is lower casing the whole string but ONLY if the whole string was uppercased. If he pressed Shift for the first letter (and thus he has something like "hOW ARE YOU") then the function will return just the same...
2) "talker = talker" ? You can't do that (in any language).

quote:
Originally posted by Mike2
Note!: This will declare the variables as variant!
They should be like this: Dim i as integer, Str As string, Char As string.
No... wrong.
1) If you don't use Dim then the variables are declared as variants anyway! But omitting the Dim statement in your projects is a bad habit.
2) Furthermore, variables in VBScript are always of the variant type
3) declaring a variable "dim x as y" is invalid in VBScript because of this and will produce an error...

quote:
Originally posted by Mike2
But i dont know much vbscript...
(or programming it seems) (edit: uncalled for) Then do NOT suggest things, both your script and comments consist of errors.

This post was edited on 09-19-2004 at 12:28 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-19-2004 10:32 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Case talker
quote:
Originally posted by TheBlasphemer
So, he's right, and now you try to talk yourself out of it with this crappy argument?
That argument isn't crap at all and is 100% correct.
1) not declaring variables in the beginning of a project is a bad habit.
2) thus I declared them.
3) of course they are variants, because vbscript only knows variant types in this case.
4) the first point was a general programming point (for vb(script)) . This has nothing todo with me trying to talk out of something because I don't need to talk me out of something in the first place!



Instead of flaming me and calling me uncalled-for names, proof me 1 thing in that post that is wrong.

And fyi, I DO know my shit I try to help with... unlike you who only seems to know how to bitch on people, flame them, call them n00bs, etc.., unless they woreship you like a god. (so look up what "arrogant" exactly means before you use that word)

This post was edited on 09-19-2004 at 12:30 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-19-2004 12:23 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On