Thanks hixxy. i'm still having trouble however capturing the ticket and profile. here is the full code so far:

Quote:

GCF 0 6735
ticket is:
profile is:
-
* /echo: insufficient parameters (line 54, Test.mrc)
-
* /tokenize: line too long (line 52, Test.mrc)
-


Code:
alias email return bzerk_10@msn.com

alias msnlogin {
  sockopen initial messenger.hotmail.com 1863
}

alias reset {
  sockclose initial
  sockclose notification
  unset %msn.*
}

alias trid {
  inc %msn. $+ $1
  return $($+(%,msn.,$1),2)
}

on *:sockclose:*:{
  if ($istok(initial notification,$sockname,32)) unset %msn. $+ $sockname
}

on *:SOCKOPEN:initial: {
  sockwrite -n $sockname VER $trid($sockname) MSNP15 CVR0
}

on *:SOCKREAD:initial: {
  var %x | sockread %x | tokenize 32 %x

  echo -a %x

  if ($1-3 == VER 1 MSNP15) {
    sockwrite -n $sockname CVR $trid($sockname) 0x0409 winnt 5.1 i386 MSNMSGR 8.0.0328 msmsgs bzerk_10@msn.com   
  }

  elseif ($1-2 == CVR 2) {
    sockwrite -n $sockname USR $trid($sockname) TWN I bzerk_10@msn.com
  }

  ; redirection (need to use ssl when connecting to switchboard server - sockopen -e)
  elseif ($1 == XFR) {
    var %ip = $gettok($4,1,58), %port = $gettok($4,2,58)

    sockopen notification %ip %port
  }
}

on *:SOCKOPEN:notification: {
  sockwrite -n $sockname VER $trid($sockname) MSNP15 CVR0
}

on *:SOCKREAD:notification: {
  var %x | sockread %x | tokenize 32 %x

  echo -a %x

  if ($1-3 == VER 1 MSNP15) {
    sockwrite -n $sockname CVR $trid($sockname) 0x0409 winnt 5.1 i386 MSNMSGR 8.0.0328 msmsgs bzerk_10@msn.com   
  }

  elseif ($1-2 == CVR 2) {
    sockwrite -n $sockname USR $trid($sockname) TWN I bzerk_10@msn.com
  }

  elseif ($1 == GCF) {
    sockread -f $3 &data
    var %start = $calc($bfind(&data,1,t=) + 7), %end = $calc($bfind(&data,%start,&p=) - 1), %ticket = $bvar(&data,$+(%start,-,%end)).text
    var %start = $calc($bfind(&data,1,&p=) + 9), %end = $calc($bfind(&data,%start,$crlf) - 1), %profile = $bvar(&data,$+(%start,-,%end)).text
    ; Do whatever you need to with %ticket and %profile here.

    echo -a ticket is: %ticket
    echo -a profile is: %profile

    ; sockwrite -n $sockname USR $trid($sockname) TWN S t= $+ %ticket $+ &profile= $+ %profile
  }
}


I'm following this for msn documentation

http://209.85.229.132/search?q=cache:mvF1xSZB0IcJ:www.csse.monash.edu.au/courseware/cse1370/2006/Chat/mosim.doc+msnp14+authentication&cd=8&hl=en&ct=clnk&gl=uk

Last edited by pouncer; 25/05/09 03:48 PM.