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
}
}
}