Welcome, Guest. Please login or register.
Did you miss your activation email?
February 08, 2012, 12:36:58 pm

Login with username, password and session length
Welcome to the lostmoment forums. If you are new, Please read trough all the announcements and also every README FIRST post on sections.
Follow the InterGlobal forum ethics (Basic rules that most forums have)
625 Posts in 87 Topics by 85 Members
Latest Member: SecurityAVZ
Search:     Advanced search
+  Lostmoment
|-+  Lostmoment Services
| |-+  Lostmoment IRC Network
| | |-+  A quote script scripted by me (made for a bot)
« previous next »
Pages: [1] Go Down Print
Author Topic: A quote script scripted by me (made for a bot)  (Read 1338 times)
Zeccoz
Rank 0/4
*
Offline Offline

Posts: 1

Lostmoment Owns


View Profile
A quote script scripted by me (made for a bot)
« on: February 23, 2006, 06:12:03 pm »

Code:
on *:TEXT:.quote*:#:{
  if !$read(quotes.txt, n, 1) { .msg $chan zQuote currently does not have any quotes. Maybe you should add some. }
  else {
    if !$2 { .msg $chan zQuote Random Quote: $read(quotes.txt, n) }
    else {
      if $2 isnum {
        if !$read(quotes.txt, n, $2) { .msg $chan zQuote number $2 does not exist! There are only $lines(quotes.txt) quotes in the database. }
        else {
          .msg $chan zQuote Number $2 $+ : $read(quotes.txt, n, $2)
        }
      }
      else {
        set %s * $+ $2- $+ *
        set %r $null
        set %i 1
        while %i <= $lines(quotes.txt) {
          if %s iswm $read(quotes.txt, n, %i) {
            %r = %r $+ $chr(32) $+ %i
          }
          inc %i
        }
        if $numtok(%r,32) == 0 { .msg $chan There are not any quotes found using those words. Try diffrent words for your search. | halt }
        set %q $gettok(%r,$rand(1,$numtok(%r,32)),32)
        .msg $chan zQuote Random quote for %s $+ : $read(quotes.txt, n, %q)
      } 
    }
  }
}
on *:TEXT:.findquote*:#:{
  set %s * $+ $2- $+ *
  set %r $null
  set %i 1
  while %i <= $lines(quotes.txt) {
    if %s iswm $read(quotes.txt, n, %i) {
      %r = %r $+ $chr(32) $+ %i
    }
    inc %i
  }
  if $numtok(%r,32) == 0 { .msg $chan There are not any quotes found using those words. Try diffrent words for your search. | halt }
  .msg $chan zQuote Quotes found for %s $+ : %r
}
on *:TEXT:.lastquote:#:{ .msg $chan zQuote Last Quote: $read(quotes.txt, n, $lines(quotes.txt)) }
on 3:TEXT:.addquote*:#:{
   .write quotes.txt $2-
   .msg $chan $nick $+ , The quote has been added!
}

on 3:TEXT:.delquote*:#:{
    .write -dl $+ $2 quotes.txt
    .msg $chan $nick $+ , The quote has been deleted!
}

More will be added sometime, commit all you like.
Logged
Da-Huntha
Janitor
Administrator
Rank 2/4
*
Offline Offline

Posts: 218


Moo Moo Machine


View Profile WWW
Re: A quote script scripted by me (made for a bot)
« Reply #1 on: February 24, 2006, 02:57:12 pm »

Looks simple, but sweet.
Logged

This signature is tasty.
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!
Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Design by 7dana.com