Shoutbox

Multiple Chat Windows, Unique Variables For Each - 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: Multiple Chat Windows, Unique Variables For Each (/showthread.php?tid=88848)

Multiple Chat Windows, Unique Variables For Each by Master Jake on 02-01-2009 at 05:34 AM

Hi guys. I'm sure you've all heard of chat bots such as SmarterChild and stuff which always include games and always include the manicdote game which generates stories (however their censored :(). This is why I redesigned my own version in scripting that allows people to make the same manicdotes but uncensored. The problem is, when someone is answering the questions and inputting their nouns and stuff, if someone else chats with me at the same time it will take the input from them instead. I need a way to allow everyone to do the game at once by generate variables for each chat window seperately (like copying all the variables or something). Any easy way to do this would be nice. Thanks for your help.


RE: Multiple Chat Windows, Unique Variables For Each by NanaFreak on 02-01-2009 at 05:46 AM

use an array with the chatwindow/email as the reference for the array?


RE: Multiple Chat Windows, Unique Variables For Each by Master Jake on 02-02-2009 at 09:57 PM

umm how :)?


RE: Multiple Chat Windows, Unique Variables For Each by matty on 02-02-2009 at 11:40 PM

Javascript code:
var oChatWnds = {};
 
function OnEvent_ChatWndCreated(pChatWnd) {
    oChatWnds[pChatWnd.Handle] = {};
        oChatWnds[pChatWnd.Handle].pChatWnd = pChatWnd;
        oChatWnds[pChatWnd.Handle].myVar = 'x';
}
 
function OnEvent_ChatWndDestroyed(pChatWnd) {
    delete oChatWnds[pChatWnd.Handle];
}