This Script is for use in an mIRC based bot...
;=============================================================================================
;
; A quote Database script for an mIRC based BOT.
;
; Author: One of the Ops on DALnet mIRC.
;
; Notes: this will create a file called quotes.txt with the data from the add function.
;
; it will currently support the following formats...
; To search: .quote search keyword
; to show total quotes: .quote total
; To display random quote: .quote
; To display unique quote : .quote nn (nn = number for quote)
; For more information on search options see: http://www.mirc.org/quotesys.html;
;
; Note well: currently the control character can be . or ! or @ ie. !quote .quote @quote (see on text line)
; ALSO note the characters block character seen in the listing that follows is the ctl+k combination.
;=============================================================================================
on $*:text:/^[!@.]quotes?(add)?/i:#mirc: {
var %qdb = quotes.txt , %readn = 1 , %match
if ($regml(1)) && ($nick isop # || $nick isvo #) {
write -a $qt(%qdb) $2-
msg # Added quote07 $2- 14to the database at line number07 $lines(%qdb) $+ 14.
}
else {
if (!$2) { msg # Random Quote ( $+ $readn $+ ): [ $read(%qdb,n) ] }
elseif ($2 isnum && $read(%qdb,n,$2)) { msg # Selected Quote ( $+ $+(,$2,/,$lines(%qdb)) $+ ): $v1 }
elseif ($2 == last && $lines(%qdb)) { msg # 14L07ast 14Q07uote14(07# $+ $v1 $+ 14)00: $read(%qdb,n,$v1) }
elseif ($2 == total) { msg # 14Total number of quotes:07 $lines(%qdb) }
elseif ($regex(wcore,$2,/^(wc|re)?search$/i)) {
msg # Searching through quote database for07 $3- $+ 14...
while ($read(%qdb,$iif($regml(wcore,1) = re,r,w),$iif($regml(wcore,1),$3-,$+(*,$3-,*)),%readn)) var %match = $addtok(%match,$readn,32) , %readn = $readn + 1
if (%match) { msg # Found quotes matching07 $3- $+ 14:07 %match }
else { msg # No quotes found matching07 $3- $+ 14. }
}
else { msg # Error in syntax or insufficient access to use method. Quote operation aborted. }
}
;=============================================================================================
;
; A quote Database script for an mIRC based BOT.
;
; Author: One of the Ops on DALnet mIRC.
;
; Notes: this will create a file called quotes.txt with the data from the add function.
;
; it will currently support the following formats...
; To search: .quote search keyword
; to show total quotes: .quote total
; To display random quote: .quote
; To display unique quote : .quote nn (nn = number for quote)
; For more information on search options see: http://www.mirc.org/quotesys.html;
;
; Note well: currently the control character can be . or ! or @ ie. !quote .quote @quote (see on text line)
; ALSO note the characters block character seen in the listing that follows is the ctl+k combination.
;=============================================================================================
on $*:text:/^[!@.]quotes?(add)?/i:#mirc: {
var %qdb = quotes.txt , %readn = 1 , %match
if ($regml(1)) && ($nick isop # || $nick isvo #) {
write -a $qt(%qdb) $2-
msg # Added quote07 $2- 14to the database at line number07 $lines(%qdb) $+ 14.
}
else {
if (!$2) { msg # Random Quote ( $+ $readn $+ ): [ $read(%qdb,n) ] }
elseif ($2 isnum && $read(%qdb,n,$2)) { msg # Selected Quote ( $+ $+(,$2,/,$lines(%qdb)) $+ ): $v1 }
elseif ($2 == last && $lines(%qdb)) { msg # 14L07ast 14Q07uote14(07# $+ $v1 $+ 14)00: $read(%qdb,n,$v1) }
elseif ($2 == total) { msg # 14Total number of quotes:07 $lines(%qdb) }
elseif ($regex(wcore,$2,/^(wc|re)?search$/i)) {
msg # Searching through quote database for07 $3- $+ 14...
while ($read(%qdb,$iif($regml(wcore,1) = re,r,w),$iif($regml(wcore,1),$3-,$+(*,$3-,*)),%readn)) var %match = $addtok(%match,$readn,32) , %readn = $readn + 1
if (%match) { msg # Found quotes matching07 $3- $+ 14:07 %match }
else { msg # No quotes found matching07 $3- $+ 14. }
}
else { msg # Error in syntax or insufficient access to use method. Quote operation aborted. }
}