Skip to content
MSN Addons

Hotmail Checker

A TG007 community discussion started by MucH.

Discussion 15 posts
Page 1 of 1
Open
Topic #7282 · 15 published posts · 4,312 views

A snippet that checks if you have unread email in your hotmail account.

 

/*

**

** /hotmail by hixxy ([email protected]) for mIRC 6.17 or above.

**

**

** What the script does

** ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

**

** This script will let you check if you have any unread emails in your hotmail account.

**

** To use this script you have to have SSL enabled in mIRC.

** For help installing OpenSSL please take a look at this page: http://www.mirc.co.uk/ssl.html

**

** If you're interested in learning the MSN Messenger protocol, take a look at http://www.hypothetic.org/docs/msn/ - that's where I learnt. Of course, you'll

** need socket knowledge.

**

** How to load

** ¯¯¯¯¯¯¯¯¯¯¯

**

** You can load this script by typing /load -rs <path to hotmail.mrc>. If you saved the file in your mIRC directory you can just do /load -rs hotmail.mrc.

** You can also just copy/paste it into remote from a website and then hit the OK button.

**

** How to use

** ¯¯¯¯¯¯¯¯¯¯

**

** The syntax is /hotmail <email address> <password>

**

** I think both arguments are fairly self explanatory.

**

** A few lines below this there is a line that says "alias -l failure_check_wait" - this is an alias that tells the script how many seconds wait

** before reporting no unread emails, because hotmail doesn't tell if we have no unread emails, only if we have some. If you have a slow connection I suggest

** increasing it to about 3-4 seconds (just change "return 1" to "return 3" or "return 4"). Just play around with it until it suits your connection nicely.

**

** Contact

** ¯¯¯¯¯¯¯

**

** If you have a feature suggestion, bug report or question, please send an email to [email protected]

** If you got the script from a scripting website and I (hixxy) submitted the code, you may also leave feedback on the script's comment page.

**

*/

 

alias -l failure_check_wait { return 1 }

alias -l raiseerror {
  if (!$line($active,0)) { linesep -a }
  echo $colour(info) -a $1-
  linesep -a
  halt
}

alias -l failure {
  sockclose hotmail_notification
  unset %hotmail_trid
  raiseerror * /hotmail: You have no unread emails
}

alias -l trid {
  inc %hotmail_trid
  return %hotmail_trid
}

alias hotmail {
  if ($0 < 2) { raiseerror * /hotmail: Insufficient parameters }
  if (@ !isin $1) { raiseerror * /hotmail: Invalid email address }
  if (!$portfree(1863)) { raiseerror * /hotmail: Port in use }
  if (!$sslready) { raiseerrror * /hotmail: SSL not ready }
  sockopen hotmail_dispatch messenger.hotmail.com 1863
  sockmark hotmail_dispatch $1-2
}

on *:sockopen:hotmail_dispatch:{
  if ($sockerr) { raiseerror * /hotmail: Socket error }
  sockwrite -n $sockname VER $trid MSNP9 MSNP8 CVR0
}
on *:sockread:hotmail_dispatch:{
  var %data
  sockread %data
  tokenize 32 %data
  if ($1 $3 == VER MSNP9) { sockwrite -n $sockname CVR $trid 0x0409 win 4.10 i386 MSNMSGR 5.0.0544 MSMSGS $gettok($sock($sockname).mark,1,32) }
  elseif ($1 == CVR) { sockwrite -n $sockname USR $trid TWN I $gettok($sock($sockname).mark,1,32) }
  elseif ($1 $3 == XFR NS) {
    sockopen hotmail_notification $gettok($4,1,58) $gettok($4,2,58)
    sockmark hotmail_notification $sock($sockname).mark
    sockclose $sockname
    unset %hotmail_trid
  }
}
on *:sockopen:hotmail_notification:{
  if ($sockerr) {
    unset %hotmail_trid
    raiseerror * /hotmail: Socket error
  }
  sockwrite -n $sockname VER $trid MSNP9 MSNP8 CVR0
}
on *:sockread:hotmail_notification:{
  var %data
  sockread %data
  tokenize 32 %data
  if ($1 $3 == VER MSNP9) { sockwrite -n $sockname CVR $trid 0x0409 win 4.10 i386 MSNMSGR 5.0.0544 MSMSGS $gettok($sock($sockname).mark,1,32) }
  elseif ($1 == CVR) { sockwrite -n $sockname USR $trid TWN I $gettok($sock($sockname).mark,1,32) }
  elseif ($1 $3-4 == USR TWN S) {
    var %email = $gettok($sock($sockname).mark,1,32), %password = $gettok($sock($sockname).mark,2,32)
    sockopen -e hotmail_nexus nexus.passport.com 443
    sockmark hotmail_nexus Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in= $+ %email $+ ,pwd= $+ %password $+ , $+ $5-
  }
  elseif ($1 $3 == USR OK) {
    sockwrite -n $sockname CHG $trid HDN 0
    .timerhotmail_failure 1 $failure_check_wait failure
  }
  elseif ($1 == inbox-unread:) {
    .timerhotmail_failure off
    sockclose $sockname
    unset %hotmail_trid
    raiseerror * /hotmail: You have $2 unread email $+ $iif($2 > 1,s)
  }
}
on *:sockopen:hotmail_nexus:{
  if ($sockerr) {
    unset %hotmail_trid
    sockclose hotmail_notification
    raiseerror * /hotmail: Socket error
  }
  sockwrite -n $sockname GET /rdr/pprdr.asp HTTP/1.0
  sockwrite -n $sockname
}
on *:sockread:hotmail_nexus:{
  var %data
  sockread %data
  tokenize 32 %data
  if ($1 == passporturls:) {
    sockopen -e hotmail_login $gettok($gettok($gettok($2,2,44),1,47),2,61) 443
    sockmark hotmail_login / $+ $gettok($gettok($2,2,44),2,47) $sock($sockname).mark
  }
}
on *:sockopen:hotmail_login:{
  if ($sockerr) {
    unset %hotmail_trid
    sockclose hotmail_notification
    raiseerror * /hotmail: Socket error
  }
  sockwrite -n $sockname GET $gettok($sock($sockname).mark,1,32) HTTP/1.1
  sockwrite -n $sockname Authorization: $gettok($sock($sockname).mark,2-,32)
  sockwrite -n $sockname Host: $sock($sockname).ip
  sockwrite -n $sockname
}
on *:sockread:hotmail_login:{
  var %data
  sockread %data
  tokenize 32 %data
  if ($1 == location:) {
    var %mark = $gettok($sock($sockname).mark,2-,32)
    sockclose $sockname
    sockopen -e $sockname $gettok($2,2,47) 443
    sockmark $sockname $gettok($2,3,47) %mark
  }
  elseif ($1 == authentication-info:) && (*'t=*'* iswm $1-) {
    sockwrite -n hotmail_notification USR $trid TWN S $gettok($1-,2,39)
    sockclose $sockname
  }
}

can i just point out that this is done the hard way , i made an email client like 6 months ago and it will check and allow you to send emails

and works with any email addys

even google if you change the ports in the script

My code does NOT have bugs. It just develops random features.

You can't check two different inboxes on two different servers just by changing ports 0.o

err0r: 666 + 1337 = 2003 backwards is 3002 which is how many people ozzy has banned from tg
err0r: spooky

you dope , where does it say 2 diff servers by changing ports

 

but as it happens google uses diff ports to most servers

 

most use

110

25

 

google uses

995

465

 

even google if you change the ports in the script

 

 

Edited Aug 31, 2006 9:53 PM by Ozzy10

My code does NOT have bugs. It just develops random features.

Say you wanted to check hotmail account.... so you do and then you want to check gmail account...you can't just change the port to check mail on gmail, you'd have to change where it's connecting to first =p

err0r: 666 + 1337 = 2003 backwards is 3002 which is how many people ozzy has banned from tg
err0r: spooky

can i just point out that this is done the hard way , i made an email client like 6 months ago and it will check and allow you to send emails

and works with any email addys

even google if you change the ports in the script

 

where in that does it say you ONLY change the ports

stop being an ass

 

says will even check google if you change the ports

cause if you dont you wont be able to check

My code does NOT have bugs. It just develops random features.

Which way did you use Ozzy? As far as I'm aware hotmail's SMTP and POP3 servers are only available to paying users. I wanted this to work for free and paying. Besides that, I was dabbling with the MSN messenger protocol again and thought this would be good practice.

 

Edit: in fact, some people claim it has neither, but only has HTTP access. Unless I'm reading an age-old resource I don't see a simpler way to tell how many unread emails you have, so I'm curious :)

Edited Sep 1, 2006 8:10 AM by hixxy

Ohhhhh okay I get you ozzy lmfao. *bows head in shame now*

err0r: 666 + 1337 = 2003 backwards is 3002 which is how many people ozzy has banned from tg
err0r: spooky

don't feel bad.. he calls me an ass too.

Get information about ircWx here

Thats cuz you are? :P

lmao

My code does NOT have bugs. It just develops random features.

Thats cuz you are? :P

you have no idea

Get information about ircWx here

Damn was reading this topic and thought i was on elite-scriptaz their for a minute. lmao

 

By the way Ozzy, are you the ghost of common sense.

Edited Sep 1, 2006 7:32 PM by XploziOn

I know I dont :embar:

BTW, I love my new member title

<3 err0r :embar:

Edited Sep 1, 2006 7:40 PM by X-Fusion

nice work hexxy .. post us ur email checker ozzy