BlueHell mIRC Script — File Browser
BlueHellmIRCScriptv1.0 / BlueHellmIRCScriptv1.0 / BlueHellScript / msn / msn.mrc
msn.mrc — 86.35 KB — Download this file
;--------------------------------------------------------------------------------------------------------------------------------
;MSN Messenger for mIRC
;Andy Carvell 2003-2008
;Version 3.93
;Pass this on complete to anyone you know by any means.
;Do not steal bits from this code for your own use.
;Check http://www.burningimage.net/msn for updates
;Editing this code will result in errors, which the creator will
;not provide support for.
;--------------------------------------------------------------------------------------------------------------------------------
;Thanks to Erdinc for major help with Proxy/Socks :) [ Erdinc@hotmail.com ]
;Thanks for foreign character help: vIndEx, Jorge, Madis, Per Ståle Kvam, Sen, Webmaster de Niputagracia.com, Francisco del Valle, Lasse Brun, Ferminho Stealth Angel
;--------------------------------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------------------------------
;Thanks to Artwerks, sax and El_Santo for their help
;Thanks to Dan from the forum.
;blah.dll is by sax
;listfiles.dll is by Misanthrop
;--------------------------------------------------------------------------------------------------------------------------------
on *:UNLOAD:{
.timer*@* off
.timer*msn* off
}
on *:START:{
if ( %msn.autoconnect == $yes ) {
if ( %msn.rememberpass == 0 ) { echo -a Error: You must have 'Remember my username and password' enabled for MSN for mIRC to automatically connect to MSN }
msnstart }
set %mirc.dir $gettok($mircexe,1- $+ $calc($numtok($mircexe,92)-1),92)
unset %msn.say.no
if ( %msn.firsttime == 1 ) {
echo -a ---
echo -a MSN Messenger for mIRC v $+ $msnversion
echo -a /msn to connect.
echo -a /msncontrol for the control panel.
echo -a Alternatively, use the menu in mIRC.
echo -a
echo -a Commands:
echo -a /msn.name <new msn name>
echo -a /msn.status <status> (type /msn.status help for more information)
echo -a ---
echo -a This message will not appear again
echo -a ---
}
inc %msn.firsttime 1
}
alias msncontrol {
dialog -m msncontrol msncontrol
}
alias msn {
if ($sslready != $true) {
echo -a 4Warning: You do not have the SSL dll's installed correctly.
echo -a 4If you have just upgraded your mIRC version then you may need to reinstall MSN for mIRC from 12http://www.burningimage.net/msn4. If this fails then please read SSL.txt (/run SSL.txt).
echo -a 4MSN for mIRC will automatically try to fallback on other connection methods, but these can be unreliable. You are strongly advised to either reinstall MSN for mIRC or read SSL.txt.
}
write -c blocked.txt
dialog -m msnconnect msnconnect
if ( %msn.rememberpass == 1 ) { did -c msnconnect 9 }
}
alias msnstart {
newver
:top
.timermsnping off
if ( %msn.oldauth == 1) { msnauth }
;hadd -m msnauth path $iif(*@hotmail.com iswm %msn.user,loginnet.passport.com,$iif(*@msn.com iswm %msn.user,msnialogin.passport.com,login.passport.com))
hadd -m msnauth path $iif(*@hotmail.com iswm %msn.user,loginnet.passport.com,$iif(*@hotmail.co.uk iswm %msn.user,loginnet.passport.com,$iif(*@msn.com iswm %msn.user,msnialogin.passport.com,login.passport.com)))
hadd -m messenger email %msn.user
hadd -m messenger password %msn.pass
delgroupinfo
if ( %msn.user == $null ) { halt }
set %msn.main 0
unset %msn.naggedonce
sockclose msn
write -c $shortfn($scriptdir) $+ allusers.txt
window -c @Messenger
if (%msn.window.minimise == $yes) {
window -l50k0nSz @Messenger %msn.messenger.font $shortfn($scriptdir) $+ /msn.ico
}
else {
window -l50k0Sz @Messenger %msn.messenger.font $shortfn($scriptdir) $+ /msn.ico
}
if (%msn.autoidle = yes) { .timermsnidle 0 10 .checkmsnidle }
aline @Messenger v $+ $msnversion
if ($version < 6.20) { aline -p @Messenger 4SSL support is very bad in this version of mIRC, you may not be able to connect. Please upgrade to at least mIRC version 6.2. }
aline -p @messenger $+ ---- Message of the Day ----
aline -p @Messenger %msn.motd
sockclose msnno
if (%msn.useproxy == no) sockopen msnno %msn.server %msn.server.port
elseif (%msn.useproxy == proxy) sockopen msnproxy %msn.server.proxy %msn.server.proxy.port
elseif (%msn.useproxy == socks) sockopen msnsocks %msn.server.socks %msn.server.socks.port
else aline -p @messenger 4Error! Please reset your proxy settings.
if (%msn.warning == on) {
unset %msn.warning
aline -p @messenger 4*** Warning - MSN for mIRC may not be installed in the correct location, your contact groups may not show correctly
}
aline -p @messenger 10*** Connecting...
if ( %msn.background == $yes ) {
if ( $version == 6.3 ) { background -apf $shortfn($scriptdir) $+ bg.jpg }
else { background -f @Messenger $shortfn($scriptdir) $+ bg.jpg }
}
else {
if ( $version == 6.3 ) { background -apx }
else { background -x @Messenger }
}
}
on *:sockopen:msnsocks:{
bset &binvar 1 4 | bset &binvar 2 1 | bset &binvar 3 $int($calc(%msn.server.port / 256)) | bset &binvar 4 $calc(%msn.server.port % 256) | bset &binvar 5 $gettok(%msn.server,1,46)
bset &binvar 6 $gettok(%msn.server,2,46) | bset &binvar 7 $gettok(%msn.server,3,46) | bset &binvar 8 $gettok(%msn.server,4,46) | bset &binvar 9 0
if ($sock($sockname).status == active) {
sockwrite $sockname &binvar
aline -p @messenger 10*** Connecting to MSN via Socks...
sockrename $sockname msn
.timer 1 3 sendmsn VER %msn.main MSNP9 MSNP8 CVR0
.timermsnsocks 1 3 sendmsn INF $calc(%msn.main + 1 )
}
}
on *:sockopen:msnproxy:{
if ($sock($sockname).status == active) {
sockwrite -n $sockname CONNECT %msn.server $+ : $+ %msn.server.port http/1.0
sockrename $sockname msn
aline -p @messenger 10*** Connecting to MSN through HTTP Proxy...
.timermsnprox 1 3 sendmsn VER %msn.main MSNP8 CVR0
.timermsnprox2 1 6 sendmsn INF $calc(%msn.main + 1)
}
}
on *:sockopen:msnno:{
if ( %msn.debug == 1 ) { aline -p @messenger 10*** Connected }
sockclose msn
sockrename $sockname msn
sendmsn VER %msn.main MSNP8 CVR0
}
alias sendmsn {
if ( $sock(msn) != $null ) {
if ( %msn.debug == 1 ) { aline -p @messenger 4 $+ $1- }
sockwrite -n msn $1-
inc %msn.main 1
}
}
on *:close:@:{
if ( $target == @Messenger ) { sockclose msn | sockclose chat.* | .timermsn* off | halt }
sockclose chat. $+ $right($target, $calc($len($target) - 1))
if (*.com iswm $right($target,-1)) || (*.co.uk iswm $right($target,-1)) || (*.net iswm $right($target,-1)) {
.timer $+ $right($target,-1) off
}
}
on *:sockread:msn:{
if ($sockerr > 0) return
:nextread
if ( $sock($sockname) == $null ) { halt }
sockread %msn.data
set %msn.data.nodecode %msn.data
if ($sockbr == 0) return
if ( %msn.data == $null ) { goto fdf }
if ( $gettok(%msn.data,1-3,32) == USR $calc(%msn.main - 1) OK ) {
set %msn.name $rawurldecode( $gettok(%msn.data,5,32))
}
set %msn.data $rawurldecode(%msn.data)
set %msn.data $replace(%msn.data,Â,$null)
if ( %msn.debug == 1 ) { aline -p @messenger %msn.data | echo %msn.data }
:fdf
if ( VER $calc(%msn.main - 1) MSNP8 isin %msn.data ) {
hadd -m messenger session $calc($hget(messenger,session) + 1)
sendmsn CVR %msn.main 0x0409 winnt 5.1 i386 MSMSGS 4.7.3001 WindowsMessenger %msn.user
}
if ( $left(%msn.data,3) == CVR ) {
hadd -m messenger session $calc($hget(messenger,session) + 1)
sendmsn USR %msn.main TWN I %msn.user
}
if ( $left(%msn.data,3) == XFR ) && ( $gettok(%msn.data,3,32) != SB ) {
set %msn.temp $gettok(%msn.data,4,32)
sockclose msn
set %msn.newserver $gettok(%msn.temp,1,58)
set %msn.newserver.port $gettok(%msn.temp,2,58)
if ( %msn.debug == 1 ) { aline -p @messenger 4 $+ Switching to server %msn.newserver $+ : $+ %msn.newserver.port ... }
if (%msn.useproxy == no) .timer 1 1 sockopen msnno %msn.newserver %msn.newserver.port
elseif (%msn.useproxy == proxy) .timer 1 1 sockopen msnproxy %msn.server.proxy %msn.server.proxy.port
elseif (%msn.useproxy == socks) .timer 1 1 sockopen msnsocks %msn.server.socks %msn.server.socks.port
else aline -p @messenger 4Error! Please reset your proxy settings.
return
}
if ( $left(%msn.data,11) == USR $calc(%msn.main - 1) MD5 S ) { sendmsn USR %msn.main MD5 S $md5($gettok(%msn.data,5,32) $+ %msn.pass) }
if ( $left(%msn.data,3) = ILN ) {
set %msn.nick $gettok(%msn.data,5-,32)
set %msn.temp4 $calc($numtok(%msn.nick,32)-1)#
set %msn.nick $gettok(%msn.nick,1 - %msn.temp4 ,32)
msndeleteoffline
if ($read(blocked.txt, w, $gettok(%msn.data,4,32)) != $null) { set %msn.nick 14|BLOCKED| %msn.nick }
if ( $gettok(%msn.data,3,32) == NLN ) { iline -l @Messenger 1 3 $+ %msn.nick 15< $+ $gettok(%msn.data,4,32) $+ > }
if ( $gettok(%msn.data,3,32) == AWY ) { iline -l @Messenger 1 7 $+ %msn.nick [AWAY] 15< $+ $gettok(%msn.data,4,32) $+ > }
if ( $gettok(%msn.data,3,32) == BSY ) { iline -l @Messenger 1 13 $+ %msn.nick [BUSY] 15< $+ $gettok(%msn.data,4,32) $+ > }
if ( $gettok(%msn.data,3,32) == BRB ) { iline -l @Messenger 1 10 $+ %msn.nick [BRB] 15< $+ $gettok(%msn.data,4,32) $+ > }
if ( $gettok(%msn.data,3,32) == PHN ) { iline -l @Messenger 1 11 $+ %msn.nick [PHN] 15< $+ $gettok(%msn.data,4,32) $+ > }
if ( $gettok(%msn.data,3,32) == LUN ) { iline -l @Messenger 1 6 $+ %msn.nick [LUNCH] 15< $+ $gettok(%msn.data,4,32) $+ > }
if ( $gettok(%msn.data,3,32) == IDL ) { iline -l @Messenger 1 5 $+ %msn.nick [IDLE] 15< $+ $gettok(%msn.data,4,32) $+ > }
;WAIT 5 SECONDS BEFORE SORTING THE LIST
.timermsnwaitlist 1 5 msnarrangelist
}
if ( $left(%msn.data,3) == NLN ) {
set %msn.nick $gettok(%msn.data,4-,32)
set %msn.temp4 $calc($numtok(%msn.nick,32)-1)
set %msn.nick $gettok(%msn.nick,1 - %msn.temp4 ,32)
if ($read(blocked.txt, w, $gettok(%msn.data,3,32)) != $null) { set %msn.nick 14|BLOCKED| %msn.nick }
set %msn.linenumber $fline(@Messenger,* $+ $gettok(%msn.data,3,32) $+ *,1,1)
set %msn.offlinelocation $fline(@Messenger,*Offline Contacts*,1,1)
;IT IS CORRECT TO DO THIS AGAIN
set %msn.linenumber $fline(@Messenger,* $+ $gettok(%msn.data,3,32) $+ *,1,1)
;IF THE EMAIL IS BELOW THE "OFFLINE CONTACTS" HEADER
if ( %msn.linenumber > %msn.offlinelocation ) { dline -l @Messenger %msn.linenumber | unset %msn.linenumber }
if ( %msn.sounds == on ) && (!%msn.linenumber) { splay $shortfn($scriptdir) $+ blip.wav }
if (!%msn.linenumber) { aline -p @messenger $timestamp 7 $+ %msn.nick has logged on. }
if ( %msn.showlogon == $yes ) && (!%msn.linenumber) {
if ( $version >= 6.3 ) && ( $tip(msnmirc,MSN for mIRC,%msn.nick has logged on,,$shortfn($scriptdir) $+ msn2.ico,,msnchatwindow $gettok(%msn.data,3,32),) != 0 ) {
}
elseif ( Messenger !isin $active ) { echo 3 -a %msn.nick has logged on to MSN. }
}
if ( $gettok(%msn.data,2,32) == NLN ) {
if (no online contacts isin $line(@Messenger,1,1)) { dline -l @Messenger 1 }
if (!%msn.linenumber) { iline -l @Messenger 1 3 $+ %msn.nick 15< $+ $gettok(%msn.data,3,32) $+ > | msnarrangelist } | else { dline -l @Messenger %msn.linenumber | iline -l @Messenger %msn.linenumber 3 $+ %msn.nick 15< $+ $gettok(%msn.data,3,32) $+ > }
if (%msn.detailedstatuslog == yes) { aline @Messenger $timestamp %msn.nick changed their status to online. }
}
if ( $gettok(%msn.data,2,32) == AWY ) { if (!%msn.linenumber) { iline -l @Messenger 1 7 $+ %msn.nick [AWAY] 15< $+ $gettok(%msn.data,3,32) $+ > | msnarrangelist } | else { dline -l @Messenger %msn.linenumber | iline -l @Messenger %msn.linenumber 7 $+ %msn.nick [AWAY] 15< $+ $gettok(%msn.data,3,32) $+ > } }
if ( $gettok(%msn.data,2,32) == BSY ) { if (!%msn.linenumber) { iline -l @Messenger 1 13 $+ %msn.nick [BUSY] 15< $+ $gettok(%msn.data,3,32) $+ > | msnarrangelist } | else { dline -l @Messenger %msn.linenumber | iline -l @Messenger %msn.linenumber 13 $+ %msn.nick [BUSY] 15< $+ $gettok(%msn.data,3,32) $+ > } }
if ( $gettok(%msn.data,2,32) == BRB ) { if (!%msn.linenumber) { iline -l @Messenger 1 10 $+ %msn.nick [BRB] 15< $+ $gettok(%msn.data,3,32) $+ > | msnarrangelist } | else { dline -l @Messenger %msn.linenumber | iline -l @Messenger %msn.linenumber 10 $+ %msn.nick [BRB] 15< $+ $gettok(%msn.data,3,32) $+ > } }
if ( $gettok(%msn.data,2,32) == PHN ) { if (!%msn.linenumber) { iline -l @Messenger 1 11 $+ %msn.nick [PHONE] 15< $+ $gettok(%msn.data,3,32) $+ > | msnarrangelist } | else { dline -l @Messenger %msn.linenumber | iline -l @Messenger %msn.linenumber 11 $+ %msn.nick [PHN] 15< $+ $gettok(%msn.data,3,32) $+ > } }
if ( $gettok(%msn.data,2,32) == LUN ) { if (!%msn.linenumber) { iline -l @Messenger 1 6 $+ %msn.nick [LUNCH] 15< $+ $gettok(%msn.data,3,32) $+ > | msnarrangelist } | else { dline -l @Messenger %msn.linenumber | iline -l @Messenger %msn.linenumber 6 $+ %msn.nick [LUNCH] 15< $+ $gettok(%msn.data,3,32) $+ > } }
if ( $gettok(%msn.data,2,32) == IDL ) { if (!%msn.linenumber) { iline -l @Messenger 1 5 $+ %msn.nick [IDLE] 15< $+ $gettok(%msn.data,3,32) $+ > | msnarrangelist } | else { dline -l @Messenger %msn.linenumber | iline -l @Messenger %msn.linenumber 5 $+ %msn.nick [IDLE] 15< $+ $gettok(%msn.data,3,32) $+ > } }
if ( $gettok(%msn.data,2,32) == AWY ) && (%msn.detailedstatuslog == yes) { aline @Messenger $timestamp %msn.nick changed their status to away. }
if ( $gettok(%msn.data,2,32) == BSY ) && (%msn.detailedstatuslog == yes) { aline @Messenger $timestamp %msn.nick changed their status to busy. }
if ( $gettok(%msn.data,2,32) == BRB ) && (%msn.detailedstatuslog == yes) { aline @Messenger $timestamp %msn.nick changed their status to be right back. }
if ( $gettok(%msn.data,2,32) == PHN ) && (%msn.detailedstatuslog == yes) { aline @Messenger $timestamp %msn.nick changed their status to on the phone. }
if ( $gettok(%msn.data,2,32) == LUN ) && (%msn.detailedstatuslog == yes) { aline @Messenger $timestamp %msn.nick changed their status to out for lunch. }
if ( $gettok(%msn.data,2,32) == IDL ) && (%msn.detailedstatuslog == yes) { aline @Messenger $timestamp %msn.nick has gone idle. }
}
if ( $left(%msn.data,3) == FLN ) {
set %msn.temp $gettok($line(@Messenger,$fline(@Messenger,*< $+ $gettok(%msn.data,2,32) $+ >,1,1),1),1,60)
set %msn.temp $mid($gettok($line(@Messenger,$fline(@Messenger,*< $+ $gettok(%msn.data,2,32) $+ >,1,1),1),1,60),3)
set %msn.temp $left(%msn.temp,$calc($len(%msn.temp)-4))
set %msn.temp $gettok(%msn.temp,1 - $calc($numtok(%msn.temp,91) - 1),91)
aline -p @messenger $timestamp 4 $+ %msn.temp logged off.
set %msn.nickline $fline(@Messenger,*< $+ $gettok(%msn.data,2,32) $+ >,1,1)
set %msn.offlinetext $strip($line(@Messenger,%msn.nickline,1))
dline -l @Messenger %msn.nickline
;CHECK THE BEFORE AND AFTER LINES
if (@ !isin $line(@Messenger,$calc(%msn.nickline - 1),1)) && ( @ !isin $line(@Messenger,$calc(%msn.nickline),1)) { iline -l @Messenger %msn.nickline 15[no online contacts] }
if (%msn.showoffline == $yes) { iline -l @Messenger $calc($line(@Messenger,0,1) + 1) 14 $+ $gettok(%msn.offlinetext,1- $+ $calc($numtok(%msn.offlinetext,32) - 1),32) 15 $+ $gettok(%msn.offlinetext,$numtok(%msn.offlinetext,32),32) }
}
if ( $left(%msn.data,3) == CHL ) {
sendmsn QRY %msn.main msmsgs@msnmsgr.com 32
sockwrite msn $md5( $gettok(%msn.data,3,32) $+ Q1P7W2E4J9R8U3S5)
aline -p @messenger 10*** Online Contacts Received, displayed on the right
msnarrangelist
.timermsnping 0 30 { msndoping }
}
if ( $left(%msn.data,3) == XFR ) && ( $gettok(%msn.data,3,32) == SB ) {
set %msn.chatserver $gettok(%msn.data,4,32)
sockclose chat. $+ %msn.clickemail
sockopen chat. $+ %msn.clickemail $gettok(%msn.chatserver,1,58) $gettok(%msn.chatserver,2,58)
set %msn.chat.hash $gettok(%msn.data,6,32)
if ($window(@ $+ %msn.clickemail) == $null ) {
msnopenwindow %msn.clickemail max
aline @ $+ %msn.clickemail 10*** Please wait for the user to join... ***
}
}
if ( $left(%msn.data,3) == RNG ) {
set %msn.chat.hash $gettok(%msn.data,5,32) $gettok(%msn.data,2,32)
set %msn.chatserver $gettok(%msn.data,3,32)
set %msn.status answering
sockclose chat. $+ $gettok(%msn.data,6,32)
sockopen chat. $+ $gettok(%msn.data,6,32) $gettok(%msn.chatserver,1,58) $gettok(%msn.chatserver,2,58)
msnopenwindow $gettok(%msn.data,6,32)
}
if ( $left(%msn.data,3) == 911 || $left(%msn.data,3) == 911 ) { beep | echo -a 4*** ERROR: Authentication failed, is your login name and password correct? }
if ( $gettok(%msn.data,1,32) == Inbox-Unread: ) && ( $gettok(%msn.data,2,32) != 0 ) { set %msn.newmail You have $gettok(%msn.data,2,32) new e-mail message(s) | if ( %msn.mailnotification == yes ) { dialog -m msnmail msnmail } }
if ( $gettok(%msn.data,1-2,32) == Content-Type: text/x-msmsgsemailnotification; ) { set %msn.newmail You have 1 new e-mail message | if ( %msn.mailnotification == yes ) { dialog -m msnmail msnmail } }
if ( $gettok(%msn.data,1,32) == LSG ) {
set %msn.group. $+ $rawurldecode( $gettok(%msn.data.nodecode,2,32) ) $+ .name $replace( $rawurldecode( $gettok(%msn.data.nodecode,3,32) ), $chr(32) ,_)
if ( %msn.sortbygroup == $yes ) { aline -l @Messenger $+ $rawurldecode($gettok(%msn.data.nodecode,3,32)) $+ }
}
if ( $gettok(%msn.data,1,32) == USR && $gettok(%msn.data,3,32) == TWN && $gettok(%msn.data,4,32) == S ) {
hadd -m msnauth info Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in= $+ $replace(%msn.user,@,$(%40,0)) $+ ,pwd= $+ %msn.pass $+ , $+ $gettok(%msn.data,5-,32)
if ( %msn.oldauth != 1) {
msnnewauth
aline -p @messenger 10*** Authorising via OpenSSL (be sure to click 'Accept' on any windows that appear)...
}
if ( %msn.oldauth == 1) {
aline -p @messenger 10*** Authorising via Legacy SSL...
if ( $os == 2K ) || ( $os == XP ) || ( $os == Vista ) { msnauth2 }
else {
set %vknc $gettok(%msn.data,5-,32)
openssl
}
}
}
if ( $left(%msn.data,8) == ClientIP ) {
set %msn.ip $gettok(%msn.data,2,32)
sendmsn SYN %msn.main 0
newver in
}
if ($left(%msn.data,3) == SYN) {
set %_t $gettok(%msn.data,4,32)
set %_i 0
}
if ($left(%msn.data,3) = LST) {
inc %_i
if (%_i = %_t) {
if ( %msn.chg == 0 ) { sendmsn CHG %msn.main NLN | titlebar @Messenger -=[ Online ]=- }
else { sendmsn CHG %msn.main HDN | titlebar @Messenger -=[ Appear Offline ]=- }
}
}
if ($left(%msn.data,3) == LST) {
mkdir $shortfn($scriptdir) $+ groups
set %msn.groupnumber $gettok(%msn.data.nodecode,5,32)
write $shortfn($scriptdir) $+ groups\ $+ [ %msn.group. [ $+ [ %msn.groupnumber ] $+ ] .name ] $+ .grp $gettok(%msn.data,2,32)
write $shortfn($scriptdir) $+ allusers.txt $gettok(%msn.data.nodecode,2-3,32)
}
if ($left(%msn.data,3) == LST) {
if ($gettok(%msn.data.nodecode,4,32) & 4) { write blocked.txt $gettok(%msn.data,2,32) }
}
if ($left(%msn.data,3) == 601) || ($left(%msn.data,3) == 500) || ($left(%msn.data,3) == 910) || ($left(%msn.data,3) == 911) { echo -a 4 $+ *** Messenger server is down. Please try again later }
if ($left(%msn.data,3) == QNG) { .timerpngreply off }
if ($left(%msn.data,3) == 913) { echo -a 4 $+ *** You can't perform that action whilst in 'Appear Offline' mode }
if ($left(%msn.data,7) == OUT OTH) { echo -a 4 $+ *** You have signed in somewhere else }
if ($left(%msn.data,3) == ADD) {
if ($gettok(%msn.data,3,32) == RL) {
.timer 1 1 msnconfirmadduser $gettok(%msn.data,5,32) $gettok(%msn.data,6-,32)
}
}
if ($left(%msn.data,3) == REM) {
if ($gettok(%msn.data,3,32) == RL) {
aline -p @Messenger 4*** $gettok(%msn.data,5,32) has removed you from their contact list
}
}
goto nextread
}
alias msnconfirmadduser {
if ($?!" $2- ( $+ $1 $+ ) has added you to their contact list. $crlf $crlf $+ Do you wish to accept them?" == $true) {
addmsnuser $1
}
}
on *:sockclose:msn:{
msndisconnect
}
on *:sockopen:chat*:{
set %msn.$gettok($sockname,2-,46) 1
msnopenwindow $gettok($sockname,2-,46)
;aline @ $+ $gettok($sockname,2-,46) 10*** Connected, Please Wait...
if ( %msn.showtype == YES ) { starttype $gettok($sockname,2-,46) }
if ( %msn.status != answering ) { sockwrite -n $sockname USR %msn.$gettok($sockname,2-,46) %msn.user %msn.chat.hash }
if ( %msn.status == answering ) { sockwrite -n $sockname ANS %msn.$gettok($sockname,2-,46) %msn.user %msn.chat.hash | unset %msn.status }
inc %msn. $+ $gettok($sockname,2-,46) 1
}
on *:sockread:chat*:{
if ($sockerr > 0) return
:nextread
if ( $sock($sockname) == $null ) { halt }
sockread -f %msn.chat.data
if ($sockbr == 0) return
if ( %msn.chat.data == $null ) {
msnopenwindow $gettok($sockname,2-,46)
}
;aline @ $+ $gettok($sockname,2-,46) %msn.chat.data
:fdfdf
if ( $gettok(%msn.chat.data,1,32) == USR ) && ( $gettok(%msn.chat.data,3,32) == OK ) {
sockwrite -n $sockname CAL %msn.$gettok($sockname,2-,46) $gettok($sockname,2-,46)
inc %msn.$gettok($sockname,2-,46) 1
}
if ( $gettok(%msn.chat.data,1,32) == JOI ) {
if ( %msn.irc == done ) {
unset %msn.iro
halt
}
if ($line(@ $+ $right($sockname,$calc($len($sockname)-5)),0) == 1 || %msn.invited == 1 ) {
msnopenwindow $right($sockname,$calc($len($sockname)-5))
if ( %msn.invited == 1) {
aline @ $+ $right($sockname,$calc($len($sockname)-5)) 10*** $rawurldecode($gettok(%msn.chat.data,3,32)) has joined the conversation
unset %msn.invited
}
else {
rline @ $+ $right($sockname,$calc($len($sockname)-5)) $line(@ $+ $right($sockname,$calc($len($sockname)-5)),0) 10*** $rawurldecode($gettok(%msn.chat.data,3,32)) has joined the conversation
}
}
}
if ( $left(%msn.chat.data,3) == MSG ) {
set %msn.msgnick 14 $+ $rawurldecode( $gettok(%msn.chat.data,3,32) )
set %msn.msgnick.log $rawurldecode( $gettok(%msn.chat.data,3,32) )
set %msn.email.msg $right($sockname,$calc($len($sockname)-5))
set %tmp 0
:beg
if (%msn.debug) { echo -a 9 $+ %msn.chat.data }
if ( %tmp == 5 ) {
if ( %msn.chat.data == $null ) {
msnopenwindow %msn.email.msg
set %msn.linenum $line(@ $+ %msn.email.msg,0,0)
if ( $window(@ $+ %msn.email.msg )) && (is typing... !isin $line(@ $+ %msn.email.msg,$line(@ $+ %msn.email.msg,0,0),0)) { aline -p @ $+ %msn.email.msg 15 $+ %msn.msgnick is typing... }
.timertype $+ %msn.email.msg off
.timertype $+ %msn.email.msg 1 6 dline @ $+ %msn.email.msg $line(@ $+ %msn.email.msg,0,0)
halt
}
}
if ( Content-Type: text/plain isin %msn.chat.data ) {
while (%msn.chat.data) { sockread -n %msn.chat.data }
sockread -f %msn.chat.data
msnopenwindow %msn.email.msg
starttype %msn.email.msg
if ( $window(@ $+ %msn.email.msg )) { titlebar @ $+ %msn.email.msg }
;DELETE "USER IS TYPING" LINE
if (is typing... isin $line(@ $+ %msn.email.msg,$line(@ $+ %msn.email.msg,0,0),0)) { dline @ $+ %msn.email.msg $line(@ $+ %msn.email.msg,0,0) }
.timertype $+ %msn.email.msg off
;AWAY SYSTEM
if ((%msn.awaymessage == $yes) && ($window(@Messenger).title == -=[ Away ]=-)) {
.timer 1 5 msn.say %msn.email.msg I am currently away - %msn.awaymessage.message ( $+ $fulldate $+ )
.timer 1 5 aline @Messenger 7*** Away message sent to $strip(%msn.msgnick) ( $+ $strip(%msn.email.msg) $+ )
}
if (%msn.chat.style == msn) {
aline -hp @ $+ %msn.email.msg $timestamp %msn.msgnick says:
aline -hp @ $+ %msn.email.msg $str( ,3) $+ $replace(%msn.chat.data ,Ã¥,å,ä,ä,ö,ö,Ä,Ä,Ã…,Å,Ö,Ö,Ö,Ö,õ,õ,ü,ü,á,á,é,é,$+($chr(37),20),$chr(32),è,è,à ,à,ç,ç,ê,ê,ù,ù,ë,ë,ï,ï,É,É,À,À,È,È,ô,ô,â,â,ð,°,ñ,ñ,Ñ,Ñ,á,á,é,é,Ã,í,ó,ó,ú,ú,Ã,Á,É,É,Ã,Í,Ó,Ó,Ú,Ú,ü,ü,Ü,Ü,ø,ø,æ,æ,¡,¡,¿,¿,Æ,Æ,Ø,Ø ))
}
else {
aline -hp @ $+ %msn.email.msg $timestamp 14 $+ < $+ %msn.msgnick $+ > $replace(%msn.chat.data ,Ã¥,å,ä,ä,ö,ö,Ä,Ä,Ã…,Å,Ö,Ö,Ö,Ö,õ,õ,ü,ü,á,á,é,é,$+($chr(37),20),$chr(32),è,è,à ,à,ç,ç,ê,ê,ù,ù,ë,ë,ï,ï,É,É,À,À,È,È,ô,ô,â,â,ð,°,ñ,ñ,Ñ,Ñ,á,á,é,é,Ã,í,ó,ó,ú,ú,Ã,Á,É,É,Ã,Í,Ó,Ó,Ú,Ú,ü,ü,Ü,Ü,ø,ø,æ,æ,¡,¡,¿,¿,Æ,Æ,Ø,Ø ))
}
if (%msn.flash == yes) { flash @ $+ %msn.email.msg }
if ( %msn.sounds == on ) { splay $shortfn($scriptdir) $+ type.wav }
addlog %msn.email.msg $urlencode(%msn.msgnick.log) %msn.chat.data
;cope with multi line messages
while ($sockbr != 0) {
sockread -f %msn.chat.data
if ($sockbr == 0) { goto endofsay }
if (%msn.chat.style == msn) {
aline -hp @ $+ %msn.email.msg $str( ,3) $+ $replace(%msn.chat.data ,Ã¥,å,ä,ä,ö,ö,Ä,Ä,Ã…,Å,Ö,Ö,Ö,Ö,õ,õ,ü,ü,á,á,é,é,$+($chr(37),20),$chr(32),è,è,à ,à,ç,ç,ê,ê,ù,ù,ë,ë,ï,ï,É,É,À,À,È,È,ô,ô,â,â,ð,°,ñ,ñ,Ñ,Ñ,á,á,é,é,Ã,í,ó,ó,ú,ú,Ã,Á,É,É,Ã,Í,Ó,Ó,Ú,Ú,ü,ü,Ü,Ü,ø,ø,æ,æ,¡,¡,¿,¿,Æ,Æ,Ø,Ø ))
}
else {
aline -hp @ $+ %msn.email.msg $timestamp 14 $+ < $+ %msn.msgnick $+ > $replace(%msn.chat.data ,Ã¥,å,ä,ä,ö,ö,Ä,Ä,Ã…,Å,Ö,Ö,Ö,Ö,õ,õ,ü,ü,á,á,é,é,$+($chr(37),20),$chr(32),è,è,à ,à,ç,ç,ê,ê,ù,ù,ë,ë,ï,ï,É,É,À,À,È,È,ô,ô,â,â,ð,°,ñ,ñ,Ñ,Ñ,á,á,é,é,Ã,í,ó,ó,ú,ú,Ã,Á,É,É,Ã,Í,Ó,Ó,Ú,Ú,ü,ü,Ü,Ü,ø,ø,æ,æ,¡,¡,¿,¿,Æ,Æ,Ø,Ø ))
}
}
:endofsay
halt
}
;SOMEONE IS SENDING A FILE TO US
if (Content-Type: text/x-msmsgsinvite; isin %msn.chat.data) {
sockread -n %msn.chat.data
sockread -n %msn.chat.data
if (%msn.debug) && (%msn.chat.data) { echo -a %msn.chat.data }
while (%msn.chat.data) {
if (%msn.debug) { if (%msn.chat.data) { echo -a %msn.chat.data } }
if ($gettok(%msn.chat.data,1,32) == Invitation-Cookie:) { set %msn.file.cookie $gettok(%msn.chat.data,2,32) }
if ($gettok(%msn.chat.data,1,32) == Application-File:) { set %msn.file.filename $replace($gettok(%msn.chat.data,2-,32),$chr(32),$null) }
if ($gettok(%msn.chat.data,1,32) == Application-FileSize:) {
set %msn.file.filesize $gettok(%msn.chat.data,2,32)
.timer 1 1 msnfilercvd %msn.email.msg
halt
}
if (Connectivity: N isin %msn.chat.data) { echo -a 4User does not have correct connectivity | msnfiledecline %msn.email.msg }
if ($gettok(%msn.chat.data,1,32) == IP-Address:) { set %msn.file.ipaddress $gettok(%msn.chat.data,2,32) }
if ($gettok(%msn.chat.data,1,32) == Port:) { set %msn.file.port $gettok(%msn.chat.data,2,32) }
if ($gettok(%msn.chat.data,1,32) == AuthCookie:) { set %msn.file.authcookie $gettok(%msn.chat.data,2,32) }
if ($gettok(%msn.chat.data,1,32) == Cancel-Code:) { echo -a File Transfer Cancelled ( $+ $gettok(%msn.chat.data,2,32) $+ ) | halt }
if (Invitation-Command: ACCEPT isin %msn.chat.data) {
while (%msn.chat.data) { sockread -n %msn.chat.data }
msnacceptfile
halt
}
sockread -n %msn.chat.data
}
halt
}
sockread -f %msn.chat.data
inc %tmp 1
if (%tmp < 20) { goto beg }
}
if ( $left(%msn.chat.data,3) == IRO ) {
set %msn.temp.name $rawurldecode($gettok(%msn.chat.data,6-,32))
msnopenwindow $right($sockname,$calc($len($sockname)-5))
;aline @ $+ $right($sockname,$calc($len($sockname)-5)) 10*** $rawurldecode($gettok(%msn.chat.data,6,32)) has joined the conversation
set %msn.iro done
}
if ( $left(%msn.chat.data,3) == ANS ) {
msnopenwindow $gettok($sockname,2-,46)
; aline @ $+ $gettok($sockname,2-,46) 10*** %msn.temp.name has joined the conversation
}
if ( $left(%msn.chat.data,3) == BYE ) {
set %msn.temp $gettok($line(@Messenger,$fline(@Messenger,*< $+ $gettok(%msn.chat.data,2,32) $+ >,1,1),1),1,60)
set %msn.temp $mid($gettok($line(@Messenger,$fline(@Messenger,*< $+ $gettok(%msn.chat.data,2,32) $+ >,1,1),1),1,60),3)
set %msn.temp $left(%msn.temp,$calc($len(%msn.temp)-4))
window -k0ezd @ $+ $gettok($sockname,2-,46) Arial 12 $shortfn($scriptdir) $+ msn.ico
;aline @ $+ $gettok($sockname,2-,46) 10*** %msn.temp has left the conversation (closed the window)
set %msn.clickemail $gettok(%msn.chat.data,2,32)
sockclose chat. $+ %msn.clickemail
sendmsn XFR %msn.main SB
}
goto nextread
}
alias msnfileask {
if ($?!="Accept file? %msn.file.filename %msn.file.filesize" == $true) { return }
}
menu @Messenger {
dclick: {
set %msn.offlinelocation $fline(@Messenger,*Offline Contacts*,1,1)
;IF THE EMAIL IS BELOW THE "OFFLINE CONTACTS" HEADER
if ( $1 > %msn.offlinelocation ) { return }
set %msn.clickemail $strip($gettok($line(@Messenger,$1,1),$numtok($line(@Messenger,$1,1),32),32))
set %msn.clickemail $mid(%msn.clickemail,2,$calc($len(%msn.clickemail)-2))
if (@ !isin %msn.clickemail) { return }
msnchatwindow %msn.clickemail max
}
}
menu @Messenger {
Change Status
.Online:.sendmsn CHG %msn.main NLN | titlebar @Messenger -=[ Online ]=-
.Away:.sendmsn CHG %msn.main AWY | titlebar @Messenger -=[ Away ]=-
.Busy:.sendmsn CHG %msn.main BSY | titlebar @Messenger -=[ Busy ]=-
.Be Right Back:.sendmsn CHG %msn.main BRB | titlebar @Messenger -=[ Be Right Back ]=-
.Phone:.sendmsn CHG %msn.main PHN | titlebar @Messenger -=[ Phone ]=-
.Lunch:.sendmsn CHG %msn.main LUN | titlebar @Messenger -=[ Lunch ]=-
.Appear Offline:.sendmsn CHG %msn.main HDN | titlebar @Messenger -=[ Appear Offline ]=-
Control Panel:dialog -m msncontrol msncontrol
Change Display Name:{
set %msn.newname $?"New MSN Name?"
set %msn.newname $urlencode(%msn.newname)
if ( %msn.newname == $null ) { halt }
set %msn.newname $replace(%msn.newname,$chr(32),$chr(37) $+ 20)
sendmsn REA %msn.main %msn.user %msn.newname
set %msn.name $rawurldecode( %msn.newname )
echo @Messenger 10 $+ *** MSN Name changed to $rawurldecode( %msn.name )
}
-
Block User: {
if ( $left($strip($sline(@Messenger,1)),9) == |BLOCKED|) {
echo -a User is already blocked
halt
}
set %msn.clickemail $strip($gettok($sline(@Messenger,1),$numtok($sline(@Messenger,1),32),32))
set %msn.clickemail $mid(%msn.clickemail,2,$calc($len(%msn.clickemail)-2))
if ( %msn.clickemail == $null ) { halt }
set %msn.linenumber $sline(@Messenger,1).ln
set %msn.nametext $strip($sline(@Messenger,1))
dline -l @Messenger %msn.linenumber
iline -l @Messenger %msn.linenumber 14|BLOCKED| %msn.nametext
write blocked.txt %msn.clickemail
blockuser %msn.clickemail
}
Unblock User:{
if ( $left($strip($sline(@Messenger,1)),9) != |BLOCKED|) {
echo -a User is not blocked
halt
}
set %msn.clickemail $strip($gettok($sline(@Messenger,1),$numtok($sline(@Messenger,1),32),32))
set %msn.clickemail $mid(%msn.clickemail,2,$calc($len(%msn.clickemail)-2))
if ( %msn.clickemail == $null ) { halt }
set %msn.linenumber $sline(@Messenger,1).ln
set %msn.nametext $gettok($sline(@Messenger,1),2-,32)
dline -l @Messenger %msn.linenumber
iline -l @Messenger %msn.linenumber %msn.nametext
write -ds $+ %msn.clickemail blocked.txt
unblockuser %msn.clickemail
}
View Profile:{
set %msn.clickemail $gettok($sline(@Messenger,1),2-,60)
set %msn.clickemail $left(%msn.clickemail,$calc($len(%msn.clickemail)-1))
if ( %msn.clickemail == $null ) { halt }
run http://members.msn.com/ $+ %msn.clickemail
}
$iif( $fline(@Messenger,$1,1,1) < $fline(@Messenger,*Offline Contacts*,1,1),Delete Contact,) : {
set %msn.clickemail $gettok($sline(@Messenger,1),2-,60)
set %msn.clickemail $left(%msn.clickemail,$calc($len(%msn.clickemail)-1))
if ( %msn.clickemail == $null ) { halt }
delmsnuser %msn.clickemail
}
-
Refresh Contact List: {
msnarrangelist
}
}
menu @BlockList {
Unblock User:{
set %msn.clickemail $gettok($sline(@BLockList,1),2-,60)
set %msn.clickemail $left(%msn.clickemail,$calc($len(%msn.clickemail)-1))
if ( %msn.clickemail == $null ) { halt }
unblockuser %msn.clickemail
if ( $sock(msn) == msn ) {
window -c @BlockList
sendmsn LST %msn.main BL }
}
}
on *:INPUT:@:{
if (@*@*@ICQ iswm $active) { return }
if ( $left($1,1) == / ) { return }
if ( /msnaccept isin $gettok($1-,32,1) ) || ( /msndecline isin $1- ) { return }
if ( @ isin $right($active,$calc($len($active)-1))) {
set %msn.texttosend $replacecs($1- ,å,Ã¥,ä,ä,ö,ö,Å,Ã…,Ä,Ä,Ö,Ö,õ,õ,ü,ü,á,á,é,é,$chr(32),$+($chr(37),20),è,è,à,$+(Ã,$chr(160)),ç,ç,ê,ê,ù,ù,ë,ë,ï,ï,É,É,À,À,È,È,ô,ô,â,â,°,ð,ñ,ñ,Ñ,Ñ,á,á,é,é,í,Ã,ó,ó,ú,úÁ,,Ã,É,É,Í,Ã,Ó,Ó,Ú,Ú,ü,ü,Ü,Ü,ø,ø,æ,æ,¡,¡,¿,¿,Æ,Æ,Ø,Ø ))
set %msn.texttosend $rawurldecode(%msn.texttosend)
if (%msn.chat.style == msn) {
if ( $sock(chat. $+ $right($active,$calc($len($active)-1))).status != active ) {
aline -p @ $+ $right($active,$calc($len($active)-1)) 14*** User is not present in this conversation
return
}
aline -p @ $+ $right($active,$calc($len($active)-1)) $timestamp 14 $+ %msn.name says:
aline -p @ $+ $right($active,$calc($len($active)-1)) $str( ,3) $+ $1-
}
else {
aline -p @ $+ $right($active,$calc($len($active)-1)) $timestamp 14 $+ < $+ %msn.name $+ > $1-
}
msnsendmessage $1-
}
}
alias msnsendmessage {
if (!$sock(chat. $+ $right($active,$calc($len($active)-1)))) { msnchatwindow $right($active,$calc($len($active)-1)) | echo -a Your message was not delivered | return }
sockwrite -n chat. $+ $right($active,$calc($len($active)-1)) MSG %msn. [ $+ [ $right($active,$calc($len($active)-1)) ] ] N $calc($len(%msn.texttosend) + 132)
sockwrite -n chat. $+ $right($active,$calc($len($active)-1)) MIME-Version: 1.0
sockwrite -n chat. $+ $right($active,$calc($len($active)-1)) Content-Type: text/plain; charset=UTF-8
sockwrite -n chat. $+ $right($active,$calc($len($active)-1)) X-MMS-IM-Format: FN=Microsoft%20Sans%20Serif; EF=; CO=0; CS=1; PF=22
sockwrite -n chat. $+ $right($active,$calc($len($active)-1))
sockwrite chat. $+ $right($active,$calc($len($active)-1)) %msn.texttosend
addlog $right($active,$calc($len($active)-1)) $urlencode(%msn.name) $1-
}
alias starttype {
.timer $+ $$1 -m 0 1 checktype $1
}
alias checktype {
if ( $editbox(@ $+ $1) != $null ) {
if ( $sock(chat. $+ $1 ) == $null ) {
return
}
saytype $1
.timer $+ $1 off
.timer 1 6 starttype $1
}
}
alias saytype {
if (%msn.showtype == NO) { return }
var %chat = $+(chat.,$1)
if ($sock(%chat).status == active) {
sockwrite -n %chat MSG %msn. [ $+ [ $1 ] ] U $calc(73 + $len(%msn.user))
sockwrite -n %chat MIME-Version: 1.0
sockwrite -n %chat Content-Type: text/x-msmsgscontrol
sockwrite -n %chat TypingUser: %msn.user
sockwrite -n %chat $crlf
sockwrite -n %chat $crlf
inc $+(%,msn.,$1)
}
else echo $color(info) -a * /msn: error sending message. If this message reappears then close and reopen window
}
alias addmsnuser {
if ( $sock(msn) != msn ) { halt }
sendmsn ADD %msn.main FL $$1 $$1 0
sendmsn ADD %msn.main AL $$1 $$1
aline -p @messenger 10*** $$1 was added to your contact list
}
alias delmsnuser {
if ( $sock(msn) != msn ) { halt }
sendmsn REM %msn.main FL $$1
set %msn.temp $gettok($line(@Messenger,$fline(@Messenger,*< $+ $$1 $+ >,1,1),1),1,60)
set %msn.temp $mid($gettok($line(@Messenger,$fline(@Messenger,*< $+ $$1 $+ >,1,1),1),1,60),3)
set %msn.temp $left(%msn.temp,$calc($len(%msn.temp)-4))
if ( $fline(@Messenger,*< $+ $$1 $+ >,1,1) == $null ) {
aline -p @messenger 4 $+ *** $$1 not a valid address.
halt
}
dline -l @Messenger $fline(@Messenger,*< $+ $$1 $+ >,1,1)
aline -p @messenger 10*** $strip(%msn.temp) was removed from your contact list
}
alias blockuser {
if ( $fline(@Messenger,*< $+ $$1 $+ >,1,1) == $null ) {
aline -p @messenger 4 $+ *** $$1 not a valid address.
halt
}
if ( $sock(msn) != msn ) { halt }
sendmsn REM %msn.main AL $$1
sendmsn ADD %msn.main BL $$1 $$1
set %msn.temp $line(@Messenger,$fline(@Messenger,*< $+ $$1 $+ >,1,1),1),1,60)
set %msn.temp $strip(%msn.temp)
set %msn.temp $mid(%msn.temp,11)
aline -p @messenger 10*** %msn.temp has been blocked.
}
alias unblockuser {
if ( $sock(msn) != msn ) { halt }
sendmsn REM %msn.main BL $$1
sendmsn ADD %msn.main AL $$1 $$1
aline -p @messenger 10*** $$1 has been unblocked
}
alias rawurldecode {
var %decode = $1-
while ($regex($eval(%decode,1), /\%([a-fA-F0-9]{2})/)) {
var %t = $regsub($eval(%decode,1), /\%([a-fA-F0-9]{2})/, $chr($base($regml(1),16,10)), %decode)
}
return %decode
}
alias rawurldecode {
var %i = 0, %r, %c | while (%i < $gettok($1-,0,37)) {
inc %i
%c = $chr($base($gettok($1-,%i,37),16,10,2))
%r = %r $+ $iif($asc(%c) == 32,\32\,%c)
}
return $replace(%r,\32\,$chr(32))
}
alias urlencode {
var %i = 0, %r | while (%i < $len($1-)) {
inc %i
%r = %r $+ $chr(37) $+ $base($asc($mid($1-,%i,1)),10,16,2)
}
return %r
}
menu MenuBar {
MSN Messenger
.$iif($sock(msn) == $null,Login,$null) { msn }
.$iif($sock(msn) != $null,Logout,$null) {
sockclose msn sockclose chat.*
window -c @Messenger
}
.Control Panel:dialog -m msncontrol msncontrol
.Website:run http://www.burningimage.net/msn
.About:aboutmsn
}
alias aboutmsn {
set %msn.temp $input(MSN Messenger for mIRC v $+ $msnversion $crlf $crlf $+ www.burningimage.net/msn $crlf $crlf $+ Andy Carvell 2003-2007,4,About)
}
alias msnversion return 3.93
alias msn.name {
if ( $sock(msn) == $null ) {
echo -a You are not connected to MSN
halt }
set %msn.newname $iif($1,$1,$?"New MSN Name?")
set %msn.newname $urlencode(%msn.newname)
if ( %msn.newname == $null ) { halt }
set %msn.newname $replace(%msn.newname,$chr(32),$chr(37) $+ 20)
sendmsn REA %msn.main %msn.user %msn.newname
set %msn.name $rawurldecode( %msn.newname )
echo @Messenger 10 $+ *** MSN Name changed to $rawurldecode( %msn.name )
}
alias msn.status {
if ( $sock(msn) == $null ) {
echo -a You are not connected to MSN
halt }
if ( $1 == online ) { sendmsn CHG %msn.main NLN | titlebar @Messenger -=[ Online ]=- }
if ( $1 == away ) { sendmsn CHG %msn.main AWY | titlebar @Messenger -=[ Away ]=- }
if ( $1 == busy ) { sendmsn CHG %msn.main BSY | titlebar @Messenger -=[ Busy ]=- }
if ( $1 == brb ) { sendmsn CHG %msn.main BRB | titlebar @Messenger -=[ Be Right Back ]=- }
if ( $1 == phone ) { sendmsn CHG %msn.main PHN | titlebar @Messenger -=[ Phone ]=- }
if ( $1 == lunch ) { sendmsn CHG %msn.main LUN | titlebar @Messenger -=[ Lunch ]=- }
if ( $1 == aoffline ) { sendmsn CHG %msn.main HDN | titlebar @Messenger -=[ Appear Offline ]=- }
if ( $1 == help || $1 = $null ) {
echo -a /msn.status <status>
echo -a <status> can be
echo -a online, away, busy, brb, phone, lunch, aoffline
echo -a eg. /msn.status away
}
}
alias msn.say {
if ( $1 == help || $1 = $null ) {
echo -a /msn.say <email address> <message>
echo -a eg. /msn.say andy@thesas.co.uk I love MSN for mIRC!
}
if ( %msn.say.no == 1 && $sock(chat. $+ $$1) == $null ) {
aline -p @messenger *** Message Sending Failed Please wait a few moments and try sending your message again
halt
}
set %msn.say.no 1
.timer 1 5 unset %msn.say.no
set %msn.clickemail $$1
set %msn.say.text $$2-
if ($sock(chat. $+ $$1) == $null) {
sendmsn XFR %msn.main SB
.timer 1 8 domsnsay
}
else {
domsnsay
}
}
alias checkmsnidle {
if ($idle < %msn.idletime) && ($idle < %msn.maxidle) && ( idle isin $window(@messenger).title ) {
sendmsn CHG %msn.main NLN
if ( $sock(msn) == msn ) {
titlebar @Messenger -=[ Online ]=-
}
return
}
if ($idle >= %msn.maxidle) {
if ( %msn.autoidle == no ) || ( Offline isin $window(@messenger).title ) || ( idle isin $window(@messenger).title ) { return }
sendmsn CHG %msn.main IDL
set %msn.idletime $idle
if ( $sock(msn) == msn ) {
titlebar @Messenger -=[ Idle ]=-
}
}
}
alias domsnsay {
sockwrite -n chat. $+ %msn.clickemail MSG %msn. [ $+ [ %msn.clickemail ] ] N $calc($len(%msn.say.text) + 132)
sockwrite -n chat. $+ %msn.clickemail MIME-Version: 1.0
sockwrite -n chat. $+ %msn.clickemail Content-Type: text/plain; charset=UTF-8
sockwrite -n chat. $+ %msn.clickemail X-MMS-IM-Format: FN=Microsoft%20Sans%20Serif; EF=; CO=0; CS=1; PF=22
sockwrite -n chat. $+ %msn.clickemail
sockwrite chat. $+ %msn.clickemail %msn.say.text
halt
:error
aline -p @messenger *** Message Sending Failed Please wait a few moments and try sending your message again
reseterror
}
alias msn.winlist {
if ($fline(@ $+ $1,*Invite MSN User*,1,1) == $null) { aline -l @ $+ $1 14Invite MSN User }
if ($fline(@ $+ $1,*Send File or Photo*,1,1) == $null) { aline -l @ $+ $1 14Send File or Photo }
if ($fline(@ $+ $1,*Send E-mail*,1,1) == $null) { aline -l @ $+ $1 14Send E-mail }
if ($fline(@ $+ $1,*Block User*,1,1) == $null) { aline -l @ $+ $1 14Block User }
if ($fline(@ $+ $1,*Unblock User*,1,1) == $null) { aline -l @ $+ $1 14Unblock User }
if ($fline(@ $+ $1,*View Profile*,1,1) == $null) { aline -l @ $+ $1 14View Profile }
if ($fline(@ $+ $1,*View Logs*,1,1) == $null) { aline -l @ $+ $1 14View Logs }
}
menu @*@* {
dclick: {
if (@*@*@ICQ iswm $active) { return }
set %msn.clickemail $right($active,$calc($len($active) - 1))
var %a = $line(@ $+ %msn.clickemail,$1,1)
if (*Unblock User* iswm %a) {
if ( |BLOCKED| !isin $gettok($line(@Messenger,$fline(@Messenger,*< $+ %msn.clickemail $+ >,1,1),1),1,32) ) {
echo -a User is not currently blocked
halt
}
if ( @ !isin %msn.clickemail ) { halt }
set %msn.linenumber $fline(@Messenger,*< $+ %msn.clickemail $+ >,1,1)
set %msn.nametext $gettok($strip($line(@Messenger,$fline(@Messenger,*< $+ %msn.clickemail $+ >,1,1),1)),2-,32)
dline -l @Messenger %msn.linenumber
iline -l @Messenger %msn.linenumber %msn.nametext
write -ds $+ %msn.clickemail blocked.txt
echo -a User has been unblocked
unblockuser %msn.clickemail
return
}
elseif (*Block User* iswm %a) {
if ( |BLOCKED| isin $gettok($line(@Messenger,$fline(@Messenger,*< $+ %msn.clickemail $+ >,1,1),1),1,32) ) {
echo -a User is already blocked
halt
}
if ( @ !isin %msn.clickemail ) { halt }
set %msn.linenumber $fline(@Messenger,*< $+ %msn.clickemail $+ >,1,1)
set %msn.nametext 14|BLOCKED| $strip($line(@Messenger,$fline(@Messenger,*< $+ %msn.clickemail $+ >,1,1),1))
dline -l @Messenger %msn.linenumber
iline -l @Messenger %msn.linenumber %msn.nametext
write blocked.txt %msn.clickemail
echo -a User has been blocked
blockuser %msn.clickemail
return
}
elseif (*Send File or Photo* iswm %a) { msnsendfile }
elseif (*Send E-mail* iswm %a) { run http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1222806157&rver=4.5.2130.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fmail%2Fmail.aspx%3F_om%3Dml%26rru%3Dcompose%253ftype%253ddmc%2526action%253dcompose%2526to= $+ %msn.clickemail }
elseif (*View Profile* iswm %a) { if ( %msn.clickemail == $null ) { halt } | run explorer.exe http://members.msn.com/ $+ %msn.clickemail }
elseif (*Invite MSN User* iswm %a) {
if ( %msn.clickemail == $null ) { halt }
set %msn.temp $input(Enter the person you wish to invite's e-mail address,eoq,Invite User)
if ( %msn.temp == $null ) { halt }
set %msn.invited 1
sockwrite -n chat. $+ %msn.clickemail CAL [ %msn. [ $+ [ %msn.clickemail ] ] ] %msn.temp
;echo -a 13 chat. $+ %msn.clickemail CAL [ %msn. [ $+ [ %msn.clickemail ] ] ] %msn.temp
}
elseif (*Delete Contact* iswm %a) { if ( %msn.clickemail == $null ) { halt } | delmsnuser %msn.clickemail }
elseif (*View Logs* iswm %a) { if ( %msn.clickemail == $null ) { halt }
set %msn.dirlog $shortfn($scriptdir) $+ \logs
set %logs.reload %msn.dirlog $+ \ $+ %msn.clickemail $+ .log
if $findfile(%msn.dirlog,%msn.clickemail $+ .log,0,) == 0 { echo -a There is no record of conversation | halt }
window -akSz @MSN_History_ $+ %msn.clickemail -1 -1 600 300 @MSN_History_ $+ %msn.clickemail
clear @MSN_History_ $+ %msn.clickemail
loadbuf -p @MSN_History_ $+ %msn.clickemail %logs.reload
}
else { aline @ $+ %msn.clickemail 4Error: %a Is not a command built into the code. }
}
}
alias msnopenwindow {
if ($window(@ $+ $1)) || ($2 == max) {
if ( %msn.chatwindow.style == $no ) {
window -ek0zdl20 @ $+ $1 Verdana 12 $shortfn($scriptdir) $+ msn.ico | $msn.winlist( $1 )
}
else { window -ek0zl20z @ $+ $1 Verdana 12 $shortfn($scriptdir) $+ msn.ico | $msn.winlist( $1 ) }
}
else {
if ( %msn.chatwindow.style == $no ) {
window -ek0zdl20n @ $+ $1 Verdana 12 $shortfn($scriptdir) $+ msn.ico | $msn.winlist( $1 )
}
else { window -ek0zl20nz @ $+ $1 Verdana 12 $shortfn($scriptdir) $+ msn.ico | $msn.winlist( $1 ) }
}
}
alias away {
if ( $1 == $null ) {
away
if ( %msn.awaysync == $yes ) { msn.status online }
halt
}
away $1-
if ( %msn.awaysync == $yes ) { msn.status away }
}
alias delgroupinfo {
unset %msn.group.*
set %msn.temp $dll($shortfn($scriptdir) $+ listfiles.dll, setoutput, <fname>)
set %msn.temp $dll($shortfn($scriptdir) $+ listfiles.dll,listfiles, fhs* > $shortfn($scriptdir) $+ groups.grp > $shortfn($scriptdir) $+ groups)
set %msn.counter 0
while ($lines($shortfn($scriptdir) $+ groups.grp) > %msn.counter) {
inc %msn.counter
set %msn.group.file $read( $shortfn($scriptdir) $+ groups.grp , %msn.counter )
.remove $shortfn($scriptdir) $+ groups\ $+ %msn.group.file
}
.rmdir $shortfn($scriptdir) $+ groups
return
:error
set %msn.warning on
reseterror
}
alias msndeleteoffline {
if ($window(@Messenger)) { dline -l @Messenger $calc($fline(@Messenger,*Offline Contacts*,1,1) - 1) $+ - $+ $line(@Messenger,0,1) }
}
alias msnarrangelist {
if ( %msn.sortbygroup != $yes ) { msndeleteoffline | msnaddoffline | return }
;ERASE OFFLINE CONTACTS
msndeleteoffline
;erase blank lines and [no contact online]
set %msn.linecount 0
while ($line(@Messenger,0,1) > %msn.linecount) {
inc %msn.linecount
if ($line(@Messenger,%msn.linecount,1) == 15[no online contacts]) { dline -l @Messenger %msn.linecount }
if ($line(@Messenger,%msn.linecount,1) == ) { dline -l @Messenger %msn.linecount }
}
set %msn.temp $dll($shortfn($scriptdir) $+ listfiles.dll, setoutput, <fname>)
set %msn.temp $dll($shortfn($scriptdir) $+ listfiles.dll,listfiles, fhs* > $shortfn($scriptdir) $+ groups.grp > $shortfn($scriptdir) $+ groups)
set %msn.counter 0
while ($lines($shortfn($scriptdir) $+ groups.grp) > %msn.counter) {
inc %msn.counter
set %msn.group.file $read($shortfn($scriptdir) $+ groups.grp , %msn.counter)
set %msn.linecount 0
while ($line(@Messenger,0,1) > %msn.linecount) {
inc %msn.linecount
set %msn.clickemail $strip($gettok($line(@Messenger,%msn.linecount,1),$numtok($line(@Messenger,%msn.linecount,1),32),32))
set %msn.clickemail $mid(%msn.clickemail,2,$calc($len(%msn.clickemail)-2))
if ( @ !isin %msn.clickemail ) { unset %msn.clickemail | continue }
if ($read($shortfn($scriptdir) $+ groups\ $+ %msn.group.file,w,* [ $+ [ %msn.clickemail ] $+ ] *)) {
set %msn.replaceline $line(@Messenger,%msn.linecount,1)
dline -l @Messenger %msn.linecount
set %msn.groupname $replace($gettok(%msn.group.file,1 - $calc($numtok(%msn.group.file,46)-1),46),_,$chr(32))
set %msn.line $fline(@Messenger,%msn.groupname,1,1)
;echo -a %msn.groupname
iline -l @Messenger $calc(%msn.line + 1) %msn.replaceline
}
}
}
;ADD BLANK LINES
set %msn.linecount 0
while ($line(@Messenger,0,1) > %msn.linecount) {
inc %msn.linecount
if (@ isin $line(@Messenger,%msn.linecount,1)) && (@ !isin $line(@Messenger,$calc(%msn.linecount + 1),1)) && ( !isin $line(@Messenger,%msn.linecount,1)) && ( !isin $line(@Messenger,$calc(%msn.linecount + 1),1)) && (%msn.linecount != 1) { iline -l @Messenger $calc(%msn.linecount + 1) | inc %msn.linecount }
if (@ !isin $line(@Messenger,%msn.linecount,1)) && (@ !isin $line(@Messenger,$calc(%msn.linecount + 1),1)) && ( !isin $line(@Messenger,%msn.linecount,1)) && ( !isin $line(@Messenger,$calc(%msn.linecount + 1),1)) && (15[no online contacts] !isin $line(@Messenger,$calc(%msn.linecount + 1),1)) && (15[no online contacts] !isin $line(@Messenger,%msn.linecount,1)) { iline -l @Messenger $calc(%msn.linecount + 1) 15[no online contacts] | iline -l @Messenger $calc(%msn.linecount + 2) | inc %msn.linecount 2 }
}
msnaddoffline
}
alias msnaddoffline {
if ( %msn.showoffline == $no ) { return }
if ( %msn.sortbygroup == $yes ) { dline -l @Messenger $line(@Messenger,0,1) }
iline -l @Messenger $calc($line(@Messenger,0,1) + 1)
iline -l @Messenger $calc($line(@Messenger,0,1) + 1) Offline Contacts
set %msn.linecount 1
while (%msn.linecount <= $lines($shortfn($scriptdir $+ allusers.txt))) {
set %msn.offlineemail $gettok($read($shortfn($scriptdir $+ allusers.txt),%msn.linecount),1,32)
if (!$fline(@Messenger,* $+ %msn.offlineemail $+ *,1,1)) {
iline -l @Messenger $calc($line(@Messenger,0,1) + 1) 14 $+ $rawurldecode($gettok($read($shortfn($scriptdir $+ allusers.txt),%msn.linecount),2,32)) 15< $+ $gettok($read($shortfn($scriptdir $+ allusers.txt),%msn.linecount),1,32) $+ >
}
inc %msn.linecount
}
}
alias msnchatwindow {
set %msn.clickemail $$1
sockclose chat. $+ %msn.clickemail
sendmsn XFR %msn.main SB
}
alias msndoping {
sendmsn PNG
.timerpngreply 1 20 msnpingtimeout
}
alias msnpingtimeout {
aline -p @Messenger 4 $+ *** Ping Timeout
sockclose msn
msndisconnect
}
alias msndisconnect {
window -l50k0Sz @Messenger %msn.messenger.font $shortfn($scriptdir) $+ msn.ico
aline -p @messenger 10*** Disconnected
.timermsnping off
.timermsnidle off
titlebar @Messenger -=[ Offline ]=-
dline -l @Messenger 1- $+ $line(@Messenger,0,1)
if ( %msn.reconnect == $yes && $window(@Messenger) != $null ) { msnstart }
}
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
alias addlog {
if ( %msn.log != 1 ) { halt }
mkdir $shortfn($mircdir) $+ msn/logs
write $shortfn($mircdir) $+ msn/logs/ $+ $1 $+ .log $date $timestamp $rawurldecode($2) $+ : $3-
}
alias viewlogs {
set %msn.dirlog $shortfn($mircdir) $+ msn\logs
mkdir $shortfn($mircdir) $+ msn\logs
msn.logs
}
alias msn.logs {
window -kSl30z @MSN_logs 135 50 850 300 @MSN_logs
aline $color(notice) @MSN_logs -LOG- $+($chr(3),$color(info)) $+ Loading logs in directory $+($chr(3),$color(action)) $+ %msn.dirlog $+ ...
var %logs.alias.time $ticks
var %logs.alias.U 1
while ($findfile(%msn.dirlog,*.log,%logs.alias.U)) {
if (!$1) goto cargar
if ($1 == c) { if ($chr(35) isin $findfile(%msn.dirlog,*.log,%logs.alias.U)) goto cargar | else goto incrementa }
if ($1 == p) { if ($chr(35) !isin $findfile(%msn.dirlog,*.log,%logs.alias.U)) goto cargar | else goto incrementa }
:cargar
aline -l @MSN_logs $nopath($findfile(%msn.dirlog,*.log,%logs.alias.U))
:incrementa
inc %logs.alias.U
}
aline $color(notice) @MSN_logs -LOG- $+ $+($chr(3),$color(action)) $line(@MSN_logs,0,1) $+($chr(3),$color(info)) $+ logs loaded in $round($calc(($ticks - %logs.alias.time) / 1000),2) seconds $+($chr(3),$color(info2)) $+ $chr(40) $+ $+($chr(3),$color(info)) $findfile(%msn.dirlog,*.log,0) logs in total $+ $+($chr(3),$color(info2)) $chr(41)
unset %logs.alias.*
}
alias -l logdel {
if (!$1) halt
else {
var %log.borrar.x 1
var %log.borrar.cont 0
aline $color(notice) @MSN_logs -LOG- $+ $+($chr(3),$color(info)) Deleting logs...
var %log.borrar.time $ticks
:borrador
if ($file($findfile(%msn.dirlog,*.log,%log.borrar.x)).size < $$1) {
if ($fline(@MSN_logs,$nopath($findfile(%msn.dirlog,*.log,%log.borrar.x)),1,1)) dline -l @MSN_logs $fline(@MSN_logs,$nopath($findfile(%msn.dirlog,*.log,%log.borrar.x)),1,1)
aline $color(notice) @MSN_logs -LOG- $+ $+($chr(3),$color(info)) Log $+ $+($chr(3),$color(action)) $nopath($findfile(%msn.dirlog,*.log,%log.borrar.x)) $+($chr(3),$color(info)) $+ erasing %msn.dirlog
/.remove -b $findfile(%msn.dirlog,*.log,%log.borrar.x) | inc %log.borrar.cont
if (%log.borrar.x <= $findfile(%msn.dirlog,*.log,0)) goto borrador | else goto fin
}
else { inc %log.borrar.x | if (%log.borrar.x <= $findfile(%msn.dirlog,*.log,0)) goto borrador | else goto fin }
:fin
if (!%log.borrar.cont) aline $color(notice) @MSN_logs -LOG- $+($chr(3),$color(info)) $+ No logs less than $+ $+($chr(3),$color(action)) $round($calc($1 / 1024),1) $+($chr(3),$color(info)) $+ kb.
else aline $color(notice) @MSN_logs -LOG- $+ $+($chr(3),$color(action)) %log.borrar.cont $+($chr(3),$color(info)) $+ logs less than $round($calc($1 / 1024),1) kb deleted in $round($calc(($ticks - %log.borrar.time)/1000),2) seconds.
}
unset %log.borrar.*
}
menu @MSN_History_* {
Find text in log: findtext $$?="Texto a buscar?"
Delete log: clear | .remove -b %msn.dirlog $+ %msn.clickemail $+ .log
}
menu @MSN_logs {
dclick { clear @MSN_logs | set %logs.reload %msn.dirlog $+ \ $+ $sline(@MSN_logs,1) | loadbuf -p @MSN_logs %logs.reload }
Refresh: window -c @MSN_logs | .msn.logs
-
Show selected log: { clear @MSN_logs | if ($sline(@MSN_logs,1)) { set %logs.reload $shortfn(%msn.dirlog $+ \ $+ $sline(@MSN_logs,1)) | loadbuf -p @MSN_logs $shortfn(%logs.reload) } | else aline $color(notice) @MSN_logs -LOG- $+($chr(3),$color(info)) $+ Select the log you wish to view. }
-
Edit log: { if ($sline(@MSN_logs,1)) run notepad %msn.dirlog $+ \ $+ $ifmatch | else aline $color(notice) @MSN_logs -LOG- $+($chr(3),$color(info)) $+ Select the log you wish to edit. }
Delete
.Selected: {
clear @MSN_logs | while ($sline(@MSN_logs,0)) {
.remove -b %msn.dirlog $+ \ $+ $sline(@MSN_logs,1) | aline $color(notice) @MSN_logs -LOG- $+($chr(3),$color(info)) $+ Log $+($chr(3),$color(action)) $+ $sline(@MSN_logs,1) $+($chr(3),$color(info)) $+ deleted from %msn.dirlog | dline -l @MSN_logs $sline(@MSN_logs,1).ln
}
}
.All logs less than 3kB: clear @MSN_logs | logdel 3072
.All logs less than ?: clear @MSN_logs | var %log.input $$?="Delete logs under ? kB?" | logdel $calc(%log.input * 1024)
-
Find text in log: findtext $$?="Texto a buscar?"
-
Close: window -c @MSN_logs
}
on *:CLOSE:@MSN_logs: unset %logs.*
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
dialog msnconnect {
title "Connect"
size -1 -1 150 71
option dbu
icon $shortfn($scriptdir) $+ msn2.ico, 0
text "Sign-In Name", 1, 5 5 40 10
text "Password", 2, 6 25 40 10
combo 3, 50 3 90 10
edit "", 4, 50 23 90 10, pass limit 16
text "eg. someone@hotmail.com", 5, 52 14 100 9
check "Appear Offline on Connect", 6, 5 45 100 10
icon 7, 130 53 150 150, $shortfn($scriptdir) $+ msn.ico, 0
button "Sign-In", 8, 50 57 40 10, ok
check "Remember my username and password", 9, 5 36 107 10
}
dialog msncontrol {
title "Control Panel"
size -1 -1 196 199
option dbu
icon $shortfn($scriptdir) $+ msn.ico, 0
button "Add User", 1, 5 10 40 10, flat
button "Delete User", 2, 5 21 40 10, flat
button "Block Checker", 4, 99 10 40 10, flat
button "Block User", 5, 47 10 40 10, flat
button "Unblock User", 6, 47 21 40 10, flat
button "Change MSN Name", 8, 141 10 50 10, flat
button "View Logs", 9, 133 58 55 10, flat
box "MSN Users", 12, 1 1 91 35
box "General", 13, 95 1 99 23
box "Appearance", 14, 1 38 91 56
box "Conversation Logging", 15, 95 50 99 21
button "invisible", 17, 1 1 0 0, ok
button "Settings", 22, 134 34 55 10, flat
box "Received Files", 25, 1 95 91 22
button "Messenger Window Font", 26, 5 129 84 10, flat
box "Comment", 39, 95 125 99 22
button "Send Comments to Author", 40, 99 133 88 10, flat
button "Close", 41, 166 189 28 9, flat cancel
box "Auto Idle", 42, 95 25 99 23
check "Enable sounds", 45, 5 155 50 10
check "Users see me typing", 3, 5 165 58 10
check "Enable", 7, 100 58 29 10
check "Connect when mIRC starts", 10, 67 155 77 10
check "Reconnect when disconnected", 16, 67 165 82 10
check "IRC style conversations", 18, 5 54 82 10
check "'New Mail' notification", 19, 5 72 82 10
check "'User has logged on' popups", 20, 5 63 82 10
check "Enable", 28, 100 34 29 10
check "Synchronise MSN and mIRC away", 23, 67 175 93 10
check "Minimise on connect", 24, 5 175 60 10
check "Sort by group", 21, 99 80 48 10
check "Show offline contacts", 29, 99 90 67 10
check "IRC style chat windows ", 31, 5 45 68 10
box "Contact List", 11, 95 72 99 30
check "Show background", 30, 5 185 55 10
box "Miscellaneous", 32, 1 147 161 51
text version $msnversion, 33, 166 174 28 13, center
box "Fonts", 27, 1 118 91 28
button "Open Received Files", 34, 5 103 84 10, flat
check "Detailed status logging", 35, 5 81 82 10
check "Flash on message", 36, 67 185 55 10
box "Away Message", 37, 95 103 99 21
check "Enable", 38, 99 111 29 10
button "Settings", 43, 133 111 55 10, flat
}
dialog msnmail {
title "New E-Mail Message"
size -1 -1 90 35
icon $shortfn($scriptdir) $+ msn.ico
option dbu
text %msn.newmail,1, 5 5 120 10
button "Retreive",2, 5 20 35 10, ok
button "Close",3, 45 20 35 10, cancel
}
dialog msnfilerecv {
title "Receiving File....."
size -1 -1 164 44
option dbu
icon $shortfn($scriptdir) $+ msn.ico, 0
text %msn.file.filename, 1, 2 1 145 8
text "100% received", 2, 2 10 46 9
text "Your file was received successfully. You may now close this dialog.", 4, 2 20 160 9
button "Cancel", 5, 2 30 37 12
button "Open Received Files", 6, 42 30 54 12
}
dialog msnfilesend {
title "Sending File....."
size -1 -1 150 30
option dbu
icon $shortfn($scriptdir) $+ msn.ico, 0
text %msn.filename.file, 1, 2 1 145 8
text "100% sent", 2, 2 10 46 9
text "File has been sent successfully.", 3, 2 19 102 8
button "Cancel", 5, 110 15 37 12
}
dialog msnnew_version {
title "New Version"
size -1 -1 184 37
option dbu
text "There is a new version of MSN Messenger for mIRC available to download.", 1, 1 2 183 8
text "Would you like to download this new version?", 2, 1 13 182 8
button "Yes", 4, 49 24 37 12, flat
button "No", 5, 94 24 37 12, flat
}
dialog msncomment {
title "Send Comment"
size -1 -1 242 78
option dbu
edit "", 1, 60 24 86 11
text "Your Name:", 2, 3 26 32 8
text "You can use the form below to send comments and/or suggestions to the author of mIRC. The comments posted will be checked periodically, every comment is read and suggestions are acted upon.", 3, 3 1 238 22
text "Your E-mail address:", 4, 3 39 53 8
edit "", 5, 60 38 86 11
edit "", 6, 60 51 180 11
text "Your Comment:", 7, 3 51 44 9
button "Send to Author", 8, 198 64 42 12, flat ok
text "Note that measures are in place to prevent the abuse of this system.", 9, 3 65 170 9
}
on *:dialog:msnfilerecv:init:*:{
did -h msnfilerecv 4
did -o msnfilerecv 2 1 0% completed
}
on *:dialog:msnfilesend:init:*:{
did -h msnfilerecv 3
did -o msnfilerecv 2 1 0% completed
}
on *:dialog:msnfilerecv:sclick:5:{
if ( $sock(msnfile) != $null ) {
sockwrite -n msnfile 100
sockclose msnfile
}
dialog -x msnfilerecv
}
on *:dialog:msnfilerecv:sclick:6:{
run $shortfn($scriptdir) $+ downloads
}
on *:dialog:msnfilesend:sclick:5:{
if ( $sock(filesend) != $null ) {
sockwrite -n filesend 100
sockclose filesend
}
dialog -x msnfilesend
}
on *:dialog:msnconnect:sclick:8:{
set %msn.user $did(3)
set %msn.pass $did(4)
set %msn.chg $did(6).state
set %msn.rememberpass $did(9).state
dialog -x msnconnect
msnstart
}
on *:dialog:msncontrol:sclick:*:{
if ( $did == 1 ) { addmsnuser $input(Enter the e-mail address of the user you wish to add:,5,Add User) }
if ( $did == 2 ) { delmsnuser $input(Enter the e-mail address of the user you wish to delete:,5,Delete User) }
if ( $did == 4 ) {
set %msn.message A few notes about the block checker. $crlf $crlf $+ The block checker works by trying to establish a conversation with the target e-mail address, if the conversation can be established then the user is really online, if the conversation cannot be established then the user has either set it so that only people on their contact list can contact them, or they are really offline. Most likely they are really offline. $crlf $crlf $+ It is not 100% guaranteed that it will show if the user is online, but if they come back as being online, then you can be 100% certain that they are online. $crlf $crlf $+ The user will not know that you are checking if they use the official client, if they are using MSN for mIRC, then a chat window will appear.
set %msn.temp $input(%msn.message,4,Block Checker)
set %msn.message Enter the e-mail address of the contact to check. $crlf $crlf $+ A chat window will open, if the message in the chat window changes from: $crlf $+ *** Please wait for the user to join... *** $crlf $+ to $crlf $+ *** xxx has joined the conversation $crlf $+ the the user is ONLINE. $crlf $crlf $+ If the message stays as: $crlf $+ *** Please wait for the user to join... *** $crlf $+ then the user is either OFFLINE or has chosen not to receive messages from people not on their contact list.
set %msn.clickemail $input(%msn.message,5,Block Checker)
if (%msn.clickemail == $null) { halt }
sockclose chat. $+ %msn.clickemail
sendmsn XFR %msn.main SB
}
if ( $did == 5 ) { blockuser $input(Enter the e-mail address of the user you wish to block:,5,Block User) }
if ( $did == 6 ) { unblockuser $input(Enter the e-mail address of the user you wish to unblock:,5,Unblock User) }
if ( $did == 3 ) {
if ($did(msncontrol,3).state) { set %msn.showtype YES }
else { set %msn.showtype NO }
}
if ( $did == 8 ) {
set %msn.newname $?"New MSN Name?"
set %msn.newname $urlencode(%msn.newname)
if ( %msn.newname == $null ) { halt }
set %msn.newname $replace(%msn.newname,$chr(32),$chr(37) $+ 20)
sendmsn REA %msn.main %msn.user %msn.newname
set %msn.name $rawurldecode( %msn.newname )
echo @Messenger 10 $+ *** MSN Name changed to $rawurldecode( %msn.name )
}
if ( $did == 9 ) { viewlogs }
if ( $did == 7 ) {
if ($did(msncontrol,7).state) { set %msn.log 1 }
else { set %msn.log 0 }
}
if ( $did == 31 ) {
if ($did(msncontrol,31).state) { set %msn.chatwindow.style $yes }
else { set %msn.chatwindow.style $no }
}
if ( $did == 45 ) {
if ($did(msncontrol,45).state) {
set %msn.sounds on
}
else { set %msn.sounds off }
}
if ( $did == 24 ) {
if ($did(msncontrol,24).state) { set %msn.window.minimise $yes }
else { set %msn.window.minimise $no }
}
if ( $did = 22 ) {
set %msn.maxidle $calc( $input(Set myself as idle after how many minutes?,eoq,Auto Idle,$calc( %msn.maxidle / 60 )) * 60 )
set %msn.autoidle yes
}
if ( $did = 28 ) {
if ($did(msncontrol,28).state) { set %msn.autoidle yes }
else { set %msn.autoidle no }
}
if ( $did = 26 ) {
set %msn.messenger.font $input(Usage: <font> <font size> $crlf $crlf $+ Example: $crlf $+ Verdana 10,eo,Messenger Window Font,%msn.messenger.font)
}
if ( $did = 30 ) {
if ($did(msncontrol,30).state) { set %msn.background $yes }
else { set %msn.background $no }
}
if ( $did = 10 ) {
if ($did(msncontrol,10).state) { set %msn.autoconnect $yes }
else { set %msn.autoconnect $no }
}
if ( $did = 23 ) {
if ($did(msncontrol,23).state) { set %msn.awaysync $yes }
else { set %msn.awaysync $no }
}
if ( $did = 32 ) {
set %msn.awaysync $no
set %msn.temp $input(Away Sync Disabled,4,Away Sync)
}
if ( $did = 16 ) {
if ($did(msncontrol,16).state) { set %msn.reconnect $yes }
else { set %msn.reconnect $no }
}
if ( $did = 19 ) {
if ($did(msncontrol,19).state) { set %msn.mailnotification yes }
else { set %msn.mailnotification no }
}
if ( $did = 18 ) {
if ($did(msncontrol,18).state) { set %msn.chat.style irc }
else { set %msn.chat.style msn }
}
if ($did = 40) {
dialog -m msncomment msncomment
}
if ($did = 20) {
if ($did(msncontrol,20).state) { set %msn.showlogon $yes }
else { set %msn.showlogon $no }
}
if ($did = 21) {
if ($did(msncontrol,21).state) { set %msn.sortbygroup $yes }
else { set %msn.sortbygroup $no }
}
if ($did = 29) {
if ($did(msncontrol,29).state) { set %msn.showoffline $yes }
else { set %msn.showoffline $no }
}
if ($did == 34) {
run $shortfn($scriptdir) $+ downloads/
}
if ($did = 35) {
if ($did(msncontrol,35).state) { set %msn.detailedstatuslog yes }
else { set %msn.detailedstatuslog no }
}
if ($did = 36) {
if ($did(msncontrol,36).state) { set %msn.flash yes }
else { set %msn.flash no }
}
if ($did = 38) {
if ($did(msncontrol,38).state) { set %msn.awaymessage $yes }
else { set %msn.awaymessage $no }
}
if ($did = 43) {
set %msn.awaymessage.message $input(Away message to send to contacts?,eoq,Away System, %msn.awaymessage.message )
}
}
on *:dialog:msncontrol:init:*:{
if ( $sock(msn) == $null ) {
did -b msncontrol 1
did -b msncontrol 2
did -b msncontrol 4
did -b msncontrol 5
did -b msncontrol 6
did -b msncontrol 8
}
if (%msn.sounds == on) { did -c msncontrol 45 }
if (%msn.showtype == YES) { did -c msncontrol 3 }
if (%msn.log == 1) { did -c msncontrol 7 }
if (%msn.autoconnect == $yes) { did -c msncontrol 10 }
if (%msn.reconnect == $yes) { did -c msncontrol 16 }
if (%msn.chat.style == irc) { did -c msncontrol 18 }
if (%msn.mailnotification == yes) { did -c msncontrol 19 }
if (%msn.showlogon == $yes) { did -c msncontrol 20 }
if (%msn.autoidle == yes) { did -c msncontrol 28 }
if (%msn.awaysync == $yes) { did -c msncontrol 23 }
if (%msn.window.minimise == $yes) { did -c msncontrol 24 }
if (%msn.sortbygroup == $yes) { did -c msncontrol 21 }
if (%msn.showoffline == $yes) { did -c msncontrol 29 }
if (%msn.chatwindow.style == $yes) { did -c msncontrol 31 }
if (%msn.detailedstatuslog == yes) { did -c msncontrol 35 }
if (%msn.flash == yes) { did -c msncontrol 36 }
if (%msn.background == $yes) { did -c msncontrol 30 }
if (%msn.awaymessage == $yes) { did -c msncontrol 38 }
}
on *:dialog:msnmail:sclick:2:{
run http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1222806157&rver=4.5.2130.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fmail%2Fmail.aspx%3F_om%3Dml%26rru
}
on *:dialog:msnmail:init:*:{
if ( %msn.sounds == on ) { splay $shortfn($scriptdir) $+ mail.wav }
}
on *:dialog:msnconnect:init:*:{
did -i msnconnect 3 0 %msn.user
if ( %msn.rememberpass = 1 ) {
did -r msnconnect 4
did -a msnconnect 4 %msn.pass
}
if ( %msn.chg == 1 ) { did -c msnconnect 6 }
}
on *:dialog:msnnew_version:sclick:4:{
run %msn.newversion.url
dialog -x msnnew_version
}
on *:dialog:new_version:sclick:5:{
dialog -x msnnew_version
}
on *:dialog:msncomment:sclick:8:{
set %msn.comment.name $urlencode( $did(1) )
set %msn.comment.email $urlencode( $did(5) )
set %msn.comment.comment $urlencode( $did(6) )
if ( %msn.comment.name == $null ) || ( %msn.comment.comment == $null ) {
echo -a Comment not sent. You must enter your name and a comment.
halt
}
sockopen comment www.burningimage.net 80
echo -a Thankyou. You comments will be read and acted upon. If you entered your E-mail address then expect an e-mail from the author.
}
on *:dialog:msncomment:init:{
unset %msn.comment.*
}
on *:SOCKOPEN:comment:{
if ($sock($sockname).status == active) {
sockwrite comment GET /msn/comments/leavecomment.php?name= $+ %msn.comment.name $+ &email= $+ %msn.comment.email $+ & $+ comment= $+ %msn.comment.comment HTTP/1.0 $+ $crlf $+ Host: www.burningimage.net $+ $crlf $+ $crlf
}
}
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
alias newver {
unset %msn.temp
set %msn.temp3 $1
sockclose lalala
sockclose newvercount
sockopen lalala www.burningimage.net 80
sockopen newvercount www.burningimage.net 80
}
on *:SOCKOPEN:lalala:{
if ($sock($sockname).status == active) {
sockwrite lalala GET /msn/newver/index.htm HTTP/1.0 $+ $crlf $+ Host: www.burningimage.net $+ $crlf $+ $crlf
}
}
on *:SOCKOPEN:newvercount:{
if ($sock($sockname).status == active) {
if (%msn.temp3 == in) {
sockwrite newvercount GET /msn/client/uniqueclient390in.php HTTP/1.0 $+ $crlf $+ Host: www.burningimage.net $+ $crlf $+ $crlf
}
if (%msn.temp3 != in) {
sockwrite newvercount GET /msn/client/uniqueclient390.php HTTP/1.0 $+ $crlf $+ Host: www.burningimage.net $+ $crlf $+ $crlf
}
}
}
on *:sockread:lalala:{
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
if (%temp == $null) %temp = -
;window @debug
;aline @debug 4 $+ %temp
if ( $gettok(%temp,1,32) == !version! ) {
set %msn.newversion $gettok(%temp,2,32)
set %msn.newversion.url $gettok(%temp,3,32)
if ( %msn.newversion > $msnversion ) && (!%msn.nonag) && (!%msn.naggedonce) {
dialog -m msnnew_version msnnew_version
echo -a Type /msn.nonag to not see the "New Version" dialog again.
set %msn.naggedonce 1
}
halt
}
if ( $gettok(%temp,1,32) = !motd! ) {
set %msn.motd $gettok(%temp,2-,32)
}
goto nextread
}
alias msn.nonag {
echo -a Please ensure you check the website (http://www.burningimage.net/msn) for updates regularly.
echo -a You won't be nagged again. :)
echo -a (type /msn.nag to change your mind)
set %msn.nonag 1
}
alias /msn.nag {
echo -a You will now be told about new versions when you connect.
unset %msn.nonag
}
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
alias alldone {
sockwrite -n msnfile BYE 16777989
}
alias msnfilercvd {
mkdir $shortfn($scriptdir) $+ downloads
set %msn.file.sizetoreceive $calc( %msn.file.filesize + $calc($calc($int($calc( %msn.file.filesize / 2045 )) + 1) * 3) )
write -c $shortfn($scriptdir) $+ downloads\ $+ %msn.file.filename $+ .temp
set %msn.fileuser $1
set %msn.temp $?!"Do you wish to accept the following file? $crlf $crlf $+ %msn.file.filename $+ $crlf $crlf $+ $int($calc( %msn.file.filesize / 1024)) $+ KB"
if (%msn.temp == $true) { msnfileaccept $1 }
else { msnfiledecline $1 }
}
alias msnfiledecline {
sockwrite -n chat. $+ $1 MSG %msn. [ $+ [ $1 ] ] N $calc(143 + $len(%msn.file.cookie) )
sockwrite -n chat. $+ $1 MIME-Version: 1.0
sockwrite -n chat. $+ $1 Content-Type: text/x-msmsgsinvite; charset=UTF-8
sockwrite -n chat. $+ $1
sockwrite -n chat. $+ $1 Invitation-Command: CANCEL
sockwrite -n chat. $+ $1 Invitation-Cookie: %msn.file.cookie
sockwrite -n chat. $+ $1 Cancel-Code: REJECT
sockwrite -n chat. $+ $1
halt
}
alias msnfileaccept {
set %msn.file.willy notreceive
sockclose msnfilelisten
socklisten msnfilelisten 6891
;set %msn.ip 192.168.1.108
sockwrite -n chat. $+ $1 MSG %msn. [ $+ [ $1 ] ] N $calc(234 + $len(%msn.file.cookie) + $len(%msn.ip) + $len(%msn. [ $+ [ $1 ] ]))
sockwrite -n chat. $+ $1 MIME-Version: 1.0
sockwrite -n chat. $+ $1 Content-Type: text/x-msmsgsinvite; charset=UTF-8
sockwrite -n chat. $+ $1
sockwrite -n chat. $+ $1 IP-Address: %msn.ip
sockwrite -n chat. $+ $1 Port: 6891
sockwrite -n chat. $+ $1 AuthCookie: 544120
sockwrite -n chat. $+ $1 Sender-Connect: TRUE
sockwrite -n chat. $+ $1 Invitation-Command: ACCEPT
sockwrite -n chat. $+ $1 Invitation-Cookie: %msn.file.cookie
sockwrite -n chat. $+ $1 Launch-Application: FALSE
sockwrite -n chat. $+ $1 Request-Data: IP-Address:
}
on *:socklisten:msnfilelisten:{
echo -a SOMEONE CONNECTED
sockaccept msnfile
sockclose msnfilelisten
msnchatwindow %msn.fileemail
sockwrite -n msnfile VER MSNFTP
}
on *:sockread:msnfile:{
if ($sockerr > 0) return
:nextread
sockread -f &binvar
write -c temp2.txt
if ( %msn.file.willy == receive ) { goto willg }
bwrite temp2.txt -1 -1 &binvar
set %msn.file.data $read(temp2.txt)
:willg
if ( %msn.file.data == $null ) { set %msn.file.data (null) }
if ($sockbr == 0) return
if ( %msn.file.data == VER MSNFTP ) { sockwrite -n msnfile USR %msn.user 544120 }
elseif ( $left(%msn.file.data,3) == FIL ) {
set %msn.file.totalbytes $gettok( %msn.file.data,2,32)
sockwrite -n msnfile TFR
if (!$dialog(msnfilerecv)) { dialog -m msnfilerecv msnfilerecv }
}
else {
set %msn.file.willy receive
bwrite $shortfn($scriptdir) $+ downloads\ $+ %msn.file.filename $+ .temp -1 -1 &binvar
if ($dialog(msnfilerecv)) {
did -o msnfilerecv 2 1 $int($calc( ( $file( $shortfn($scriptdir) $+ downloads\ $+ %msn.file.filename $+ .temp ).size / %msn.file.sizetoreceive) * 100 ) ) $+ % completed
}
if ( $file( $shortfn($scriptdir) $+ downloads\ $+ %msn.file.filename $+ .temp ).size == %msn.file.sizetoreceive ) {
alldone
set %msn.temp $dll($scriptdirblah.dll,get,$shortfn($shortfn($scriptdir) $+ downloads\ $+ %msn.file.filename $+ .temp) $mircdir $+ msn\downloads\ $+ %msn.file.filename)
did -v msnfilerecv 4
did -b msnfilerecv 5
set %msn.file.willy notreceive
.remove $shortfn($scriptdir) $+ downloads\ $+ %msn.file.filename $+ .temp
}
goto nextread
}
goto nextread
}
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
alias msnsendfile {
set %msn.fileemail %msn.clickemail
set %msn.filename.path $sfile(c:\,Browse for the file you wish to send,Send File)
if ( %msn.filename.path == $null ) { halt }
if ( $file(%msn.filename.path).size == $null ) {
echo -a Error: %msn.filename.path does not exist.
halt
}
set %msn.filename.file $msngetfile( %msn.filename.path )
if ( %msn.filename.file == $null ) { halt }
set %msn.invitation.cookie $rand(11111,99999)
sockwrite -n chat. $+ %msn.clickemail MSG %msn. [ $+ [ %msn.fileemail ] ] N $calc(260 + $len($file(%msn.filename.path).size) + $len(%msn.filename.file))
sockwrite -n chat. $+ %msn.clickemail MIME-Version: 1.0
sockwrite -n chat. $+ %msn.clickemail Content-Type: text/x-msmsgsinvite; charset=UTF-8
sockwrite -n chat. $+ %msn.clickemail
sockwrite -n chat. $+ %msn.clickemail Application-Name: File Transfer
sockwrite -n chat. $+ %msn.clickemail Application-GUID: {5D3E02AB-6190-11d3-BBBB-00C04F795683}
sockwrite -n chat. $+ %msn.clickemail Invitation-Command: INVITE
sockwrite -n chat. $+ %msn.clickemail Invitation-Cookie: %msn.invitation.cookie
sockwrite -n chat. $+ %msn.clickemail Application-File: %msn.filename.file
sockwrite -n chat. $+ %msn.clickemail Application-FileSize: $file(%msn.filename.path).size
sockwrite -n chat. $+ %msn.clickemail
aline @ $+ %msn.fileemail *** Waiting for user to accept %msn.filename.file .....
}
alias declinefile {
.timersendfile off
aline @ $+ %msn.fileemail *** File was declined.
dline -l @ $+ %msn.fileemail 7-20
halt
}
alias msnacceptfile {
sockclose filesendlisten
sockclose filesend
socklisten filesendlisten 6891
;set %msn.ip 127.0.0.1
sockwrite -n chat. $+ %msn.fileemail MSG %msn. [ $+ [ %msn.fileemail ] ] U $calc(225 + $len(%msn.ip))
sockwrite -n chat. $+ %msn.fileemail MIME-Version: 1.0
sockwrite -n chat. $+ %msn.fileemail Content-Type: text/x-msmsgsinvite; charset=UTF-8
sockwrite -n chat. $+ %msn.fileemail
sockwrite -n chat. $+ %msn.fileemail Invitation-Command: ACCEPT
sockwrite -n chat. $+ %msn.fileemail Invitation-Cookie: %msn.invitation.cookie
sockwrite -n chat. $+ %msn.fileemail IP-Address: %msn.ip
sockwrite -n chat. $+ %msn.fileemail Port: 6891
sockwrite -n chat. $+ %msn.fileemail AuthCookie: 1743276
sockwrite -n chat. $+ %msn.fileemail Launch-Application: FALSE
sockwrite -n chat. $+ %msn.fileemail Request-Data: IP-Address:
sockwrite -n chat. $+ %msn.fileemail
aline @ $+ %msn.fileemail *** File accepted, commencing file transfer...
halt
}
on *:socklisten:filesendlisten:{
sockaccept filesend
sockclose filesendlisten
}
on *:sockread:filesend:{
if ($sockerr > 0) return
:nextread
if ( $sock(filesend) == $null ) { halt }
sockread %temp
if ($sockbr == 0) return
if ( %temp == VER MSNFTP ) { msnchatwindow %msn.fileemail | sockwrite -n filesend VER MSNFTP }
if ( $left(%temp,3) == USR ) { sockwrite -n filesend FIL $file(%msn.filename.path).size }
if ( $left(%temp,3) == TFR ) { msnstartsending }
if ( $left(%temp,3) == CCL ) {
sockclose filesend
dline -l @ $+ %msn.fileemail 7-20
aline @ $+ %msn.fileemail *** File transfer aborted
.timersendfile off
halt
}
if ( $left(%temp,3) == BYE ) {
dline -l @ $+ %msn.fileemail 7-20
aline @ $+ %msn.fileemail *** File transfer completed successfully.
sockclose file*
.timersendfile off
}
goto nextread
}
alias msnstartsending {
set %msn.location 0
aline -l @ $+ %msn.fileemail -
aline -l @ $+ %msn.fileemail 0% Complete
.timersendfile -m 0 10 msnsendnextbit
}
alias -l msnsendnextbit {
if ($sock(filesend).sq >= 14336) return
if ( %msn.location >= $file(%msn.filename.path).size ) {
.timersendfile off
goto exitit
}
bread $shortfn(%msn.filename.path) %msn.location 2045 &binvar
set %msn.second $int($calc( $bvar(&binvar,0) /256))
set %msn.first $calc( $bvar(&binvar,0) - ( %msn.second * 256))
bset &temp 1 0 %msn.first %msn.second
sockwrite filesend &temp
sockwrite filesend &binvar
rline -l @ $+ %msn.fileemail 8 $int($calc(%msn.location / $file(%msn.filename.path).size * 100 )) $+ % Complete
set %msn.location $calc( %msn.location + 2045 )
:exitit
}
alias msngetfile {
set %count $len($1-)
:start
if ( $mid($1-,%count,1) == \ ) { goto end }
dec %count 1
goto start
:end
return $mid($1-, $calc( %count + 1) )
}
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
alias openssl {
var %hh,%hhp
if ($gettok(%msn.user, 2, 64) == hotmail.com) { %web = loginnet.passport.com }
if ($gettok(%msn.user, 2, 64) == hotmail.co.uk) { %web = loginnet.passport.com }
elseif ($gettok(%msn.user, 2, 64) == msn.com) { %web = msnialogin.passport.com }
else { %web = login.passport.com }
%hh = $gettok(%web, 1, 46) | %hhp = 80
inc %nums
sockopen ssl? $+ %hh $+ %nums %hh $+ .passport.com %hhp
sockmark ssl? $+ %hh $+ %nums passport
}
on *:sockopen:ssl?*:{
if ($sockerr > 0) { echo -s closed $sockname | return }
else {
echo -s $sockname
set %auth Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in= $+ $replace(%msn.user,@,% $+ 40) $+ ,pwd= $+ %msn.pass $+ , $+ %vknc
sockwrite -n $sockname GET /login2.srf HTTP/1.1
sockwrite -n $sockname Authorization: %auth
sockwrite -n $sockname Host: %web
sockwrite -n $sockname User-Agent: MSMSGS
sockwrite -n $sockname Connection: Keep-Alive
sockwrite -n $sockname Cache-Control: no-cache
sockwrite -n $sockname $str($crlf, 2)
}
if ( %msn.rememberpass != 1 ) { unset %msn.pass }
;unset %auth
}
on *:sockread:ssl?*:{
var %a
sockread %a
tokenize 32 %a
while ($sockbr) {
if ( %msn.debug = 1 ) { echo -s $sockname : $+ %a }
if ($gettok(%a, 1, 32) == Authentication-Info:) {
sendmsn USR %msn.main TWN S $gettok(%a, 2, 39)
return
}
sockread %a
}
}
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
alias msnauth {
if ($com(auth)) { .comclose auth }
.comopen auth WinHttp.WinHttpRequest.5.1
if ($comerr) {
.comreg winhttp5.1.dll
.comopen auth WinHttp.WinHttpRequest.5.1
if ($comerr) { msnauths }
}
if (!$com(auth,Open,1,bstr,GET,bstr,https://nexus.passport.com/rdr/pprdr.asp)) { return }
if (!$com(auth,Send,1)) { return }
if ($com(auth,GetAllResponseHeaders,1)) {
tokenize 44 $com(auth).result
hadd -m msnauth url / $+ $gettok($gettok($3,2,61),2,47)
}
}
alias msnauths {
if ($com(auth)) { .comclose auth }
.comopen auth WinHttp.WinHttpRequest.5
if ($comerr) {
.comreg winhttp5.dll
.comopen auth WinHttp.WinHttpRequest.5
if ($comerr) { return }
}
if (!$com(auth,Open,1,bstr,GET,bstr,https://nexus.passport.com/rdr/pprdr.asp)) { return }
if (!$com(auth,Send,1)) { return }
if ($com(auth,GetAllResponseHeaders,1)) {
tokenize 44 $com(auth).result
hadd -m msnauth url / $+ $gettok($gettok($3,2,61),2,47)
}
}
alias msnauth2 {
if (!$hget(msnauth,url)) || (!$hget(msnauth,path)) { return }
.hadd -m msnauth furl $hget(msnauth,path) $+ $hget(msnauth,url)
.hdel msnauth url
.hdel msnauth path
if ($com(auth)) { .comclose auth }
.comopen auth WinHttp.WinHttpRequest.5.1
if ($comerr) {
.comreg winhttp5.1.dll
.comopen auth WinHttp.WinHttpRequest.5.1
if ($comerr) { msnauths2 }
}
if (!$com(auth,Open,1,bstr,GET,bstr,https:// $+ $hget(msnauth,furl))) { return }
if (!$com(auth,SetRequestHeader,1,bstr,Authorization,bstr,$hget(msnauth,info))) { return }
if (!$com(auth,SetRequestHeader,1,bstr,Host,bstr,$gettok($hget(msnauth,furl),1,47))) { return }
if (!$com(auth,Send,1)) { return }
if ($com(auth,GetResponseHeader,1,bstr,authentication-info)) {
sendmsn USR %msn.main TWN S $gettok($com(auth).result,2,39)
if ($hget(msnauth)) { .hfree msnauth }
if ($com(auth)) { .comclose auth }
}
}
alias msnauths2 {
if (!$hget(messenger,email)) || (!$hget(messenger,password)) { return }
if (!$hget(msnauth,url)) || (!$hget(msnauth,path)) { return }
.hadd -m msnauth furl $hget(msnauth,path) $+ $hget(msnauth,url)
.hdel msnauth url
.hdel msnauth path
if ($com(auth)) { .comclose auth }
.comopen auth WinHttp.WinHttpRequest.5
if ($comerr) {
.comreg winhttp5.dll
.comopen auth WinHttp.WinHttpRequest.5
if ($comerr) { return }
}
if (!$com(auth,Open,1,bstr,GET,bstr,https:// $+ $hget(msnauth,furl))) { return }
if (!$com(auth,SetRequestHeader,1,bstr,Authorization,bstr,$hget(msnauth,info))) { return }
if (!$com(auth,SetRequestHeader,1,bstr,Host,bstr,$gettok($hget(msnauth,furl),1,47))) { return }
if (!$com(auth,Send,1)) { return }
if ($com(auth,GetResponseHeader,1,bstr,authentication-info)) {
sendmsn USR %msn.main TWN S $gettok($com(auth).result,2,39)
if ($hget(msnauth)) { .hfree msnauth }
if ($com(auth)) { .comclose auth }
}
}
;--------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------
alias msnnewauth {
sockclose conn
sockopen -e conn nexus.passport.com 443
.timerssltimeout 1 20 msnssltimeout
}
alias msnssltimeout {
aline -p @messenger 10 $+ *** OpenSSL connection attempt timed out. Falling back on WinHTTP method...
msnauth
msnauth2
}
on *:sockopen:conn:{
if ( !$sock(conn)) { echo -a 4Error. Please reconnect to MSN for mIRC }
.timer -m 1 500 sockwrite -n conn GET https://nexus.passport.com/rdr/pprdr.asp HTTP/1.0 $+ $crlf $+ $crlf
}
on 1:sockread:conn:{
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
if (%temp == $null) %temp = -
if (%msn.debug == 1) { aline -p @messenger ~~~ %temp }
if $left(%temp,13) == PassportURLs: {
set %temp $gettok(%temp,2,44)
set %msnauthurl $gettok(%temp,2,61)
.timerssltimeout off
msnloginserver
}
goto nextread
}
alias msnloginserver {
sockclose msnlogin
sockopen -e msnlogin $gettok(%msnauthurl,1,47) 443
.timerssltimeout 1 20 msnssltimeout
}
on *:sockopen:msnlogin:{
sockwrite -n msnlogin GET / $+ $gettok(%msnauthurl,2-,47) HTTP/1.1
sockwrite -n msnlogin Authorization: $hget(msnauth,info)
sockwrite -n msnlogin Host: $gettok(%msnauthurl,1,47) $+ $crlf $+ $crlf
}
on 1:sockread:msnlogin:{
if ($sockerr > 0) return
:nextread
if ($sock(msnlogin)) {
sockread %temp
}
else { return }
if ($sockbr == 0) return
if (%temp == $null) { set %temp - }
if (%msn.debug == 1) { aline -p @messenger ~~~ %temp }
if (da-status=success isin %temp) {
.timerssltimeout off
sendmsn USR %msn.main TWN S $gettok(%temp,2,39)
}
if ($left(%temp,12) == HTTP/1.1 401) {
aline -p @messenger 4*** ERROR: Authentication failed, is your login name and password correct?
.timerssltimeout off
sockclose msn
window -l50k0Sz @Messenger %msn.messenger.font $shortfn($scriptdir) $+ msn.ico
aline -p @messenger 10*** Disconnected
titlebar @Messenger -=[ Offline ]=-
dline -l @Messenger 1- $+ $line(@Messenger,0,1)
halt
}
if ($left(%temp,9) == Location:) {
set %msnauthurl $gettok(%temp,2,32)
set %msnauthurl $gettok(%msnauthurl,2-,47)
sockclose msnlogin
sockopen -e msnlogin $gettok(%msnauthurl,1,47) 443
goto end
}
goto nextread
:end
}