Text viewer and Editor

By Ghost-lit Warder on Aug 17, 2007

This is an idea I had for my script, it's been seen before in other scripts as well. I, however, modified the idea into a viewer and editor through a simple dialog in mIRC, so there is no need to use //run or go through all of your folders. Enjoy.

  • If you plan to edit this script, I would like to ask partial credit in your work. Thank you.
alias textview dialog -md textviewer textviewer
dialog textviewer {
  title "Text Viewer"
  size -1 -1 237 80
  option dbu
  list 1, 0 1 236 64, size
  button "Run a text file", 2, 3 68 56 12, flat
  button "Add a line of text", 3, 59 68 56 12, flat
  button "Delete a line of text", 4, 115 68 58 12, flat
  button "Exit", 5, 173 68 61 12, flat ok
}
on *:DIALOG:textviewer:sclick:*: {
  if ($did == 2) { 
    set %tfilename $?="Enter text name here without the '.txt'." 
    did -r textviewer 1 
    loadbuf -ro textviewer 1 %tfilename $+ .txt
  }
  if ($did = 3) {
    write %tfilename $+ .txt $?="Enter line of text."
    loadbuf -ro textviewer 1 %tfilename $+ .txt
  }
  if ($did = 4) {
    write -dl $+ $did(1).sel %tfilename $+ .txt
    loadbuf -ro textviewer 1 %tfilename $+ .txt
  }
  if ($did = 5) {
    unset %tfilename
  }
}
menu channel {
 .Textfile editor/viewer:textview
}

Comments

Sign in to comment.
Ghost-lit Warder   -  Aug 17, 2007

Changed the dialog name.

 Respond  
Ghost-lit Warder   -  Aug 17, 2007

.. Um, you shouldn\'t get that. o_O Are you opening it multiple times? You can control different texts by using the run file button again. It will still have the saved settings in the previous text file. I will add a popup though.

 Respond  
napa182   -  Aug 17, 2007

Nice But I got this

  • /dialog: \'textview\' name in use (line 1, script68.ini)
    add this to it to fix that
alias textview {
  dialog $iif($dialog(textview),-v,-md) textview textview
}

I also added it to the channel list

menu Channel { 
  .Textview { textview } 
} 
 Respond  
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.