mIRC Notepad

By ProIcons on Apr 01, 2009

/Notepad
:D

dialog Notepad {
  title "Notepad: New Text Document"
  size -1 -1 580 338
  option dbu
  edit "", 1, 0 0 579 330, multi return autohs autovs hsbar vsbar
  text "", 15, 1 330 43 7, 
  text "", 16, 519 330 55 7, 
  menu "File", 2
  item "New", 5, 2
  item "Open", 6, 2
  item "Save", 7, 2
  item "Save As..", 8, 2
  item break, 9, 2
  item "Exit", 10, 2
  menu "View", 3
  item "Status Bar", 11, 3
  menu "Help", 4
  item "Help", 12, 4
  item break, 13, 4
  item "About", 14, 4
}

on *:dialog:Notepad:Menu:*:{
  if ($did == 5) {
    if (%notepad.lines != $did($dname,1).lines) { 
      if ($?!="Are You Want to save your project?" == $false) {
      did -r $dname 1 | dialog -t $dname Notepad: New Text Document }
      set %Notepad.lines $did($dname,1).lines
    }
    else { did -r $dname 1 | dialog -t $dname Notepad: New Text Document 
      set %Notepad.lines $did($dname,1).lines
    }
  }
  if ($did == 6) { 
    if (%notepad.lines != $did($dname,1).lines) { 
      if ($?!="Are You Want to save your project?" == $false) { 
        Sload
      } 
      else { .savebuf -eo $dname 1 " $+ $sfile(C:/*.txt,Save,Save) $+ " } 
    }
    else { sload }
  }
  if ($did == 7) { set %Notepad.lines $did($dname,1).lines | .savebuf  -eo $dname 1 " $+ $scriptdirTextDocument.txt $+ " | inc %files }
  if ($did == 8) { set %Notepad.lines $did($dname,1).lines | set %save_file $sfile(C:/*.txt,Save File as..,Save) | set %View_File $replace($nopath(%save_file),$chr(44),.) | .savebuf  -eo $dname 1 " $+ %save_file $+ .txt" | dialog -t $dname Notepad: %view_file | dialog -m Save_file save_file }
  if ($did == 10) { dialog -x $dname }
  if ($did == 14) { dialog -m Notepad_About Notepad_About }
  if ($did == 11) {
    if (%Notepad.StatusBar == off) { set %Notepad.StatusBar on | did -a $dname 15  Lines: $did(Notepad,1).lines | did -a $dname 16 $mouse.x $mouse.y | did -c $dname 11 }
    else { set %Notepad.StatusBar off | did -r $dname 15 | did -r $dname 16 | did -u $dname 11 }
  }
}
alias sload { set %Text_File $sfile(C:/*.txt,Please Select a Text File To Continue,Open) | if (%text_file != $null) { did -r Notepad 1  set %View_File $replace($nopath(%text_file),$chr(44),.) | .loadbuf 0 -o Notepad 1 " $+ %text_file $+ "  unset %text_file } }
alias /Notepad { /dialog -m Notepad Notepad }

on *:dialog:Notepad:edit:*:{ 
  if (%Notepad.StatusBar == on) { did -ra $dname 15 Lines: $did(Notepad,1).lines  }
}
on *:dialog:Notepad:close:*:{
  if (%notepad.lines != $did($dname,1).lines) {
    if ($?!="Are You Want to save your project?" == $false) {
      halt
    }
    else { .savebuf  -eo $dname 1 " $+ $sfile(C:/*.txt,Save File as..,Save) $+ .txt" }
  }
  else { halt }
}
on *:dialog:Notepad:Mouse:*:{ 
  if (%Notepad.StatusBar == on) { did -ra $dname 16 $mouse.x $mouse.y  }
}

alias Proccess {
  var %a = 1
  while (%a <= 21) {
    set %b $calc(%b + $rand(0,300))
    .timer -m 1 %b .did -ra Save_File 16 %s $+ %
    inc %s 5
    inc %a

  }

}

dialog Save_File {
  title "Save - File"
  size -1 -1 186 40
  option dbu
  icon $scriptdirBloc Notes SZ.ico, 0
  edit "0%", 16, 65 11 50 10, center
  text "Path File", 17, 30 2 116 8
  text "Total Size", 18, 0 26 37 8
  edit "", 19, 38 25 42 10, read center
}
on *:dialog:save_file:init:0:{ Proccess | .timer 1 3 did -a $dname 19 $mid($calc($file(%save_file $+ .txt).size / 1000),1,4) KB | did -a $dname 17 %save_file $+ .txt }
on *:dialog:Save_File:close:*:{ unset %b | unset %s }
alias save_As {
  var %i = 1
  while ( %i <= $did(notepad,1).lines ) {
    write " $+ %save_file $+ .txt" $did(notepad,1,%i).text
    inc %i
  }
}
dialog Notepad_About {
  title "About Notepad"
  size -1 -1 147 81
  option dbu
  list 1, -1 -1 151 85,
}
on *:dialog:Notepad_About:active:0:{ 
  did -a $dname 1 Notepad Script By ProIcons 
  did -a $dname 1 mIRC Notepad 2007©
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.