Bot Quote Script

By Zsadist on Feb 02, 2011

Alright, so I decided to post this from my bot and because of how I have my !* structured I didn't feel like editing it just for ! to be more convenient.

Simply load it into your remotes and the commands are:

Random:
!quote

Add:

!quote add
Example:
[12][18][48pm] <~Tetsue> !quote add testing 1 2 3
[12][18][49pm] Unfa: [Quote Added] 101: testing 1 2 3

Del:

!quote del
Example:
[12][20][00pm] <~Tetsue> !quote del 101
[12][20][01pm] Unfa: [Quote Deleted] 101: testing 1 2 3

Specific quote:

!quote
Example:
[12][21][49pm] <~Tetsue> !quote 45
[12][21][50pm] Unfa: [Quote 45/100] 22:55| (poseidon) whoa what - 22:55| (poseidon) the conversation was about sex? - 22:55| (poseidon) I thought it was about vegetables

Find Strings

!quote find
Example:
[12][22][35pm] <~Tetsue> !quote find Tetsue
[12][22][36pm] Unfa: [Quote Search] Found 32 quotes that have the string "Tetsue" in them.
[12][22][39pm] Unfa: [Quote 99/100] <~Tetsue> durzo <~Tetsue> I am absolutely so gay for you that I would rather make myself hurt so much that I would stick my penis into a female leprechaun just so I know what it feels like to be emotionally pulled from you because i just can't have you.
[12][22][39pm] Unfa: [Quote Search] Other quote numbers: 97 95 93 91 90 89 88 87 85 68 63 62 60 58 37 33 31 29 24 20 16 15 13 11 10 8 7 6 5 4 2

And that's basically the just of it, I'm open to help on options here for some improvements and I'm open to critizism.

also, just remember I took this from my own bot and got too lazy to edit the command, lol.

thanks ^_^

on *:TEXT:!*:#: {
  if ($right($1,-1) == quote) {
    if (!$2) { msg # [Random Quote] $read(quotes.txt,n) }
    elseif ($2 == add) && ($3) { .write quotes.txt $replace($3-,|,$chr(124)) | msg # [Quote Added] $+($lines(quotes.txt),:) $3- } 
    elseif ($2 == del) && ($3 isnum) && ($lines(quotes.txt) >= $3) && ($nick isop #) { msg # [Quote Deleted] $3 $+ : $read(quotes.txt, $+ $3) | .write -dl $+ $3 quotes.txt }
    elseif ($2 isnum) && ($lines(quotes.txt) >= $2) { msg # [Quote $+($2,/,$lines(quotes.txt),]) $read(quotes.txt,n,$2) }   
    elseif ($2 == find) && ($len($3) > 2) {
      var %x $lines(quotes.txt)
      while (%x) {
        if ($3- isin $read(quotes.txt,%x)) {
          inc %quotes.search
          set %quotes.return $addtok(%quotes.return,%x,32)
        }
        dec %x
      }
      if (!%quotes.search) { msg # [Quote Search] No quotes found with the string " $+ $3- $+ " | unset %quotes.* | halt }
      if (%quotes.search = 1) { msg # [Quote Search] One quote found: $+([,%quotes.return,]) $read(quotes.txt,n,%quotes.return) | unset %quotes.* }
      else {
        msg # [Quote Search] Found %quotes.search quotes that have the string $+(",$3-,") in them.
        .timer 1 2 msg # [Quote $+($gettok(%quotes.return,1,32),/,$lines(quotes.txt),])  $replace($read(quotes.txt, n, $gettok(%quotes.return,1,32)),|,$!chr(124))   
        .timer 1 4 msg # [Quote Search] Other quote numbers: $right(%quotes.return,-2)
        unset %quotes.*
      }
    }
  }
}

Comments

Sign in to comment.
dankseal   -  May 19, 2017

When selecting !quote and it displays a random quote is there a way for it to show the quote number aswell?

 Respond  
nexuxirc   -  Oct 19, 2015

But instead of
!quote add mytext
It can not be just
!quote mytext

Is that possible?

 Respond  
Zsadist   -  May 13, 2011

Thanks. I really appreciate it.

 Respond  
SimplySys   -  May 13, 2011

Looks nice. Whoever wrote the majority of this is some kind of genius.

 Respond  
Jethro   -  Feb 04, 2011

If you are gonna do it that way to individualize the text event by inserting an exclamation mark, you could still do it like so:

on *:TEXT:!*:#: {
  if ($1 == !quote) {

without using the $right(). I'd recommend you add a

tokenize 32 $strip($1-)

under the text event so the control codes get stripped out, as well as a basic trigger flood control.

 Respond  
Zsadist   -  Feb 04, 2011

Why would that be better when it's a ! command? O.o

 Respond  
aldy505   -  Feb 04, 2011

better on $:TEXT:/^[!@.]/Si:#:{
:D nice job!

 Respond  
LadySorien   -  Feb 03, 2011

Nice job

 Respond  
Phil_FW   -  Feb 03, 2011

I like it. It looks pretty 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.