Shoutbox

sending message, creating menus and gui - 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: sending message, creating menus and gui (/showthread.php?tid=61573)

sending message, creating menus and gui by JonnyT on 06-26-2006 at 01:15 PM

Im starting to understand how to do things but im having issues with a few things.

first thing is where am i going wrong here. Im trying to send a certain message when #test or #info are typed in. I've tried these two but with no luck.

code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
    if(Message.substr(0, 5) == '#test'){
Message = 'a message';
    }

    if(Message.substr(0, 5) == '#info'){
Message = Message.replace('a messeage');
return Message;
    }
}

another thing is how/where do we create the menus for scripts in the conversation windows and the actualy config windows?

Thanks J
RE: sending message, creating menus and gui by mathieumg on 06-26-2006 at 01:21 PM

Try this:

code:
unction OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if(Message.substr(0, 5) == '#test'){
return 'a message';
}

if(Message.substr(0, 5) == '#info'){
return Message.replace('a messeage');
}
}


Though there seems to be missing parameters on your replace function...

As for the menus, they can either be created dynamically using the script files or statically using the SciptInfo.xml file.
RE: sending message, creating menus and gui by JonnyT on 06-26-2006 at 04:29 PM

code:
{
if(Message.substr(0, 5) == '#test'){
return 'a message';
}
works great thanks :)

could someone post a very simple demo of the code for the menus/config window?

Thanks J
RE: sending message, creating menus and gui by mathieumg on 06-26-2006 at 04:33 PM

It is in the documentation already :p


RE: sending message, creating menus and gui by JonnyT on 06-26-2006 at 04:37 PM

ah yeah :$ didnt ee the exampes section, Thanks :D