fluppys Quote dialog

By fluppy on Mar 07, 2006

Right click in a channel, go to quotes, then quotes again :S Then you can add quotes or delete them.
Refreshing quotes is if you manually add them to the .txt file.
Click Random Quote or Selected quote to message a quote. (selected quote will message the one selected in the big list).
Tick "Active Channel" to message to the active channel, or type a channel into the channel box to message it to that.
Clicking the search button will search for what you've typed in the box, and it'll message the result. And obviously, "close" closes the dialog.

And thanks to sladekraven for some help. :D

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 fluppy (flupScript).", 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) $+ *)) 
}
menu channel,menubar { 
  .Quotes
  ..Quotes:dialog -m quotes quotes
}

Comments

Sign in to comment.
err2   -  May 15, 2006

WEe again flup

 Respond  
fluppy   -  Mar 08, 2006

I didn\'t copy bees script, if that\'s what you\'re saying, Ace99.
Raid, I knew that, silly. :P

 Respond  
Ace99   -  Mar 08, 2006

Hmm.. Reminds me a lot of Bee\'s quoter. The one I posted here a while ago. It has the same features, at least most of the same features. :\

 Respond  
fluppy   -  Mar 08, 2006

Lol @ Dark_Paladin_Master
Thanks for your help, sladekraven. ;) I\'ll edit it once I get the time to be bothered. :S
And who told you my real name Raid!??! :o

 Respond  
Raid   -  Mar 08, 2006

Looks good Cow

 Respond  
Dark_paladin_master   -  Mar 08, 2006

this is like, the king of quote scripts, it sits on its mighty throne, and forces the rest to be its slave, forget crappy quote scripts that totally mess you up (i have had many) just get this one, cause lets face it, at least you wont regret it when this takes over the world ;)

 Respond  
sladekraven   -  Mar 07, 2006

This is a good snippet, it\'s easy and efficient. However, when the dialog starts (init) you\'ll notice a loadbuf error in status. This wont account for everyone as some people will probably have a quote.txt file. Other than that there was some lines where you repeated yourself checking to if the box is checked. All it needed was a simple $iif(). :)

Your:

did -r quotes 10
did -a quotes 10 Total Quotes: $lines(quote.txt)

Can be used as:

did -ra quotes 10 Total Quotes: $lines(quote.txt)


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 fluppy (flupScript).\", 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 target.\", 12, 2 143 158 10
edit \"\", 13, 31 129 169 10
text \"Target\", 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),))),$read(quote.txt,w,$+(,$did(8),*)),No results found)
}
menu channel,menubar {
.Quotes
..Quotes:dialog -m quotes quotes
}


Here\'s some slight midifications.

 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.