Quote system ( Txt)

By Corrosive on Oct 23, 2007

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

Comments

Sign in to comment.
VinX   -  Aug 19, 2009

nice script .. ty

 Respond  
guest598594   -  Oct 24, 2007

Napa, they can\'t use it like that because I have tried to do it.
;) theres nothing wrong with it

 Respond  
napa182   -  Oct 24, 2007

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

 Respond  
Corrosive   -  Oct 24, 2007

Napa, they can\'t use it like that because I have tried to do it.

 Respond  
guest598594   -  Oct 23, 2007

and u can just do

on *:text:*:#:{
  if ($nick == <nick>) {
    if ($1 == w/e) w/e
    if ($2 == sometin) w/e
  }
  else msg $chan u aint allowed to do dis
}
 Respond  
guest598594   -  Oct 23, 2007

if u delete all quotes and then try to read one itll give an error

 Respond  
napa182   -  Oct 23, 2007

oh and like RubixCube said

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. :)

 Respond  
napa182   -  Oct 23, 2007

im just saying if Ur bot is op\'ed someone can use Ur bot to op them selvs with Ur quote script thats why it\'s a good idea to use the n switch. But what ever if you dont want to listen then you risk a channel take over with this script.

 Respond  
RubixCube   -  Oct 23, 2007

Pros:

  • It seems to work, although I have not tested this fully as of now

Cons:

  • Scripting is terrible
  • Constantly have to filter
  • Lack of error checking

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.

 Respond  
Corrosive   -  Oct 23, 2007

I don\'t feel like I need to change anything about that at this time, I might update the script soon with way more stuff.

 Respond  
napa182   -  Oct 23, 2007

oh and if you want to count the quotes you can use

$lines(Quotes.txt)

no need for Variables

 Respond  
napa182   -  Oct 23, 2007

you should make it treat the text as plane text cuz you can have it do commands. you should use the n switch so the line read in will not be evaluated and will be treated as plain text.

$read(Quotes.txt,n)

and you dont need to use the /

 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.