What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » artificial intelligence script(close window)

Pages: (2): « First [ 1 ] 2 » Last »
artificial intelligence script(close window)
Author: Message:
xsouldeath
Junior Member
**


Posts: 30
Joined: Sep 2006
O.P. artificial intelligence script(close window)
#1well ive been making a bot u can add zerounderscore@hotmail.com if u want to try it out or w/e

function OnEvent_ChatWndDestroyed(ChatWnd)
{
ChatWnd.SendMessage("You better not even think about closing the window dude!!");OnEvent_ChatWndDestroyed
The OnEvent_ChatWndDestroyed event is fired when a chat window is destroyed.

Syntax
OnEvent_ChatWndDestroyed(
    [object] ChatWnd
);
Parameters
ChatWnd
[object] Reference to the ChatWnd object attached to the chat generating the event.
Return Value
No value has to be returned by this event.

Remarks
None.

Event Information
Event Source Windows Live Messenger
Availability Messenger Plus! Live 4.00
"

When contact closes window it still works and DOES NOT OPEN A NEW WINDOW!

so i guess this could be impleneted still
BUT i need a way given the current window
ChatWnd to get the contact's email who I am talking to..
that way I could use the open window
function OnEvent_ContactSignin(Email)
{
ChatWnd=Messenger.OpenChat(Email);
ChatWnd.SendMessage("Hi there my best friend.. How u doin today ;)");
}

}


"
#2 What is the escape charaacter
like for example
normally to reply to a user message i use

if(Message.match(/(^|\s+)(\*)?you suck(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage("no you do!");
}

but if the user says like
/nudge
(gives  a nudge)
i can't get it to work because the slash is reserved


lowercase copy is a simple copycat
basically its one "function" that i would be using in my artificial intelligence
since i don't want to ask well in pseudocode
if (message == "hello")
do this
else if (message=="Hello")
do this
..


.zip File Attachment: lowerCaseCopyCat.zip (1.86 KB)
This file has been downloaded 184 time(s).

This post was edited on 09-20-2006 at 01:06 AM by xsouldeath.
09-19-2006 11:32 PM
Profile E-Mail PM Find Quote Report
cloudhunter
Senior Member
****


Posts: 536
Reputation: 18
37 / – / –
Joined: Dec 2005
RE: artificial intelligence script(close window)
First things first. You can't detect when a user has closed your window.

Secondly, to get a nudge event you need to get the information from the protocol. The information isn't sent like "/nudge". Look at cookies nudge protection script or my nudgeback script to see how to detect a nudge.

Cloudy.
[Image: cloudy.jpg]
Sig by pirateok/marisaok/marisa ;)
quote:
Originally posted by Moulin Rouge
The greatest thing you'll ever learn, is just to love and be loved in return

6910 days, 8 hours, 25 minutes, 52 seconds ago
09-19-2006 11:48 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: artificial intelligence script(close window)
  • #0 I opened the thread looking in full expectation to see something about AI... this has got absolutely nothing todo with AI... :(

  • #1
    1. The ChatWndDestroyed event is fired when a chat window on your side is closed.

    2. You can still send a message from inside this event because this event is triggered right before a chat window of you gets closed/destroyed, not after. So the window is still open at the time this event is executed.

    3. Remember that a chat window can have multiple contacts. So it isn't as easy as "to get the contact's email". You will get the emails of all the contacts which are in the chat window.

    4. To get the emails of the contacts, you need to enumerate a Contacts object to get a Contact object from where you can get the Email property.
      If you look into the Scripting Documentation, you'll see that a ChatWnd object (which you get as a parameter in the ChatWndDestroyed event) will have a property Contacts.
      Thus:

      ChatWnd.Contacts
        > Contact > Contact.Email
        > Contact > Contact.Email
        > Contact > Contact.Email
        > etc...

      in code:
      code:
      var objContactsInWindow = ChatWnd.Contacts;
      for (var e = new Enumerator(objContactsInWindow); !e.atEnd(); e.moveNext()) {
              var objContact = e.item();
              Debug.Trace(objContact.Email);
      }
      or in short:
      code:
      for (var e = new Enumerator(ChatWnd.Contacts); !e.atEnd(); e.moveNext()) {
              Debug.Trace(e.item().Email);
      }
      note: this is also given as example in the Scripting Documentation.

    5. Because of (A), what you want to do is not possible with the use of the ChatWndDestroyed event.
      To do what you want you need to use 'packet sniffing' and sniff the incomming packets for a closed session notification.

      Because of the nature of these closed session notifications, you can still not do what you want to do as these notifications are also send by the Messenger server itself when a timeout occurs (thus even when the contact did not closed the window).

    6. Before you send a message to a chat window you must always check if you actually can send a message by checking upon the EditChangeAllowed boolean property of the ChatWnd object.
  • #2
    1. I dunno what you exactly mean or want here, but I guess you want to know what is used in JScript as an escape character? it is the slash: \

      eg:
         \n => newline
         \t => tab
         \xCD => character in hexadecimal notation (must be 2 digits)
         \uABCD => unicode character in hexadecimal notation (must be 4 digits)
         \\ => the character \
         \/ => the character / (for use in regular expressions for example)
         etc...

    2. As said by Cloudhunter, a nudge can not be detected by normal means. Again you must revert to 'packet sniffing' for that.


packet sniffing is listening to the raw incomming packets which are send by the servers (and listening to the raw outgoing packets send by your Messenger). You can use Pai's Xniff ActiveX DLL to do this.

This post was edited on 09-20-2006 at 12:29 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-20-2006 12:19 AM
Profile PM Find Quote Report
xsouldeath
Junior Member
**


Posts: 30
Joined: Sep 2006
O.P. RE: artificial intelligence script(close window)
good stuff ppl lol thanx 4 quick reply..well i now tweak messenger avaialble @ mess.be had notification when they closed a window so i thought it was thorugh Messenger Plus or the protocol or w/e..maybe u cant do it anymore

another thing is 1) kicking ppl off msn 2) spying on msn convesrsations
does the mesenger plus allow such actions, because i know someone who has spied on my windows msesenger live convesraitons not sure what he used but he knew exactly who i was tlaking to and he doesnt know the guy
09-20-2006 12:27 AM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: artificial intelligence script(close window)
You can search for forums to answer most of your questions you know...

Kicking people off msn... I'm guessing you mean group chats. Like I said, search. There are numerous threads that explain this.

As for spying on another persons  conversation... It isn't/shouldn't be possible because of privacy. However your friend did it, it was most likely not done with Messenger Plus

EDIT:
quote:
Originally posted by CookieRevised
#0 I opened the thread looking in full expectation to see something about AI... this has got absolutely nothing todo with AI...
So did I...

This post was edited on 09-20-2006 at 12:31 AM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
09-20-2006 12:30 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: artificial intelligence script(close window)
quote:
Originally posted by xsouldeath
good stuff ppl lol thanx 4 quick reply..well i now tweak messenger avaialble @ mess.be had notification when they closed a window so i thought it was thorugh Messenger Plus or the protocol or w/e..maybe u cant do it anymore
You can still 'do it' and it will be in exactly the same way as the other tools do it: by packet sniffing (the protocol). But as said it is not a closed window notification, it is a closed session notification and it can be triggered by the server itself in many other occasions than simply the contact closing the chat window. So it is not accurate at all...

quote:
Originally posted by xsouldeath
another thing is 1) kicking ppl off msn 2) spying on msn convesrsations
does the mesenger plus allow such actions, because i know someone who has spied on my windows msesenger live convesraitons not sure what he used but he knew exactly who i was tlaking to and he doesnt know the guy
1) you can not kick people off (anymore; it was previously possible due to a bug in Messenger)
2) spying:
a) you will not get any help on this as it is considered illegal and immoral and therefore not allowed.
b) it is even not possible unless the contact you want to spy on and which is on another network, runs a script/trojan/whatever on his own computer which sends everything back to you.

This post was edited on 09-20-2006 at 12:37 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-20-2006 12:34 AM
Profile PM Find Quote Report
Lou
Veteran Member
*****

Avatar

Posts: 2475
Reputation: 43
– / Male / Flag
Joined: Aug 2004
RE: artificial intelligence script(close window)
quote:
Originally posted by xsouldeath
1) kicking ppl off msn 2) spying on msn convesrsations
Even if this was remotely possible (which it isn't) Patchou wouldn't support it. It's privacy invasion. Illegal and stupid.
[Image: msghelp.net.png]
The future holds bright things in it\\\'s path, but only time will tell what they are and where they come from.
Messenger Stuff Forums
09-20-2006 12:36 AM
Profile PM Web Find Quote Report
xsouldeath
Junior Member
**


Posts: 30
Joined: Sep 2006
O.P. RE: artificial intelligence script(close window)
okay adding any two numbers(reasnoable numbers)..
like if they say 1 + 1 my program should say 2

if (Message.match(/(^|\s+)(\*)?add(d|s)?(\*)?($|\s+)/i)!=null)
{
//i was trying to find the frikken equal sign lol ..but
var plus =Message.indexOf("+");
var value1= Message.substring(0,plus)
var value2=Message.substring(plus+1,Message.length()-1)
}

okay how does the Message.match function work
because I have
if(Message.match(/(^|\s+)(\*)?1+1?(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage("duh its 2 u moron");
}
if(Message.match(/(^|\s+)(\*)?2+2?(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage("duh its 4 u moron");
}
if(Message.match(/(^|\s+)(\*)?2+5?(d|s)?(\*)?($|\s+)/i)!=null)
{
ChatWnd.SendMessage("duh its 7 u moron");
}

but when someone says add 2 + 2
it says:
"duh its 2 u moron
duh its 7 u moron"

in other words both if statements are triggered..how do i make it match exactly or properly..


and i fixed the adding thingy up a bit but still doens't add properly.
===================
if (Message.match(/(^|\s+)(\*)?add(d|s)?(\*)?($|\s+)/i)!=null)
{
var plus =Message.indexOf("+");
var value1= Message.substring(0,plus);
var value2=Message.substring(plus+1,Message.length()-1);
var final=value1+value2;
ChatWnd.SendMessage(""+final);
}

This post was edited on 09-20-2006 at 01:45 AM by xsouldeath.
09-20-2006 01:39 AM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: artificial intelligence script(close window)
I don't want to sound too negative, but I'd suggest to read up on some tutorials about scripting actually....

search google for JScript tutorials which explain basic scripting...

And a JScript help file can be found here which explains all the functions, methods and properties, etc in details.
(especially look up how regular expressions work and what the correct syntaxis are, as the ones you posted don't make any sense; and it is way too much to explain everything; especially if everything can already be read on the web and in the help file)


For info regarding Plus! functions and methods, see here.

This post was edited on 09-20-2006 at 01:57 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-20-2006 01:51 AM
Profile PM Find Quote Report
xsouldeath
Junior Member
**


Posts: 30
Joined: Sep 2006
O.P. RE: artificial intelligence script(close window)
well i try to look up the Message.match
if (Message.match(/(add)/i))
{
Message=Message.trim();
ChatWnd.SendMessage(Message);
var plus =Message.indexOf("+");
var value1= Message.substring(0,plus);
var value2=Message.substring(plus+1,Message.length()-1);
var final=value1+value2;
ChatWnd.SendMessage(""+final);
}

i guess my program crashes there..
09-20-2006 02:07 AM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » 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