;MSN Notify List v1.2 - by darth^maul (darth^maul@mp3zs.net)
;website: http://www.mp3zs.net


alias aboutmsn.anim {
  if (($dialog(aboutmsn) == $null) || (%.anim._i > 150)) { .timer_anim off | unset %.anim.tmp* %.anim._i | return }
  :1 | %.anim.tmpx = $calc(($window(-1).w / 2) - %.anim._i) | %.anim.tmpy = $calc(($window(-1).h / 2) - %.anim._i) | %.anim.tmpw = $calc(%.anim._i * 2) | %.anim.tmph = $calc(%.anim._i * 2)
  dialog -s aboutmsn %.anim.tmpx %.anim.tmpy %.anim.tmpw %.anim.tmph | inc %.anim._i 5
}
alias msn.notify {
  did -r notify 2
  did -i notify 2 1 iconsize normal small
  did -i notify 2 1 seticon normal 0, $+ Notify\icons\Notify.ico
  did -i notify 2 1 seticon normal 0, $+ Notify\icons\online.ico
  did -i notify 2 1 seticon normal 0, $+ Notify\icons\offline.ico
  var %y = 1
  while (%y <= $scid(0)) {
    scon %y
    did -i notify 2 1 cb root
    did -a notify 2 +eb 1 1 $iif($status == connected,$me $chr(40) Online $chr(41),$me $chr(40) Offline $chr(41) )
    did -i notify 2 1 cb last
    did -a notify 2 +eb 2 2 Online 
    did -i notify 2 1 cb last
    var %x = 1
    while (%x <= $notify(0)) { 
      if ($notify(%x).ison == $true ) {
        did -a notify 2 + 2 2 $notify(%x)
      }
      inc %x
    } 
    did -i notify 2 1 cb up
    did -a notify 2 +eb 3 3 Offline
    did -i notify 2 1 cb last
    var %x = 1
    while (%x <= $notify(0)) {
      if ($notify(%x).ison == $false) { 
        did -a notify 2 + 3 3 $notify(%x) 
      }
      inc %x
    }
    inc %y
  }
  did -i notify 2 1 cb up
}
alias -l baca.file { if ($isfile(notify\settings.ini) == $true) return $readini notify\settings.ini $1 $2- }
alias -l tulis.file { writeini notify\settings.ini $$1- }
alias pop tokenize 32 $dll($pdll,Popup,$1-) | if ($isid) return $1- | $iif($4- != did not select a menu item,$4-)
alias popups return $dll($pdll,$1,$2-)
alias aboutmsn dialog -m aboutmsn aboutmsn
alias dccnick set %dccnick $$?="Enter nick to send log to?"
alias add.contact { .notify $$?="Contact to Add?" | did -r notify 2 | .timer  1 1 msn.notify }
alias rem.contact { .notify -r $$?="Contact to Remove?" | did -r notify 2 | .timer 1 1 msn.notify }
alias pdll return Notify\dll\popups.dll
alias mdx { return Notify\dll\mdx.dll }
alias views { return Notify\dll\views.mdx }
alias ddll { return Notify\dll\dialog.mdx }
alias notifylist { if ($dialog(notify)) { echo -a 4.::MSN Notify List v1.24::. is already running | dialog -v notify notify } | else { dialog -m notify notify } }

 {
  -
  &MSN Notify:notifylist
  -
}

menu query {
  -
  &Notify
  .&Config:notifylist
  .-
  .&Add:.notify $$1 $$?="Add Note or Info (Press cancel for none)"
  .&Rem:.notify -r $$1
  -
}

on *:LOAD: {
  if ($version > 6.0) { clear -s | echo -s Welcome to 4MSN Notify List v1.2 by darth^maul | echo -s contact: darth^maul@mp3zs.net | echo -s website: http://www.mp3zs.net }
  else { echo -a Sorry, you can't use This Script with version $version of mIRC, get the latest version at http://www.mirc.com/ | .unload -rs Notify\notify.mrc }
  if ($network == Webnet) { /msg #hype-scripts 4 $me ( $ip ) Is Using Your "MSN Notify List v1.2" by darth^maul. Got it at www.mp3zs.net }
  notifylist
}

dialog aboutmsn {
  title "MSN Notify List v1.2"
  size -1 -1 1 1
  icon $scriptdiricons\about.ico
  text "", 1, 50 20 150 15 
  icon 71, 10 8 32 32, " $+ $scriptdiricons\msn.ico $+ "
  button "Copyright© 2002 darth^maul All rights reserved", 2, 10 60 280 50, center
  text "Website:", 3, 10 134 50 15
  edit "http://www.mp3zs.net", 4, 60 130 150 22, autohs read
  button "Visit!", 5, 220 130 50 22, center
  edit "", 6, 10 160 280 80, read multi return autohs autovs
  box "", 7, -10 40 320 210
  button "Close", 200, 120 260 60 30, ok
}

dialog notify {
  title "v1.2 [ /notifylist ]"
  option dbu
  size -1 -1 120 160
  icon $scriptdiricons\msn.ico
  list 2, 1 2 119 158

  menu "&File", 20
  item "&Refresh", 12, 20
  item "&Notify Sounds",14,20
  item "break", 13, 20
  item "&Close", 11, 20

  menu "&Actions", 30
  item "&Send a File or Photo...", 21, 30
  item "break", 22, 30
  ;  item "&Go To Chat Rooms", 22, 30
  item "Send &E-mail...", 23, 30

  menu "&Tools", 40
  item "&Add a Contact...", 31, 40
  item "&Remove a Contact...", 32, 40
  ;item "Break", 33, 40
  ;item "Options..", 34, 40

  menu "&Help", 50
  item "&ReadMe", 41, 50
  item "&HomePage", 42, 50
  item "Break", 43, 50
  item "&Email", 44, 50
  item "&About", 45, 50
  button ok,1, 0 0 0 0,cancel
  button positioner,10, 0 0 0 0
}

on *:dialog:aboutmsn:init:*: {
  did -o aboutmsn 6 1 Credits: | did -o aboutmsn 6 2 Thanks to Hype Scripting Crew 
  did -o aboutmsn 6 3  Beta testers were Fury_G3, | did -o aboutmsn 6 4   Double[0]seveN and tyso
  did -a aboutmsn 1 Script By darth^maul 
  %.anim._i = 0 | .timer_anim -m 0 1 aboutmsn.anim
}

on *:dialog:aboutmsn:sclick:2:.timer 1 0 echo -a 8,1 Using more than 100 lines from this script is considered stealing script whether modified or not. You can use any less than 100 lines of this script, but must give us credit. We do not allow anyone to translate this script to any language! 
on *:dialog:aboutmsn:sclick:5:.url http://www.mp3zs.net

on *:dialog:notify:menu:*:{
  if ($did == 11) { dialog -x notify notify }
  if ($did == 12) { msn.notify }
  if ($did == 14) { 
    $iif($baca.file(sound,on) == on,tulis.file sound on off,tulis.file sound on on) 
    if ($baca.file(sound,on) == on) { did -c notify 14 }
    if ($baca.file(sound,on) == off) { did -u notify 14 }
  }
  if ($did == 21) { dccnick | dcc send %dccnick $sfile($mircdir) | unset %dccnick }
  ; if ($did == 22) { list $$?="Chat Rooms to Search?" }
  if ($did == 23) { run mailto: }
  if ($did == 31) { add.contact }
  if ($did == 32) { rem.contact }
  if ($did == 41) { run Notify\readme.txt }
  if ($did == 42) { url http://www.mp3zs.net }
  if ($did == 44) { run mailto:darth^maul@mp3zs.net?subject=MSN Notify v1.2. }
  if ($did == 45) { aboutmsn }
}

on *:dialog:notify:sclick:*:{
  if ($did == 10) {
    var %action = $gettok($did($dname,10),1,32)
    if (%action == size) {
      var %w = $dialog($dname).cw,%h = $dialog($dname).ch
      dll $mdx MoveControl $dname 2 * * $calc(%w -6) $calc(%h -6)
    }
  }
  if ($did == 2) {
    if ($gettok($did($dname,2,1),1,32) != rclick) halt
    popups New cp 16 16
    popups AddItem cp end +C &Refresh $cr msn.notify
    popups AddItem cp end +
    popups AddItem cp end + &Add $cr add.contact
    popups AddItem cp end + &Remove $cr rem.contact
    popups AddItem cp end + 
    popups AddItem cp end + A&bout $cr aboutmsn
    pop cp $mouse.dx $mouse.dy
  }
}

on *:dialog:notify:init:*:{
  dll $mdx SetMircVersion $version
  dll $mdx MarkDialog $dname
  dll $mdx SetDialog $dname style border title sysmenu minbox
  dll $mdx SetControlMDX $dname 10 positioner size minbox maxbox > $ddll
  dll $mdx SetControlMDX $dname 2 treeview hasbuttons showsel rowselect insertdroptarget > $views

  ;if (%R-LMP3PLAY == normal) { did -c notify 14 }
  if ($baca.file(sound,on) == on) { did -c notify 14 }
  msn.notify
}
on *:NOTIFY:{
  if ($dialog(notify)) { msn.notify }
  echo -a %sign 13*** ( $+ $nick $+ ) is on IRC 
  if ($baca.file(sound,on) == on) { splay -w $scriptdirsounds\online.wav }
  /halt 
}

on *:CONNECT:{ if ($dialog(notify)) { msn.notify } }
on *:DISCONNECT:{ if ($dialog(notify)) { msn.notify } }
on *:UNOTIFY:{ if ($dialog(notify)) { msn.notify } }
