This is my Quote system using Txt's and Variables
-------- Commands --------
!AddQuote - Add's a quote to the system
!Quotes - Tells you how many quotes are on the bot
!Quote - Tells you the Quote
!RandomQuote - Tells you a random Quote
!DeleteAllQuotes - Deletes all the quotes
!DeleteQuote - Deletes that Quote
Have fun and Enjoy, please tell me any problems or spelling mistakes in my script
~Corrosive~
on *:TEXT:!AddQuote *:#: {
/write Quotes.txt $2-
notice $nick You have added $2- in the Quote list.
}
on *:TEXT:!Quotes*:#: {
notice $nick There are currently %quotes Quote(s) in my system
}
on *:TEXT:!Quote *:#: {
if ( $read(Quotes.txt, $2 ) == $null ) {
notice $nick Sorry $nick but there is no such quote. | halt
}
if ( $read(Quotes.txt, $2 ) != $null ) {
notice $nick Quote $2 is: $read(Quotes.txt, $2 ) | halt
}
}
on *:TEXT:!RandomQuote*:#: {
notice $nick Random Quote: $read(Quotes.txt)
}
on *:TEXT:!DeleteAllQuotes*:#: {
if ( $nick == <nick> ) {
set %quotes 0
/remove -b Quotes.txt
notice $nick The Quotes have been cleared
}
else {
notice $nick Sorry $nick but you cannot use this command
}
}
on *:TEXT:!DeleteQuote*:#: {
if ( $nick == <nick> ) {
/write -dl [ $+ [ $2 ] ] Quotes.txt
notice $nick Quote $2 has been removed
/dec %quotes 1
}
else {
notice $nick You cannot delete quotes
}
}
Im still saying to use the n switch, and like mountaindew said when you delete all quotes it gives an error after you !addquote, and then try to use !quote 1.. Cuz you have it( set %quotes 0 ) on !DeleteAllQuotes, but you dont have it( inc %quotes ) when you !addquote. Thats why you should just use $lines(Quotes.txt) to keep count of the quotes. We are just trying to help...
Pros:
Cons:
Quite a bit. No need of halts, for the == $null simple use a !$read(etc), (as said before) just use $lines(quotes.txt) because it\'s useless to have a variable, remove /\'s, provide things such as if ($2) to error check, also: for things such as != $null you don\'t need those just use the actual identifier or if statement.
Also, you should, as a script writer, accept comments of others and fix mistakes. If you \'don\'t feel like editing\' the snippet, don\'t expect a high score. :)
I would take a look @ the other ones on here and learn a little from them. For example, napa182\'s quote system. That\'s efficient and it has a lot of variety. I\'m not saying deliberately take things out of snippets but just take a look on how others approached it. Maybe you\'ll find many more ideas.