Quotes Script

By Del_Felesif on Jan 14, 2006

Well, it's just a script you put in your bot.
Commands:

!addquote (quote): add a quote
!quote (number): shows the quote number
!rquote: random quote
!dquote (number): deletes a quote (only if you're opped on that channel)
!quotes: tells you the number of quotes you have.

Yeah. . .it's pretty self-explanatory.

on *:TEXT:!addquote *:#: {
  set %quotes.number $calc(%quotes.number + 1)
  write quotes2.txt $2-
  msg $chan Thank you, your quote " $+ $2- $+ " has been added as quote number  $+ %quotes.number $+ 
}
on *:TEXT:!quote*:#: {
  if ( $1 == !quotes ) { 
    :quoteswiths
    msg $chan There are currently  $+ %quotes.number $+  quotes.
    halt
  }
  if ( $2 == $null ) {
    msg $chan Pick one, hoe!
  }
  else {
    set %quoting $read(quotes2.txt,$2)
    if ( %quoting == $null ) {
      msg $chan That's NOT a quote number!
    }
    else {
      msg $chan Quote  $+ $2 $+  out of  $+ %quotes.number $+ 
      msg $chan $read(quotes2.txt,$2)
    }
  }
}
on *:TEXT:!rquote:#: {
  if ( %quotes.number != 0 ) {
    set %rquote $rand(1,%quotes.number)
    msg $chan Quote  $+ %rquote $+  out of  $+ %quotes.number $+ 
    msg $chan $read(quotes2.txt,%rquote)
  }
  else {
    msg $chan There are no quotes.
  }
}
on *:TEXT:!dquote *:#: {
  if ( $nick !isop $chan ) {
    msg $chan Ha, ha! You're not opped in  $+ $chan $+  so you can't use this, fatass!
    halt
  }
  set %quoting $read(quotes2.txt,$2)
  if ( %quoting == $null ) {
    msg $chan That's NOT a quote number!
  }
  else {
    if ( $nick isop $chan ) {
      set %quotes.number $calc(%quotes.number - 1)
      write -dl [ $+ [ $2 ] ] quotes2.txt
      msg $chan Quote  $+ $2 $+  has been deleted!
    }
  }
}
on *:TEXT:!quotes:#: {
  msg $chan There are currently  $+ %quotes.number $+  quotes.
}
on *:LOAD: {
  set %quotes.number $lines(quotes2.txt)
}

Comments

Sign in to comment.
EagleAmerican   -  Sep 26, 2006

Why use a variable for how many quotes there are?
Just use $lines(quotes2.txt)

 Respond  
Im-No-Good   -  Jan 15, 2006

Could you make it so it would display the posts randomly every hour. And so that it could be enabled an disabled with !PostsOn Or !PostsOff.
Ive been lookin for a quotes script but i cant find one like that :(

 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.