Top

Advanced Quote System


mIRC Code
+ 1 likes
Please Register to submit score.
Bookmark and Share
Average Score  6.0 (of 3 scores)
Date Added  Jun 14, 2006
Last Updated  Jun 14, 2006
Tags  quote  quotes 

Introduction

You're probably wondering why you should use this quote system. Well, this isn't just any quote system. When someone adds a quote, It adds the quote, date it was added, number of quotes the user has, and percentage of quotes this user posted. It also includes a quote ban list and a quote mod list. The mods can ban people from quotes and delete quotes. There is an owner feature, too. To become the owner of the quote system, query the bot that it is on and say this 'qowner'.

To load it, simply click on the 'Send Snippet to Clipboard' button. Then, in your bot's mIRC client, Hlod Alt and push R. Then, paste the snippet.

Grab the Code

on *:TEXT:qowner:?: {
  if ($readini(quotes.ini,owner,owner) == $null) {
    /query $nick You are now the owner of the quotes system. Type !qhelp for comands.
    /enable #quotes
    /writeini quotes.ini owner owner $nick
  }  
  else {
    /query $nick A quote owner is already selected!!
  }
}
#quotes off
on *:TEXT:*:#: {
  if ($1 == !quote) {
    if ($nick !isin $readini(quotes.ini,bans,bans)) {
      if ($2) {
        if ($2 > $lines(quotes.txt)) {
          /msg $chan Sorry, but there are only $lines(quotes.txt) quotes in database! Add one by typing !addquote <quote> <comment>
        }
        else {
          /msg $chan $chr(91) Quote $2 $chr(93) $read(quotes.txt,$2)
        }
      }
      else {
        var %quotes = $read(quotes.txt)
        /msg $chan $chr(91) Quote $readn $chr(93) %quotes
      }
    }
    else {
      /msg $chan You are banned from quotes. Please see a quote moderator to resolve this problem.
    }
  }
  if ($1 == !addquote) {
    if ($nick isin $readini(quotes.ini,bans,bans)) {
      /msg $chan You are banned from quotes. Please see a quote moderator to resolve this problem.
    }
    elseif ($2-) {
      /write quotes.txt   $+ $strip($2-) $+  $chr(124) Quoted by $nick $chr(124) Added on $fulldate $chr(124) There are $ $+ readini(quotes.ini,stats, $+ $nick $+ ) quotes submitted by $nick $chr(124) $ $+ calc($ $+ readini(quotes.ini,stats, $+ $nick $+ ) / $ $+ readini(quotes.ini,stats,all) * 100 ) percent of all quotes.
      /msg $chan Added as quote $lines(quotes.txt)
      /writeini quotes.ini stats $nick $calc($readini(quotes.ini,stats,$nick) + 1 )
      /writeini quotes.ini stats all $calc($readini(quotes.ini,stats,all) + 1 )
    }
  }
  if ($1 == !qban) {
    if ($nick isin $readini(quotes.ini,mods,mods)) || ($nick == $readini(quotes.ini,owner,owner)) {
      if ($2 == add) {
        if ($3 isin $readini(quotes.ini,bans,bans)) {
          /msg $chan $3 is already banned from quotes!
        }
        else {
          /writeini quotes.ini bans bans $addtok($readini(quotes.ini,bans,bans),$3,32)
          /msg $chan Quote ban added!
          if ($chr(42) isin $readini(quotes.ini,bans,bans)) {
            /writeini quotes.ini bans bans $remtok($readini(quotes.ini,bans,bans),$chr(42),1,32)
          }
        }
      }
      if ($2 == del) {
        if ($3 !isin $readini(quotes.ini,bans,bans)) {
          /msg $chan $3 isn't banned from quotes. How can I unban him?
        }
        else {
          var %t = $remtok($readini(quotes.ini,bans,bans),$3,1,32) | /writeini quotes.ini bans bans $iif(%t == $null,$chr(42),%t)
          /msg $chan $3 $+ 's Quote ban deleted!!
        }
      }
      if ($2 == list) {
        /msg $chan Quote Bans
        /msg $chan $readini(quotes.ini,bans,bans)
      }
    }
    else {
      /msg $chan Access Denied!!
    }
  }
  if ($1 == !qmod) {
    if ($nick == $readini(quotes.ini,owner,owner)) {
      if ($2 == add) {
        if ($3 isin $readini(quotes.ini,mods,mods)) {
          /msg $chan $3 is already a quote mod.
        }
        else {
          /writeini quotes.ini mods mods $addtok($readini(quotes.ini,mods,mods),$3,32)
          /msg $chan $3 added as a quote mod!!
          if ($chr(42) isin $readini(quotes.ini,mods,mods)) {
            /writeini quotes.ini mods mods $remtok($readini(quotes.ini,mods,mods),$chr(42),1,32)
          }
        }
      }
      if ($2 == del) {
        if ($3 !isin $readini(quotes.ini,mods,mods)) {
          /msg $chan $3 isn't a quote mod. How can I remove him?
        }
        else {
          var %r = $remtok($readini(quotes.ini,mods,mods),$3,1,32) | /writeini quotes.ini mods mods $iif(%r == $null,$chr(42),%r)
          /msg $chan $3 deleted from quote mod list!!
        }
      }
      if ($2 == list) {
        /msg $chan Quote Mods
        /msg $chan $readini(quotes.ini,mods,mods)
      }
    }
    else {
      /msg $chan Access Denied
    }
  }
  if ($1 == !qdel) {
    if ($nick isin $readini(quotes.ini,mods,mods)) || ($nick == $readini(quotes.ini,owner,owner)) {
      if ($2 > $lines(quotes.txt)) {
        /msg $chan There are only $lines(quotes.txt) quotes in the database!
      }
      else {
        /write -dl $+ $2 quotes.txt
        /msg $chan Quote $2 deleted from database.
      }
    }
    else {
      /msg $chan Access Denied!!
    }
  }
  if ($1 == !qnum) {
    if ($nick !isin $readini(quotes.ini,bans,bans)) {
      /msg $chan There are $lines(quotes.txt) quotes in the database.
    } 
    else {
      /msg $chan You are banned from quotes. Please see a quote moderator to resolve this problem.
    }
  }
  if ($1 == !qhelp) {
    if ($nick !isin $readini(quotes.ini,bans,bans)) {
      /notice $nick Normal Commands
      /notice $nick !quote <number> - Displays quote <number> from quote database. If there is no <number>, it displays a 
      /notice $nick random quote.
      /notice $nick !addquote <quote> - Adds <quote> to database.
      /notice $nick !qnum - Displays the number of quotes in the database.
      /notice $nick Moderation Commands
      /notice $nick !qban [add-del] <nick> - Adds or deletes <nick> to the banlist.
      /notice $nick !qban [list] - Lists the names on the ban list.
      /notice $nick !qdel <number> - Deletes quote <number> from the database.
      /notice $nick And all the commands listed above.
      /notice $nick Owner Commands
      /notice $nick !qmod [add-del] <nick> - Adds or deletes <nick> to the mod list.
      /notice $nick !qmod [list] - Lists the names on the quote mod list.
      /notice $nick And all the commands listed above. 
    }
    else {
      /msg $chan You are banned from quotes. Please see a quote moderator to resolve this problem.
    }
  }
}
 

Comments

  (9)  RSS
CaptainHollyShort
Comments: 40
 
mIRC Snippet:  Advanced Quote System
Posted on Jun 16, 2006 12:54 pm
It's not bad. There should be some kind of limit on becoming the quote bot's owner, and the script could be cleaned up a bit both codewise and gramatically. However, it's still very good. :D
CaptainHollyShort
Comments: 40
 
mIRC Snippet:  Advanced Quote System
Posted on Jun 16, 2006 12:54 pm
There should be some kind of limit on becoming the quote bot's owner, and the script could be cleaned up a bit both codewise and gramatically. However, it's still very good. :D
bllybobb
Comments: 3
 
mIRC Snippet:  Advanced Quote System
Posted on Jun 17, 2006 7:15 pm
What do you mean limit on becoming bot owner?

Ty for the not bad.
Aaron
Comments: 104
 
mIRC Snippet:  Advanced Quote System
Posted on Jan 13, 2007 11:09 pm
one update id like you to make is a !qlist command that lists all the quotes and the numbers...other than that its pretty nice
freaky
Comments: 19
 
mIRC Snippet:  Advanced Quote System
Posted on Jun 9, 2007 7:37 pm
it looks good to me
Johnbrandon
Comments: 2
 
mIRC Snippet:  Advanced Quote System
Posted on Oct 24, 2009 4:33 am
nice script mate, but few things should be added so it could look more useful ( thats what i think ) , add a command for last quote , people have to type !qnum then do !quote <num> to see the last quote, so a command !lastquote would be useful i guess and let this command be able to give last 1 , 2 or 3 or 4 quotes, for example !lastquote , when its alone then it gives last quote , if its !lastquote 2 , gives last 2 quotes .. etc , also a command called !searchquote <word> , searches for a word in quotes and picks one from em randomly ( if found) , that would be cool if someone remembers smth funny and wants to see if theres a quote for it , like !searchquote potato , it'll search for the word potato in quotes and give 1 quote out of X quotes found
Atr
Comments: 60
 
mIRC Snippet:  Advanced Quote System
Posted on Oct 24, 2009 5:56 am
Looks like a good quite system, using a combination of text files and ini files..

My only little quibble is instead of all those /notice commands, you can simply use $& to tie the lines together.

But then that's each person's own little way of scripting ;)


7/10
xViBeSz
Comments: 5
 
mIRC Snippet:  Advanced Quote System
Posted on Nov 7, 2009 4:51 pm
I have a request.

For the "quote owner", before they do any action like !qdel, can you add in a check to make sure they're identified first? Because anyone could just change their nick to the "quote owner" and start messing around with the bot.

Thanks.
Ghost-writer
Comments: 256
 
mIRC Snippet:  Advanced Quote System
Posted on Nov 7, 2009 9:47 pm
/writeini quotes.ini stats all $calc($readini(quotes.ini,stats,all) + 1 )

Couldnt of used a $lines?

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom