Ok so apparently this snippet belongs to someone else my buddy just copied it and changed some text. This snippet actually belongs to fluppy however i will leave it up for all to use. thank you.
dialog Quotes {
title "Quotes"
size -1 -1 203 157
option dbu
list 1, 0 29 203 85, size vsbar
button "Add Quote", 2, 2 16 37 12
button "Delete Quote", 3, 40 16 37 12
button "Random Quote", 4, 78 16 39 12
button "Selected Quote", 5, 118 16 41 12
button "Refresh Quotes", 6, 160 16 42 12
text "Quote database made by Tanaka (<3).", 7, 2 1 199 13
edit "", 8, 38 115 162 12
button "Search", 9, 0 115 37 12
edit "", 10, 135 2 67 10, read
button "Close", 11, 166 143 37 12, cancel
check "Active channel.", 12, 2 143 158 10
edit "", 13, 31 129 169 10
text "Channel", 14, 2 130 25 8
}
on *:Dialog:quotes:init:0: {
did -r quotes 1
if ($isfile(quote.txt)) {
loadbuf -o quotes 1 quote.txt
did -ra quotes 10 Total Quotes: $lines(quote.txt)
}
}
on *:Dialog:quotes:sclick:2: {
write quote.txt $?="Quote to add"
did -r quotes 1
loadbuf -o quotes 1 quote.txt
did -ra quotes 10 Total Quotes: $lines(quote.txt)
}
on *:Dialog:quotes:sclick:3: {
write -dl $+ $did(1).sel quote.txt
did -r quotes 1
loadbuf -o quotes 1 quote.txt
did -ra quotes 10 Total Quotes: $lines(quote.txt)
}
on *:Dialog:quotes:sclick:4: {
var %ranquote = $rand(1,$lines(quote.txt))
$iif($did(12).state == 1,msg $active,msg $did(13)) Random quote number:4 %ranquote : $read(quote.txt, %ranquote)
}
on *:Dialog:quotes:sclick:5: {
$iif($did(12).state = 1,msg $active,msg $did(13)) Selected quote number:4 $did(1).sel : $read(quote.txt, $did(1).sel)
}
on *:Dialog:quotes:sclick:6: {
did -r quotes 1
loadbuf -o quotes 1 quote.txt
did -ra quotes 10 Total Quotes: $lines(quote.txt)
}
on *:Dialog:quotes:sclick:9: {
$iif($did(12).state = 1,msg $active,msg $did(13)) Searched quotes for: 4 $+ $did(8) $+ : $iif($read(quote.txt,w, * $+ $did(8) $+ *) == $null, No Results Found, $read(quote.txt,w, * $+ $did(8) $+ *))
}
alias quotes dialog -m quotes quotes
menu channel,menubar {
..Quotes:quotes
}
on *:TEXT:!quote*:#australia:{
if ($2 == $null) {
var %ranquote = $rand(1,$lines(quote.txt))
msg $chan Random quote number: 4 %ranquote : $read(quote.txt, %ranquote)
halt
}
if ($2 isnum) {
if ($read(quote.txt, $2)) {
msg $chan Selected quote number:4 $2 : $read(quote.txt, $2)
halt
}
else {
msg $chan Quote number 4 $2 does not exist. Please enter a lower number.
halt
}
}
if ($2 != $null) {
if ($read(quote.txt, w, * $+ $2- $+ *)) {
msg $chan Searched quotes for: 4 $+ $2 $+ : $read(quote.txt, w, * $+ $2- $+ *)
halt
}
else {
msg $chan Searched quotes for: 4 $+ $2 $+ : No results found.
halt
}
}
}
was not aware that the snippet was already posted. like i said in the description a friend asked me to post it so i'm sorry i told him i would was not aware that it belonged to someone he told me he wrote it and to post it. obviously this is not the case so i will leave this snippet up and just give credit to its origional owner thank you for bringing this to my attention.
One should give notice that the dialog was gotten from here http://www.hawkee.com/snippet/1784/