This isn't the best "method" of a quote system, as it uses .txt files and the mIRC built-in userlist that uses .ini files; I found that hashes prove to be much more of use.
So please check the Rehashed Quote System if you want a "better" version.
Quote System v.2
Modifications:
More flexibility
New triggers (themes/flood)
Alternative Friend/Operator/Master/Owner adding
Fixed bugs/errors
If you've tried out my other quote system and liked it, you're going to love this one even more!
Pictures:
This is an overview of basically what this script can do.
Commands:
!addquote - allows you to add new quotes to the database. Has 3 second DEFAULT flood protection.
!delquote <quote ID (the number of the quote itself)> - allows you to remove specific quotes from the database. Also has 3 second DEFAULT flood protection.
!delquote all - allows you to remove ALL added quotes, instead of manually removing them through going through the .txt file.
Note: If a quote is deleted "in the middle"; i.e. There are 3 quotes, but quote 2 is deleted, the script makes it so that the quotes "slide down" when a line is to be blank.
!quote - shows you a random quote from the database. Has 5 second DEFAULT flood protection.
!quote <quote ID (the number of the quote itself)> - allows you to see specific quotes. Also has 5 second DEFAULT flood protection.
!findquote - allows you to search through the database for related, particular quotes. Has 5 second DEFAULT flood protection.
!totalquote - shows you the total amount of quotes added to the database. Has 10 second DEFAULT flood protection.
!lastquote - shows you the last quote added to the database, along with information. Has 10 second DEFAULT flood protection.
!quote help - gives you help based on the quote system. Has 120 second DEFAULT flood protection.
!status <on/off/none> - allows you to turn the quote script on or off, and let's you see the status.
!add/del(friend/op/master/owner) - slightly modified part. Allows you to add or delete friends, operators, masters, and owners to the 'User List' of the bot.
Uniqueness in Authority:
Friend - can add/del quotes
Operator - can change themes/flood protection + all of above
Master - can add new users (friends, operators) + all of above
Owner - can add new users (masters, owners) and delete all quotes + all of above
!theme set <color code (mirc colors #0~15)> - new function! You can now set color themes for your bot. :) Use !theme set default if you want to set it back to your default text color (or no color).
!flood set <add/del/total/last/num/rand/help> <duration (in seconds)> - another new function! Instead of going through your bot's remotes and editing the portions, you can now edit them through a command.
Default flood protection are listed next to each trigger description.
Final Note:
Flood protection activated on certain triggers only affect "reg'd users".
Some triggers have certain access levels.
***Again, flood/themes can be edited through the triggers.
Credits:
Helpers: Blitzjager and DimeCadmium, for some scripting help,
;Make sure the person you are adding as a friend,operator,master, or owner is on your internal address list! Otherwise, it's a little glitchy.
on *:load: { qinstall }
on *:unload: { quinstall }
on master:text:!addfriend*:*: {
var %active $chan
guser friend $2 2
msg %active %color $+ $nick made $2 Friend on $me $+ .
notice $2 %color $+ You have been given level: Friend on bot: $me by: $nick $+ .
}
on master:text:!delfriend*:*: {
var %active $chan
ruser friend $2 2
msg %active %color $+ $nick made $2 No access on $me $+ .
notice $2 %color $+ You have been given level: No access on bot: $me by: $nick $+ .
}
on master:text:!addop*:*: {
var %active $chan
guser friend,operator $2 2
msg %active %color $+ $nick made $2 Operator on $me $+ .
notice $2 %color $+ You have been given level: Operator on bot: $me by: $nick $+ .
}
on master:text:!delop*:*: {
var %active $chan
ruser friend,operator $2 2
msg %active %color $+ $nick made $2 No access on $me $+ .
notice $2 %color $+ You have been given level: No access on bot: $me by: $nick $+ .
}
on owner:text:!addmaster*:*: {
var %active $chan
guser friend,operator,master $2 2
msg %active %color $+ $nick made $2 Master on $me $+ .
notice $2 %color $+ You have been given level: Master on bot: $me by: $nick
}
on owner:text:!delmaster*:*: {
var %active $chan
ruser friend,operator,master $2 2
msg %active %color $+ $nick made $2 No access on $me $+ .
notice $2 %color $+ You have been given level: No access on bot: $me by: $nick $+ .
}
on owner:text:!addowner*:*: {
inc %new
var %code $rand(0,9) $+ $rand(a,z) $+ $rand(0,9) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(0,9) $+ $rand(0,9) $+ $rand(0,9)
if (%new == 1) {
notice $nick %color $+ 1,8/!\ 4WARNING 1,8/!\: %color $+ This command will give COMPLETE control over $+ $me $+ to $+ $+ $2 $+ including the ability to REMOVE you as owner. If you are sure you want to do this, type: /msg $me !addowner $2 $+ %code $+
set %active $chan
timer 1 60 /unset %new
}
elseif (%new == 2) {
guser friend,operator,master,owner $2 2
notice $nick %color $+ Done. $2 is now an Owner of $me $+ .
msg %active %color $+ $nick made $2 Owner on $me $+ .
notice $2 %color $+ You have been given level: Owner on bot: $me by: $nick $+ .
unset %new
unset %active
}
}
on owner:text:!delowner*:*: {
var %active $chan
ruser friend,operator,master,owner $2 2
notice $nick %color $+ Done. $2 is no longer an Owner of $me $+ .
msg %active %color $+ $nick made $2 No Access on $me $+ .
notice $2 %color $+ You have been given level: No access on bot: $me by: $nick $+ .
}
on friend:TEXT:!addquote*:*: {
if (%quote == on) {
set %user $fulladdress
set %date $fulldate
set %chan $chan
if (!%addtest. [ $+ [ $nick ] ]) {
set -u $+ [ %flood.add ] %addtest. [ $+ [ $nick ] ] 1
;set %add yes
;if (%add == yes) {
if (%add == yes) {
if ($2 == $null) {
notice $nick %color $+ You didn't specify a quote to add. Use: $+ !addquote <quote> $+
}
else {
write quotes.txt $2-
msg $chan %color $+ Added Quote $+ $chr(35) $+ $lines(quotes.txt) $+ $+ : $- $read(quotes.txt, $lines(quotes.txt))
}
}
;}
}
}
}
on friend:TEXT:!delquote*:*: {
if (%quote == on) {
if (!%deltest. [ $+ [ $nick ] ]) {
set -u $+ [ %flood.del ] %deltest. [ $+ [ $nick ] ] 1
;set %del yes
;if (%del == yes) {
if (%del == yes) {
if ($2 isnum) {
if ($2 > $lines(quotes.txt)) {
if ($file(quotes.txt).size == 0) { msg $chan %color $+ There are no quotes. }
else { notice $nick %color $+ I couldn't find a quote with that ID, it has probably been deleted already or does not exist. }
}
if ($2 <= $lines(quotes.txt)) {
msg $chan %color $+ Deleted Quote $+ $chr(35) $+ $2 $+ $+ : $- $read(quotes.txt, $2)
write -dl $+ $2 quotes.txt
}
else { halt }
}
elseif ($2 isalpha) {
if ($address($nick,2) == %owner) {
if ($2 == all) {
if ($file(quotes.txt).size == 0) {
msg $chan %color $+ There are no quotes.
}
else {
inc %all
if (%all == 1) {
.timer 1 1 notice $nick %color $+ Are you sure you want to delete all quotes in $+ $chan $+ $+ ?
.timer 1 3 notice $nick %color $+ Use !quote del all to permanently delete all quotes.
}
elseif (%all == 2) {
msg $chan %color $+ Deleted all quotes.
write -dc quotes.txt
unset %all
}
}
}
else {
notice $nick %color $+ You didn't specify a valid quote ID. Use: !quote del <id>
}
}
else {
notice $nick %color $+ You need to have the 'Master' level (or higher) to be able to delete all quotes.
}
}
if ($2 == $null) {
notice $nick %color $+ You didn't specify a quote to delete. Use: $+ !quote del <id> $+
}
else { halt }
}
else {
notice $nick %color $+ You need to have the 'Friend' level (or higher) to be able to delete quotes.
;}
}
}
}
}
on *:text:!totalquote:*: {
if (%quote == on) {
if ($nick isreg $chan) {
if (!%totaltest. [ $+ [ $nick ] ]) {
set -u $+ [ %flood.total ] %totaltest. [ $+ [ $nick ] ] 1
;set %total yes
;if (%total == yes) {
if (%total == yes) {
msg $chan %color $+ Total Quotes Added: $- $lines(Quotes.txt)
;}
}
}
}
else {
msg $chan %color $+ Total Quotes: $- $lines(Quotes.txt)
}
}
}
on *:text:!findquote*:*: {
if (%quote == on) {
if ($nick isreg $chan) {
if (!%findtest. [ $+ [ $nick ] ]) {
set -u $+ [ %flood.find ] %findtest. [ $+ [ $nick ] ] 1
;set %find yes
;if (%find == yes) {
if (%find == yes) {
var %find $read(quotes.txt, w, * $+ $2- $+ *)
var %lineno = $readn
if ($2 == $null) { notice $nick You didn't specify text to search for. Use: !findquote <text> }
else {
if ($file(quotes.txt).size == 0) { msg $chan %color $+ There are no quotes. }
elseif ($2- !isin $read(quotes.txt, w, * $+ $3- $+ *)) { msg $chan %color $+ I didn't find any quotes on $+ $chan $+ matching $+ $2- $+ . }
else {
msg $chan %color $+ Matching Quote $+ $chr(35) $+ %lineno $+ $+ : $- %find
}
}
}
}
}
else {
var %find $read(quotes.txt, w, * $+ $2- $+ *)
var %lineno = $readn
if ($file(quotes.txt).size == 0) { msg $chan %color $+ There are no quotes. }
elseif ($2- !isin $read(quotes.txt, w, * $+ $2- $+ *)) { msg $chan %color $+ I didn't find any quotes on $+ $chan $+ matching $+ $2- $+ . }
else {
msg $chan %color $+ Matching Quote $+ $chr(35) $+ %lineno $+ $+ : $- %find
}
}
}
}
on *:text:!lastquote:*: {
if (%quote == on) {
if ($nick isreg $chan) {
if (!%lasttest. [ $+ [ $nick ] ]) {
set -u $+ [ %flood.last ] %lasttest. [ $+ [ $nick ] ] 1
;set %last yes
;if (%last == yes) {
if (%last == yes) {
.timer 1 0 msg $chan %color $+ Last Quote $- $+ $chr(35) $+ $lines(quotes.txt) $+ $+ : $- $read(quotes.txt, $lines(quotes.txt))
.timer 1 1 msg $chan %color $+ Added by $+ %user $+ on $+ %chan $+ at $+ %date $+
;}
}
}
}
else {
.timer 1 0 msg $chan %color $+ Last Quote $- $+ $chr(35) $+ $lines(quotes.txt) $+ $+ : $- $read(quotes.txt, $lines(quotes.txt))
.timer 1 1 msg $chan %color $+ Added by $+ %user $+ on $+ %chan $+ at $+ %date $+
}
}
}
on *:text:!quote*:*: {
if (%quote == on) {
if ($2 isnum) {
if ($nick isreg $chan) {
if (!%numtest. [ $+ [ $nick ] ]) {
set -u $+ [ %flood.num ] %numtest. [ $+ [ $nick ] ] 1
;set %num yes
;if (%num == yes) {
if (%num == yes) {
if ($2 > $lines(quotes.txt)) {
if ($file(quotes.txt).size == 0) { msg $chan %color $+ There are no quotes. }
else { notice $nick %color $+ I couldn't find a quote with that ID, it has probably been deleted. }
}
elseif ($2 <= $lines(quotes.txt)) {
msg $chan %color $+ Quote $+ $chr(35) $+ $2 $+ $+ : $+ $- $read(quotes.txt, $2) }
}
}
}
else {
if ($2 > $lines(quotes.txt)) {
if ($file(quotes.txt).size == 0) { msg $chan %color $+ There are no quotes. }
else { notice $nick %color $+ I couldn't find a quote with that ID, it has probably been deleted. }
}
elseif ($2 <= $lines(quotes.txt)) {
msg $chan %color $+ Quote $+ $chr(35) $+ $2 $+ $+ : $+ $- $read(quotes.txt, $2) }
}
}
if ($2 isalpha) {
if ($2 == help) {
if (!%helptest. [ $+ [ $nick ] ]) {
set -u $+ [ %flood.help ] %helptest. [ $+ [ $nick ] ] 1
;set %help yes
;if (%help == yes) {
if (%help == yes) {
.timer 1 1 notice $nick Quote help:
.timer 1 2 notice $nick 4!quote - Will show you a random quote.
.timer 1 3 notice $nick 7!quote <quote ID> - Will show you a specific quote.
.timer 1 4 notice $nick 8!addquote <quote> - Will add a new quote.
.timer 1 5 notice $nick 9!delquote <quote ID>/all - Will delete a specific quote or delete all quotes.
.timer 1 6 notice $nick 11!findquote <text> - Will search for a particular quote.
.timer 1 7 notice $nick 10!(total/last)quote - Will tell you the total amount of quote or the last quote added to the database.
.timer 1 8 notice $nick 3!status - Will tell you if quotes are on or off.
.timer 1 9 notice $nick 12!status on/off - Will turn quotes on or off.
.timer 1 10 notice $nick 6!add/del(friend/op/master/owner) - Will give/take access to/from the nicks you desire.
.timer 1 11 notice $nick 13!theme - Will show you all the color codes.
.timer 1 12 notice $nick 5!theme set <color code> - Will set a theme according to the Color Code you give it.
.timer 1 13 notice $nick 14!flood set <add/del/total/last/num/rand/help> <duration (secs)> - Will change flood settings for triggers.
;}
}
}
}
else { notice $nick %color $+ Unknown command. If you need help, please type: !quote help. }
}
if ($2 == $null) {
if ($nick isreg $chan) {
if (!%nulltest. [ $+ [ $nick ] ]) {
set -u $+ [ %flood.null ] %nulltest. [ $+ [ $nick ] ] 1
;set %null yes
;if (%null == yes) {
if (%null == yes) {
if ($file(quotes.txt).size == 0) { msg $chan %color $+ There are no quotes. }
else { var %lineno = $rand(1,$lines(quotes.txt)) | msg $chan %color $+ Random Quote $+ $chr(35) $+ %lineno $+ $+ : $- $read(quotes.txt,%lineno) }
;}
}
}
}
else {
if ($file(quotes.txt).size == 0) { msg $chan %color $+ There are no quotes. }
else { var %lineno = $rand(1,$lines(quotes.txt)) | msg $chan %color $+ Random Quote $+ $chr(35) $+ %lineno $+ $+ : $- $read(quotes.txt,%lineno) }
}
}
else { halt }
}
}
on *:text:!status*:*: {
if ($nick !isreg $chan) {
if ($2 == $null) {
if (%quote == on) {
msg $chan %color $+ Quotes are currently turned 9ON.
}
elseif (%quote == off) {
msg $chan %color $+ Quotes are currently turned 4OFF.
}
}
if ($2 == on) {
if (%quote == on) {
notice $nick %color $+ Quotes are already turned 9ON.
}
elseif (%quote == off) {
set %quote on
msg $chan %color $+ Quotes are now turned 9ON.
}
}
if ($2 == off) {
if (%quote == off) {
notice $nick %color $+ Quotes are already turned 4OFF.
}
elseif (%quote == on) {
set %quote off
msg $chan %color $+ Quotes are now turned 4OFF.
}
}
}
elseif ($nick isreg $chan) {
if ($2 == $null) {
if (%quote == on) {
msg $chan %color $+ Quotes are currently turned 9ON.
}
elseif (%quote == off) {
msg $chan %color $+ Quotes are currently turned 4OFF.
}
}
elseif ($2 == on || $2 == off) {
notice $nick %color $+ You need to have be 'voiced' (or higher) to be able to turn on/off quotes.
}
}
}
on operator:text:!theme*:*: {
if ($2 isnum) {
notice $nick %color $+ To change themes, type: !theme set color code.
notice $nick %color $+ Color Codes: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 Default
}
if ($2 isalpha) {
if ($2 == set) {
if ($3 == $null) {
notice $nick %color $+ To set a theme, type: !theme set color code.
notice $nick %color $+ Color Codes: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 Default
}
if ($3 isalpha) {
if ($3 == default) {
if (%colorcode == default) {
.timer 1 0 notice $nick %color $+ Theme $+ %colorcode $+ is already set.
.timer 1 1 notice $nick %color $+ Color Codes: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 Default
}
else {
unset %color
set %colorcode Default
notice $nick %color $+ Done. Theme set to Default.
msg $chan %color $+ Quote theme is now set to Default.
}
}
else {
.timer 1 1 notice $nick %color $+ Theme $+ $chr(35) $+ $3 $+ $+ : Invalid Color Code.
.timer 1 1 notice $nick %color $+ Color Codes: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 Default
}
}
if ($3 isnum) {
if ($3 > 15 || $3 < 0) {
.timer 1 1 notice $nick %color $+ Theme $+ $chr(35) $+ $3 $+ $+ : Invalid Color Code.
.timer 1 1 notice $nick %color $+ Color Codes: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 Default
}
elseif ($3 == %colorcode) {
.timer 1 0 notice $nick %color $+ Theme $+ $chr(35) $+ %colorcode $+ is already set.
.timer 1 1 notice $nick %color $+ Color Codes: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 Default
}
else {
set %color $+ $3
set %colorcode $3
notice $nick %color $+ Done. Theme set to Color Code $+ $chr(35) $+ %colorcode $+ .
msg $chan %color $+ Quote theme is now set to Color Code $+ $chr(35) $+ %colorcode $+ .
}
}
}
else {
notice $nick %color $+ To change themes, type: !theme set color code.
notice $nick %color $+ Color Codes: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 Default
}
}
elseif ($2 == $null) {
notice $nick %color $+ Current theme: Color Code $+ $chr(35) $+ %colorcode $+ .
notice $nick %color $+ To change themes, type: !theme set color code.
notice $nick %color $+ Color Codes: 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 Default
}
else { halt }
}
on operator:text:!flood*:*: {
if ($2 == $null) {
.timer 1 1 notice $nick %color $+ To change flood protection for triggers, type: !flood set <trigger-type> <duration (secs)>.
.timer 1 2 notice $nick %color $+ Trigger types: add/del/total/last/num/rand/help
}
if ($2 == set) {
if ($3 isalpha) {
if ($3 == add) {
if ($4 == 0) {
set %flood.add $4
notice $nick %color $+ Done. Flood protection for adding quotes: None.
}
else {
set %flood.add $4
notice $nick %color $+ Done. Flood protection for adding quotes: $+ $4 seconds.
}
}
if ($3 == del) {
if ($4 == 0) {
set %flood.del $4
notice $nick %color $+ Done. Flood protection for deleting quotes: None.
}
else {
set %flood.del $4
notice $nick %color $+ Done. Flood protection for deleting quotes: $+ $4 seconds.
}
}
if ($3 == total) {
if ($4 == 0) {
set %flood.total $4
notice $nick %color $+ Done. Flood protection for viewing total quotes added: None.
}
else {
set %flood.total $4
notice $nick %color $+ Done. Flood protection for viewing total quotes added: $+ $4 seconds.
}
}
if ($3 == last) {
if ($4 == 0) {
set %flood.last $4
notice $nick %color $+ Done. Flood protection for viewing last quote added: None.
}
else {
set %flood.last $4
notice $nick %color $+ Done. Flood protection for viewing last quote added: $+ $4 seconds.
}
}
if ($3 == num) {
if ($4 == 0) {
set %flood.num $4
notice $nick %color $+ Done. Flood protection for viewing specific quotes: None.
}
else {
set %flood.num $4
notice $nick %color $+ Done. Flood protection for viewing specific quotes: $+ $4 seconds.
}
}
if ($3 == rand) {
if ($4 == 0) {
set %flood.null $4
notice $nick %color $+ Done. Flood protection for viewing random quotes: None.
}
else {
set %flood.null $4
notice $nick %color $+ Done. Flood protection for viewing random quotes: $+ $4 seconds.
}
}
if ($3 == help) {
if ($4 == 0) {
set %flood.help $4
notice $nick %color $+ Done. Flood protection for viewing quote help: None.
}
else {
set %flood.help $4
notice $nick %color $+ Done. Flood protection for viewing quote help: $+ $4 seconds.
}
}
}
elseif ($3 isnum) {
.timer 1 1 notice $nick %color $+ To change flood protection for triggers, type: !flood set <trigger-type> <duration (secs)>.
.timer 1 2 notice $nick %color $+ Trigger types: add/del/total/last/num/rand/help
}
}
else {
.timer 1 1 notice $nick %color $+ To change flood protection for triggers, type: !flood set <trigger-type> <duration (secs)>.
.timer 1 2 notice $nick %color $+ Trigger types: add/del/total/last/num/rand/help
}
}
alias qinstall {
set %quote on
set %add yes
set %del yes
set %num yes
set %find yes
set %total yes
set %last yes
set %help yes
set %null yes
set %status yes
set %colorcode Default
set %flood.add 3
set %flood.del 3
set %flood.total 10
set %flood.last 10
set %flood.num 5
set %flood.null 5
set %flood.help 120
}
alias quninstall {
unset %quote %add %del %num %find %total %last %help %null %status %owner %chan %color %colorcode %flood.add %flood.del %flood.total %flood.last %flood.num %flood.null %flood.help
ruser %owner
}
alias quotehelp {
echo -a Quote help:
echo -a 4!quote - Will show you a random quote.
echo -a 7!quote <quote ID> - Will show you a specific quote.
echo -a 8!addquote <quote> - Will add a new quote.
echo -a 9!delquote <quote ID>/all - Will delete a specific quote or delete all quotes.
echo -a 11!findquote <text> - Will search for a particular quote.
echo -a 10!(total/last)quote - Will tell you the total amount of quote or the last quote added to the database.
echo -a 3!status - Will tell you if quotes are on or off.
echo -a 12!status on/off - Will turn quotes on or off.
echo -a 6!add/del(friend/op/master/owner) - Will give/take access to/from the nicks you desire.
echo -a 13!theme - Will show you all the color codes.
echo -a 5!theme set <color code> - Will set a theme according to the Color Code you give it.
echo -a 14!flood set <add/del/total/last/num/rand/help> <duration (secs)> - Will change flood settings for triggers.
}
alias owner {
set %owner $address($1,2) | guser friend,operator,master,owner $1 2
}
I actually wanted to delete this snippet, but I guess since people still use this, I think I will probably make it better, but only with the use with .txt files and the mIRC built-in userlist. :\
And specifically, Xpl0reR, do you mean disable colors all together? I was thinking if the channel has mode +c in it, it'll strip it.
Here's the link to the quote system that uses hashes instead of .txt's.
a careful warchild
kirby,
immence script, but if you add colour $stripping then ill give 10/10 atm its 7/10
Kirby's response:
Ooh, forgot about that. I'll go work on it later.
Bullet_Dodger
Jordy, Just type /ignore -k !@*
no need to $strip -.-
My response:
Wouldn't that strip the quotes as well?
napa182
you should really do away with the txt file and go hash on this.
My/Kirby's Response:
HASH TABLES? :(
We're not familiar with those, but we'll try.