Advanced Quote System

By bllybobb on Jun 14, 2006

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.

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

Sign in to comment.
Jinn   -  Oct 18, 2013

On here

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

How do I set it to owner/mod only can add? I'm receiving errors from my if ($nick isin $readini(quotes.ini,owner,owner)) ..
Please do help me, thanks in advance.

dronez4  -  Oct 19, 2013

in your quotes.ini it should look like this

[owner]
dronez4=is a owner
dronez44=is a bigger owner
dronez444=biggest owner

And your code to check if that person is a owner

if ($readini(quotes.ini,owner,$nick)) {

Basically it looks for the nick before the = and asks the file if its in there, if it is then it carries on with the action.

Sign in to comment

Ghost-writer   -  Nov 07, 2009

/writeini quotes.ini stats all $calc($readini(quotes.ini,stats,all) + 1 )

Couldnt of used a $lines?

 Respond  
xViBeSz   -  Nov 07, 2009

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.

 Respond  
Atr   -  Oct 24, 2009

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

 Respond  
Johnbrandon   -  Oct 24, 2009

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

 Respond  
freaky   -  Jun 09, 2007

it looks good to me

 Respond  
Aaron   -  Jan 13, 2007

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

 Respond  
bllybobb   -  Jun 17, 2006

What do you mean limit on becoming bot owner?

Ty for the not bad.

 Respond  
CaptainHollyShort   -  Jun 16, 2006

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

 Respond  
CaptainHollyShort   -  Jun 16, 2006

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

 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.