What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request] Script to make sent messages gradient

Pages: (4): « First « 1 [ 2 ] 3 4 » Last »
[Request] Script to make sent messages gradient
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: [Request] Script to make sent messages gradient
code:
var MsgOutput = null;
var Color1 = null;
var Color2 = null;

function Replace_Text(Color1, Color2, Message, MsgOutput)
{
  MsgOutput = "[c=" + Color1 + "]" + Message + "[/c=" + Color2 + "]";
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
  var Contacts = ChatWnd.Contacts; 
  var e = new Enumerator(Contacts);
 
  for(; !e.atEnd(); e.moveNext())
  {
    var Contact = e.item();
    if (Contact.Email == xxx@yyy.zzz)
    {
      Color1 = "#010176";
      Color2 = "#2D0352";
      Replace_Text(Color1, Color2, Message, MsgOutput);
     
      return MsgOutput;
    }
  } 
  return Message;
}

This might work, can't test, network is acting up.

This will iterate trough a list of contacts in the current ChanWnd, and if it finds the contact it will send the gradiented message, else it will send the message unaltered.

This post was edited on 06-26-2006 at 09:06 AM by Ezra.
[Image: 1-0.png]
             
06-26-2006 09:04 AM
Profile PM Web Find Quote Report
t_pass6
New Member
*


Posts: 12
Joined: Jun 2006
O.P. RE: [Request] Script to make sent messages gradient
Well, as i'm seeing it, if it finds the Contact il will send both the unaltered and the altered message, because os the return Message at the end of the function.

Edit : and i as was seeing it, i didn't want to use it in a chat with 2 or 3 contacts.

This post was edited on 06-26-2006 at 09:19 AM by t_pass6.
06-26-2006 09:15 AM
Profile E-Mail PM Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: [Request] Script to make sent messages gradient
The correct behavior for a function is to stop after returning IIRC, but if this happends use this:

code:
var MsgOutput = null;
var Color1 = null;
var Color2 = null;
var sendUnaltered = true;

function Replace_Text(Color1, Color2, Message, MsgOutput)
{
  return "[c=" + Color1 + "]" + Message + "[/c=" + Color2 + "]";
}
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
  var Contacts = ChatWnd.Contacts; 
  var e = new Enumerator(Contacts);
 
  for(; !e.atEnd(); e.moveNext())
  {
    var Contact = e.item();
    if (Contact.Email == nemo_569@hotmail.com)
    {
      Color1 = "#010176";
      Color2 = "#2D0352";
     
      return Replace_Text(Color1, Color2, Message, MsgOutput);
      sendUnaltered = false;
    }
  }
  if(sendUnaltered)
  {
    return Message;
  }
}

EDIT: replaced the bool variable with a more understandable variable: sendUnaltered

This post was edited on 06-26-2006 at 09:23 AM by Ezra.
[Image: 1-0.png]
             
06-26-2006 09:19 AM
Profile PM Web Find Quote Report
timbothegreat
New Member
*


Posts: 5
– / Male / –
Joined: Jun 2006
RE: [Request] Script to make sent messages gradient
Here's a snippet from a script I wrote to randomize the gradient upon sending.  Note that, depending on your background picture, this can be difficult to see.

//Global variable
var c_max = 99;

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
    var c1 = Math.floor(Math.random() * c_max);
    var c2 = Math.floor(Math.random() * c_max);
    return('[c=' + c1 + ']' + Message + '[/c=' + c2 + ']');
}
06-26-2006 09:31 AM
Profile E-Mail PM Find Quote Report
ThunderStorm
Junior Member
**

Avatar
I Love Zillah

Posts: 34
38 / Male / –
Joined: Mar 2006
RE: [Request] Script to make sent messages gradient
I want a counter by the messages.
Example:

My name is robin (1233)
Is that possible?
Vote On Me
06-26-2006 09:40 AM
Profile E-Mail PM Find Quote Report
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
RE: [Request] Script to make sent messages gradient
quote:
Originally posted by ThunderStorm
I want a counter by the messages.
Example:

My name is robin (1233)
Is that possible?

Sure, but please make your own thread requesting this, don't hijack someone elses thread please :)
[Image: 1-0.png]
             
06-26-2006 09:45 AM
Profile PM Web Find Quote Report
t_pass6
New Member
*


Posts: 12
Joined: Jun 2006
O.P. RE: [Request] Script to make sent messages gradient
Well this isn't what i want to do timbothegreat. I just want to have specific gradient for each contact who wants to see it. And I also don't want to use it in chat with multiple contacts. I was thinking about something like this:
code:
var Color1 = null;
var Color2 = null;
var MsgOutput = null;

function Replace_Text(Color1, Color2, Message, MsgOutput)
{
     MsgOuput = "[c=" + Color1 + "]" + Message + "[/c=" + Color2 + "]";
}

function OnEvent_ChatWndSendMessage(Chatwnd, Message)
{
     var Contactnum = Enumerator(ChatWnd.Contacts);
     if (Contactnum < 3)
     {
          MsgOutput = Message
          if (Contact.Email == xxx@yyy.zzz)
          {
                Color1 = "#000000";
                Color2 = "#FFFFFF";
                Replace_Text(Color1, Color2, Message, MsgOutput) ;
          }
     }

     return MsgOutput;
}

Seems simpler to me.

This post was edited on 06-26-2006 at 09:57 AM by t_pass6.
06-26-2006 09:56 AM
Profile E-Mail PM Find Quote Report
crank
Full Member
***

Avatar
Failed to come back here :(

Posts: 304
Reputation: 17
35 / Male / Flag
Joined: Mar 2004
Status: Away
RE: [Request] Script to make sent messages gradient
be sure to add this in your script else commands like /me won't work.
code:
if (Message.charAt(0) == '/')
        return(Message);
I'm working on a script to do autogradients and colors, with per contact options and such, having a hard time with PlusWnds tho, but nothing i can't handle
I haven't been active here in ages.
If you're wondering who i am, read my reputations. I used to make plugins, skins and spam the IRC channels here back in the good old days before Windows Live.
06-26-2006 10:28 AM
Profile E-Mail PM Web Find Quote Report
t_pass6
New Member
*


Posts: 12
Joined: Jun 2006
O.P. RE: [Request] Script to make sent messages gradient
thanks, but i get an error with the line var Contactnum = Enumerate(ChatWnd.Contacts), anyone sees why?
06-26-2006 10:41 AM
Profile E-Mail PM Find Quote Report
timbothegreat
New Member
*


Posts: 5
– / Male / –
Joined: Jun 2006
RE: [Request] Script to make sent messages gradient
quote:
Originally posted by t_pass6
thanks, but i get an error with the line var Contactnum = Enumerate(ChatWnd.Contacts), anyone sees why?

If you're only interested in the number of contacts, you don't need to create the enumerator object.  You can use the Contacts.Count property.

Contactnum = ChatWnd.Contacts.Count
06-26-2006 11:00 AM
Profile E-Mail PM Find Quote Report
Pages: (4): « First « 1 [ 2 ] 3 4 » Last »
« 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