Quote Manager

By ^Neptune on May 01, 2008

Image

I have a lot of quotes, so I decided to make a quote dialog. Put this in remotes and type /quote, or use the menu (right-click anywhere). If you need help on anything just hover over it, and it'll appear in that text box near the bottom.

Features:
-Add, Edit, Delete, Random and Selected buttons
-Search function
-Recycle Bin (This is where deleted quotes go to, so you can revive them if you want. You can clear and search it, too. To view it click "Recycle Options").

Enjoy! Please post comments and bugs (shouldn't be any). If you rate it a 1 please explain why.

on *:LOAD: {
  echo -a You have loaded Neptune's Quote Script.
  echo -a To open, type '/quote'.
  set %ysize 315 
}
menu * {
  Quote Manager: quoteopen
}
alias quote { 
  if (!%ysize) {
    set %ysize 315
  }
  else {
    dialog $iif($dialog(quote),-v,-md) quote quote 
  }
}
alias -l quoteopen { 
  if (!%ysize) {
    set %ysize 315
  }
  else {
    dialog $iif($dialog(quote),-v,-md) quote quote 
  }
}
dialog quote {
  title "Quote Manager"
  size -1 -1 370 %ysize 
  option pixels
  list 1, 0 22 370 190, hsbar vsbar size
  button "Random", 2, 215 213 65 25
  button "Add", 3, 5 213 65 25
  button "Delete", 4, 145 213 65 25
  button "Selected", 5, 285 213 65 25
  edit "", 6, 1 1 190 20, read
  edit "", 7, 5 243 250 20, autohs
  button "Search", 8, 260 243 80 20
  button "Recycle Options", 15, 5 265 360 25
  edit "", 16, 5 292 360 20, read
  button "View", 9, 10 335 130 25
  button "Clear", 10, 145 335 130 25
  edit "", 11, 10 365 250 20, autohs
  button "Search", 12, 265 365 80 20
  box "Recycle Options", 13, 5 315 350 75
  button "Edit", 14, 75 213 65 25
}
on *:dialog:quote:init:0: {
  if $read(quotes.txt) { 
    var %x = 1
    while (%x <= $lines(quotes.txt)) {
      did -a quote 1 $read(quotes.txt,%x)
      inc %x
    }
    did -z $dname 1
  }
  did -ra $dname 6 Total quotes: $did(1).lines
}
on *:dialog:quote:dclick:1: {
  msg $active Selected Quote $did(1).sel $+ : $did(1).seltext
}
on *:dialog:quote:mouse:*: {
  if ($did == 1) {
    did -ra $dname 16 This window displays all of your quotes. Double click a quote to display it.
  }
  if ($did == 2) {
    did -ra $dname 16 This will get a random quote an message it to the active channel.
  }
  if ($did == 3) {
    did -ra $dname 16 This will add a quote.
  }
  if ($did == 4) {
    did -ra $dname 16 This will delete the quote and send it to the recycled quotes section.
  }
  if ($did == 5) {
    did -ra $dname 16 This will message the active channel the quote you have selected.
  }
  if ($did == 6) {
    did -ra $dname 16 This displays your total quote count.
  }
  if ($did == 7) {
    did -ra $dname 16 Put what you want to search for in here then click the "Search" button.
  }
  if ($did == 8) {
    did -ra $dname 16 Use this button to search your quotes for what you want.
  }
  if ($did == 14) {
    did -ra $dname 16 Use this if you have manually added quotes to the .txt file.
  }
  if ($did == 15) {
    did -ra $dname 16 View recycled quote options.
  }
  if ($did == 9) {
    did -ra $dname 16 View the recycled quotes in a .txt file.
  }
  if ($did == 10) {
    did -ra $dname 16 Clear out the recycled quotes.
  }
  if ($did == 11) {
    did -ra $dname 16 Use this to search your recycled quotes.
  }
  if ($did == 12) {
    did -ra $dname 16 Click this button once you have put something in to search for.
  }
  if ($did == 14) { 
    did -ra $dname 16 Use this button to edit the selected quote.
  }
  if ($did == 16) {
    did -ra $dname 16 This bar will help you if you hover over any items.
  }
}
on *:dialog:quote:sclick:*: {
  if ($did == 15) &&  ($did(15).text == Recycle Options) {
    set %ysize 395
    .timer 1 2 set %ysize 315 
    dialog -x quote quote
    dialog -m quote quote
    did -ra $dname 15 Hide Recycle Options
  }
  else {
    if ($did == 15) && ($did(15).text != Recycle Options) {
      set %ysize 315
      dialog -x quote quote
      dialog -m quote quote
      did -ra $dname 15 Recycle Options 
    }
  }
  if ($did == 2) {
    var %randquote = $rand(1,$lines(quotes.txt)) 
    msg $active Random Quote: $read(quotes.txt, %randquote)
  }
  if ($did == 3) {
    dialog -md add add
  }
  if ($did == 4) { 
    if (!$did(1).sel) {
      noop $input(You did not select anything to delete.,uwo,Error!)
    }
    else {
      write -a recycle.txt $did(1).seltext
      write -dl $+ $did(1).sel quotes.txt
      did -d $dname 1 $did(1).sel
    }
  }
  if ($did == 5) {
    if (!$did(1).sel) {
      noop $input(You did not select a quote.,uwo,Error!)
    }
    else {
      msg $active Selected Quote $did(1).sel $+ : $did(1).seltext
    }
  }
  if ($did == 8) {
    if (!$did(7).text) {
      noop $input(You did not enter anything to search for.,uwo,Error!)
    }
    else {
      echo -a Searching for $did(7).text $+ ...
      echo -a $iif($read(quotes.txt,w, * $+ $did(7).text $+ *) == $null, No results found., Search Results: $read(quotes.txt,w, * $+ $did(7).text $+ *)) 
    }
  }
  if ($did == 9) {
    run recycle.txt
  }
  if ($did == 10) {
    write -c recycle.txt
  }
  if ($did == 12) {
    if (!$did(11).text) {
      noop $input(You did not enter anything to search for.,uwo,Error!)
    }  
    else {  
      echo -a Searching for $did(11).text $+ ...
      echo -a $iif($read(recycle.txt,w, * $+ $did(11).text $+ *) == $null, No results found., Search Results: $read(recycle.txt,w, * $+ $did(11).text $+ *)) 
    }
  }
  if ($did == 14) {
    if (!$did(1).sel) {
      noop $input(You did not select anything to edit.,uwo,Error!)
    }
    else {
      dialog -md edit edit
    }
  }
}
dialog add {
  title "Add a Quote"
  size -1 -1 325 55
  option pixels
  edit "", 1, 5 5 311 20, autohs
  button "Add", 2, 10 27 90 25
  button "Preview", 3, 105 27 90 25
}
on *:dialog:add:sclick:*: {
  if ($did == 2) {
    if (!$did(1).text) {
      noop $input(You did not enter anything to add.,uwo,Error!)
    }
    else {
      write -a quotes.txt $did(1).text
      did -a quote 1 $did(1).text
      did -ra quote 6 Total quotes: $did(quote,1).lines
      dialog -x $dname
    }
  }
  if ($did == 3) {
    if (!$did(1).text) {
      noop $input(You did not specify anything to be previewed.,uwo,Error!)
    }
    else {
      echo -a Quote preview: $did(1).text
    }
  }
  did -z quote 1
}
dialog edit {
  title "Edit a Quote"
  size -1 -1 325 55
  option pixels
  edit "", 1, 5 5 311 20, autohs
  button "Edit", 2, 10 27 90 25
  button "Preview", 3, 105 27 90 25
}
on *:dialog:edit:init:0: {
  did -a $dname 1 $did(quote,1).seltext
}
on *:dialog:edit:sclick:*: {
  if ($did == 3) {
    if (!$did(1).text) {
      noop $input(You did not enter anything to preview.,uwo,Error!)
    }
    else {
      echo -a Quote Preview: $did(1).text
    }
  }
  if ($did == 2) {
    if (!$did(1).text) {
      noop $input(You did not enter anything to edit.,uwo,Error!)
    }
    else {
      write -l $+ $did(quote,1).sel quotes.txt $did(1).text
      did -o quote 1 $did(quote,1).sel $did(edit,1).text
      dialog -x $dname
    }
  }
}

Comments

Sign in to comment.
PATX   -  Mar 14, 2009

sweet i love to store quotes but for a while a was reling on mirc's .log files to do it for me. this is kewl. plus they are easy to add. gets a 7.

 Respond  
Reezy   -  Mar 01, 2009

Awesome

 Respond  
Kirby   -  Nov 23, 2008

^Neptune: Easy as hell. Bet I could teach you in about 20mins.
Now I understand them! >:D

 Respond  
^Neptune   -  Oct 27, 2008

If only I can code using dialogs. :(

Easy as hell. Bet I could teach you in about 20mins.

 Respond  
Bullet_Dodger   -  Oct 27, 2008

Neptune^ Said:

although Khaled hasn't enabled colours for it yet.

You just solved a ton of problems for me ^.^

 Respond  
Kirby   -  Oct 27, 2008

Looks better than mine..except mine's on a bot and yours is just for your personal use...
If only I can code using dialogs. :(

 Respond  
^Neptune   -  Oct 25, 2008

I just heard that mIRC 6.35 has a rich edit feature, although Khaled hasn't enabled colours for it yet. When the next version out that DOES have it, I'll update this script surely.

 Respond  
Bullet_Dodger   -  Sep 26, 2008

Very Good Script [8/10]

 Respond  
Eugenio   -  Aug 31, 2008

that option would pwnz0r too tbh, altho its not that hard to do....

 Respond  
^Neptune   -  Aug 31, 2008

That's for a bot quote system. This isn't one of those.

ALTHOUGH I could add a feature where people can do that, and then you could accept/refuse submissions. :)

 Respond  
Choco   -  Aug 30, 2008

Hm I like it but Im really looking for one where people can do like !add quote (qoute) and then do like !quote 1 and qoute 1 comes out other then that I very much like it 9.5/10

 Respond  
VryStrange   -  Aug 24, 2008

I enjoyed this very much. Only issue i had was that other chatters did not like how it posts 'selected quote 1.' but that was a simple quick fix! Otherwise, awesome!

 Respond  
Jukadi   -  Aug 05, 2008

Its good if there is a timer with shuffle quote auto messaging for your channel. :)

 Respond  
Eugenio   -  May 05, 2008

no need to improve mate if bloody pwns!!!!!
If my superior brain thinks of anything I\'ll tell you.

ROFL @ EL smfh

 Respond  
^Neptune   -  May 05, 2008

thanks!
Any suggestions on how to improve?

 Respond  
SpotRedDog   -  May 02, 2008

I like this so much I have replaced the old Quote System that I have been using and I didn\'t even have to change the quote.txt file that everything was stored in Great Job, Keep Up the Good Work!!! 10/10!!!!

 Respond  
SuPeRFlY   -  May 02, 2008

i realy like this snippet. works just like it\'s supposed to. Havn\'t found anything wrong with it yet, and i doubt i will.

 Respond  
EL   -  May 02, 2008

If i get blamed for the one ima destroy you all...

 Respond  
Roxas   -  May 02, 2008

10/10, I like it, put all my quotes on it! ;)

 Respond  
Lord-Harlot   -  May 02, 2008

Its good nepfune
I like your scripts nepfune

 Respond  
Eugenio   -  May 02, 2008

lmfao who rated so low to make it 6.5 roflmfao you could have atleast given feedback.

 Respond  
^Neptune   -  May 02, 2008

Small update: you can doubleclick a quote to display it.

Who the hell rated 1/2? Please explain why.

 Respond  
Eugenio   -  May 02, 2008

Yer for some reason it works for me even without the variable, im special XD

 Respond  
^Neptune   -  May 02, 2008

Updated. If the global variable for the size isn\'t found when it opens, it\'ll set it anyways.

 Respond  
Eugenio   -  May 02, 2008

Add %y 315 to variables then reload and it works fine, 10/10 first quote system that has worked for me and this has everything.

 Respond  
^Neptune   -  May 01, 2008

I don\'t have those errors in mine.. I unloaded and got rid of the one var it set and reloaded it.. it all works o_O

criminal can you check if %y is in your variables section?

 Respond  
Jonesy44   -  May 01, 2008

lol, thats what those mouse commands you wanted to know were for eh? :D

Looks like you have some errors though lol

 Respond  
criminal   -  May 01, 2008

Eh..
I tested it on my dads comp..

* /dialog: \'quote\' invalid table, in \'size\' (line 7, script43.ini)
With /quote
* /dialog: \'quote\' invalid table, in \'size\'
With Rightclick - \"quote manager\"
 Respond  
criminal   -  May 01, 2008

Oh..My..God
Looks awesome O.o
I\'ll test it too when I\'m back home :D

 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.