QuoteScript Dialog V4.0

By Naemuti on May 22, 2006

A quotes dialog that has Add/Delete, Selected and Random quote saying.

If you have any questions at all or improvements to the script, post them here or contact me on irc.scrollrack.com (I'm CaptainHollyShort/Pieman!).

EDIT: Yes, 4.0 is a big upgrade but I've redone this dialog A LOT. I guarantee you this is a MUCH better script now than it was before.

################
#Quotes Dialogs#
################
alias quotes {
  if ($dialog(quotes)) { dialog -v quotes }
  else { dialog -dm quotes quotes }
}

alias f3 {
  loadbuf -ro quotes 4 quotes.txt
}

dialog -l quotes {
  title "Quotes Manager"
  size -1 -1 183 164
  option dbu
  icon C:\Windows\system32\shell32.dll, 172
  button "Close", 1, 2 151 39 12, default ok
  edit "Click on a quote to see it here.", 2, 43 102 137 60, read multi autovs vsbar
  box "Quote List", 3, 1 2 180 97
  list 4, 3 10 176 88,size vsbar
  button "Add Quote", 5, 2 101 39 10
  button "Delete Quote", 6, 2 111 39 10
  button "Say Quote", 7, 2 121 39 10
  button "Random Quote", 8, 2 141 39 10
  button "Amsg Quote", 9, 2 131 39 10
}

########
#Events#
########
On *:dialog:*:*:*:{
  if ($dname == quotes) {
    if ($devent == init) {
      if ($did == 0) {
        if ($isfile(quotes.txt) == $false) { write quotes.txt }
        loadbuf -ro $dname 4 quotes.txt
        did -ra $dname 3 Quotes List - $lines(quotes.txt) quotes.
      }
    }
    if ($devent == sclick) {
      if ($did == 4) {
        did -ra $dname 2 $did(4).seltext
      }
      if ($did == 5) {
        var %aquote $strip($$?="Quote to add?")
        if ($read(quotes.txt,s,%aquote)) {
          echo -a 4Q14uote already exists.
          dialog -v $dname
          .return
        }
        else {
          write quotes.txt %aquote
          echo -a 4Q14uote " $+ %aquote $+ " added to quotes list.
          loadbuf -ro $dname 4 quotes.txt
          did -ra $dname 3 Quotes List - $lines(quotes.txt) quotes.txt
          dialog -v $dname
        }
      }
      elseif ($did == 6) {
        write -dl $+ $did(4).sel quotes.txt 
        echo -a 4Q14uote removed from quotes list.
        loadbuf -ro $dname 4 quotes.txt
        did -ra $dname 3 Quotes List - $lines(quotes.txt) quotes.txt
        dialog -v $dname
      }
      elseif ($did == 7) {
        if ($did(4).sel < 1) {
          echo -a 4N14o quote selected.
          .return
        }
        else {
          msg $active 4S14elected 4Q14uote 04 $+ $did(quotes,4).sel 14- $did(quotes,4).seltext
        }
      }
      elseif ($did == 8) {
        if ($lines(quotes.txt) < 1) {
          echo -a 4N14o quotes in quotes list.
          .return
        }
        else {
          msg $active 4R14andom 4Q14uote 14- $read(quotes.txt)
        }
      }
      elseif ($did == 9) {
        if ($did(4).sel < 1) {
          echo -a 4N14o quote selected.
          .return
        }
        else {
          amsg 4S14elected 4Q14uote 04 $+ $did(quotes,4).sel 14- $did(quotes,4).seltext
        }
      }
    }
  }
}
########
#Popups#
########
menu channel,status,nicklist,menubar,query {
  .Quotes Dialog:quotes
}

Comments

Sign in to comment.
Clueless   -  Oct 20, 2007

i think he means that # is for Groups and ; is for commenting

 Respond  
Naemuti   -  Feb 07, 2007

Eh? I don\'t understand what you mean?

 Respond  
Lindrian   -  Jan 10, 2007

On text in the snippet, try to have ; infront of the text.

 Respond  
Naemuti   -  May 26, 2006

I\'ve updated the code now.

 Respond  
Naemuti   -  May 24, 2006

I\'m working on updating the script so it works better...I\'ve almost finished it. I\'ve updated this alot since I posted it, but everything worked for me. I can\'t understand why it was giving you those errors.

 Respond  
`Kazuma   -  May 23, 2006

Ok, nevermind. i got it working. the ON LOAD command didnt work so i could write the file name. :) n/j
id go back to change the score though. id give it a 6. :)

 Respond  
`Kazuma   -  May 23, 2006

Cant add quote.

  • /write: unable to open \'C:\Documents and Settings\Ruh roh\Desktop\mIRC\[06:09:14]\' (line 64, script.ini)
 Respond  
`Kazuma   -  May 23, 2006

Ok, I deleted the first one I got and renewed with this one, Now I get this.

  • /loadbuf: insufficient parameters (line 49, script.ini)
 Respond  
`Kazuma   -  May 23, 2006

59 Bracket errors. Doesn\'t work. I got the following errors:

  • /dialog: invalid parameters
  • /loadbuf: insufficient parameters (line 50, script.ini)
  • I can\'t open up the \"Add\" thing to add a quote. >=/

 Respond  
Naemuti   -  May 22, 2006

I noticed. XD

 Respond  
CaRe_Taker   -  May 22, 2006

lol
Double up on snippets >.<

 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.