Shoutbox

Need some help. - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Need some help. (/showthread.php?tid=64818)

Need some help. by Bleet on 08-12-2006 at 08:16 AM

Well, I was just playing around some and couldn't get my damn script to work.
What I tried was:
function OnEvent_ChatWndCreated(ChatWnd, Message)
{
var h = hey;
ChatWnd.SendMessage("", h);
}
Since I don't get any compilation errors I can't really figure out the problem. If anyone sees it, please help me. =)

Ooh, I also wonder what the variable for the text someone is sending is on event OnEvent_ChatWndReceiveMessage. (I think it's just something like if (Text == ****), but hell. Since I'm asking I might as well ask everything on my mind. Aah and does C/C++ stuff work? Like || && ! (OR AND NOT)

Thanks for any help I can get. :P


RE: Need some help. by Silentdragon on 08-12-2006 at 08:32 AM

1. SendMessage only accepts one parameter eg ChatWnd.SendMessage(h); or ChatWnd.SendMessage("Stuff"+h);

2. var h = hey; is wrong var h = "hey"; is right. Strings need to be in quotes

3. OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,Type)

4. Yes you can use C/C++ style equality checking.


RE: Need some help. by Eljay on 08-12-2006 at 08:36 AM

quote:
Originally posted by Bleet
Well, I was just playing around some and couldn't get my damn script to work.
What I tried was:
function OnEvent_ChatWndCreated(ChatWnd, Message)
{
var h = hey;
ChatWnd.SendMessage("", h);
}
Since I don't get any compilation errors I can't really figure out the problem. If anyone sees it, please help me. =)

code:
function OnEvent_ChatWndCreated(ChatWnd, Message){
  ChatWnd.SendMessage("hey");
}

quote:
Originally posted by Bleet
Ooh, I also wonder what the variable for the text someone is sending is on event OnEvent_ChatWndReceiveMessage. (I think it's just something like if (Text == ****), but hell.

code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind){
  if(Message == 'whatever'){
    //do something
  }
}

quote:
Originally posted by Bleet
Aah and does C/C++ stuff work? Like || && ! (OR AND NOT)

the actual operators work (||, &&, !) but the "text versions" dont (OR, AND, NOT)

edit: ok im a bit slow :sad: :P
RE: Need some help. by Bleet on 08-12-2006 at 08:36 AM

function OnEvent_ChatWndCreated(ChatWnd, Message){
  ChatWnd.SendMessage("hey");
}
Doesn't work.. Well, it's supposed to say hey when I open a chat window, right?


RE: Need some help. by markee on 08-12-2006 at 08:51 AM

You should just have

code:
function OnEvent_ChatWndCreated(ChatWnd){
  ChatWnd.SendMessage("hey");
}
This is because there is no message variable on the creation of the window.
RE: Need some help. by Bleet on 08-12-2006 at 08:58 AM

function OnEvent_ChatWndCreated(ChatWnd, Message){
var hey = "hey";
  ChatWnd.SendMessage(hey);
}
I tried that too and that didn't work. (I'm not sure if this is what you mean by messafe variable though.


RE: Need some help. by Eljay on 08-12-2006 at 09:00 AM

quote:
Originally posted by Bleet
function OnEvent_ChatWndCreated(ChatWnd, Message){
var hey = "hey";
  ChatWnd.SendMessage(hey);
}
I tried that too and that didn't work. (I'm not sure if this is what you mean by messafe variable though.

he meant the message parameter in the function
quote:
Originally posted by Bleet
function OnEvent_ChatWndCreated(ChatWnd, Message){

RE: Need some help. by Bleet on 08-12-2006 at 09:05 AM

Aha, okay. It works now, so thanks =)